@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Manrope:wght@400;500;600&display=swap");

:root {
  --ink: #1c1915;
  --muted: #5c564c;
  --paper: #f3efe6;
  --paper-2: #e8e1d4;
  --line: rgba(28, 25, 21, 0.12);
  --accent: #7a4e2d;
  --accent-2: #2f3d36;
  --white: #fcfaf6;
  --shadow: 0 18px 50px rgba(28, 25, 21, 0.08);
  --max: 1120px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #fff8ea 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e7ebe4 0%, transparent 50%),
    linear-gradient(180deg, #f7f3eb 0%, var(--paper) 40%, #efe8db 100%);
  font-family: var(--sans);
  line-height: 1.55;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea { font: inherit; }

.wrap { width: min(var(--max), calc(100% - 2rem)); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(243, 239, 230, 0.86);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem 0;
}
.brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); font-size: 0.92rem; }
.nav a:hover { color: var(--ink); }

.btn {
  appearance: none; border: 2px solid #1a1816; background: #1a1816; color: #faf8f5;
  padding: 0.75rem 1.15rem; border-radius: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font-weight: 600; letter-spacing: 0.04em;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); background: #000; border-color: #000; color: #faf8f5; }
.btn.secondary { background: #fff; color: #1a1816; border-color: #1a1816; }
.btn.secondary:hover { background: #f3f1ed; color: #1a1816; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); padding-inline: 0.4rem; font-weight: 500; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.hero {
  min-height: 0;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: center;
  padding: 3.5rem 0 4rem;
}
.hero-copy h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  line-height: 0.95;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.hero-copy .lede {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 34rem;
  margin-bottom: 1.75rem;
}
.hero-visual {
  position: relative;
  min-height: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-visual img {
  width: 100%; height: auto; object-fit: contain; min-height: 0;
  display: block;
  filter: none;
}
.hero-caption {
  position: absolute; left: 1rem; bottom: 1rem;
  background: rgba(252,250,246,0.88);
  padding: 0.55rem 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.section { padding: 4.5rem 0; border-top: 1px solid var(--line); }
.section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 1rem;
}
.section p.lead { color: var(--muted); max-width: 40rem; font-size: 1.05rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.panel {
  background: rgba(252,250,246,0.72);
  border: 1px solid var(--line);
  padding: 1.4rem;
}
.panel h3 { font-family: var(--serif); font-size: 1.55rem; font-weight: 500; margin: 0 0 0.6rem; }
.muted { color: var(--muted); }
.tag {
  display: inline-block; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.6rem;
}
.locked { opacity: 0.72; }
.locked .btn { pointer-events: none; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-shell {
  min-height: calc(100vh - 64px);
  display: grid; place-items: center;
  padding: 2rem 0;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-family: var(--serif); font-weight: 400; margin-top: 0; }
label { display: block; font-size: 0.85rem; margin: 0.85rem 0 0.35rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; padding: 0.7rem 0.8rem; border: 1px solid var(--line); background: #fff; border-radius: 0;
}
.check { display: flex; gap: 0.55rem; align-items: flex-start; margin-top: 0.9rem; font-size: 0.9rem; color: var(--muted); }
.error { color: #8a2a1c; font-size: 0.9rem; margin-top: 0.75rem; }
.ok { color: var(--accent-2); font-size: 0.9rem; margin-top: 0.75rem; }

.app-layout { padding: 2rem 0 4rem; }
.app-grid { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; }
.side {
  border-right: 1px solid var(--line);
  padding-right: 1rem;
}
.side a {
  display: block; text-decoration: none; padding: 0.45rem 0; color: var(--muted);
}
.side a.active, .side a:hover { color: var(--ink); }
.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line);
}
.badge {
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.badge.free { color: var(--accent-2); }
.badge.done { color: var(--accent); }

.quest {
  width: min(860px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}
.steps {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 1.5rem;
}
.steps button {
  border: 1px solid var(--line); background: transparent; padding: 0.45rem 0.7rem; cursor: pointer;
}
.steps button.active { background: var(--ink); color: var(--white); border-color: var(--ink); }
.steps button.done { border-color: var(--accent); }
.quest-panel h2 { font-family: var(--serif); font-weight: 400; font-size: 2.2rem; margin: 0 0 1rem; }
.quest-panel .body { white-space: pre-wrap; color: var(--ink); font-size: 1.05rem; }
.quest-art { margin: 1.25rem 0; }
.quest-art img { width: 100%; max-height: 520px; object-fit: contain; }
/* L01 matte lives in lfm-course.css under body.lesson-l01 — ARTWORK_EDGE_COLOR_INHERITANCE */
.quest-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.75rem; }

.vf-shell {
  border: 1px solid var(--line);
  background: #d9d1c2;
  padding: 0.75rem;
}
.vf-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; align-items: center;
}
.vf-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #cfc5b4;
  touch-action: none;
  user-select: none;
}
.vf-stage img.vf-image {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  pointer-events: none;
}
.vf-frame {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(20,16,12,0.45);
  cursor: grab;
  touch-action: none;
}
.vf-frame:active { cursor: grabbing; }
.vf-handle {
  position: absolute; width: 16px; height: 16px; background: #fff; border: 1px solid #333;
  right: -8px; bottom: -8px; cursor: nwse-resize; touch-action: none;
}
.diary-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem;
}
.diary-card {
  border: 1px solid var(--line); background: var(--white); padding: 0.6rem;
}
.diary-card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #ddd; }
.diary-card .meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.4rem; }

@media (max-width: 900px) {
  .hero, .grid-2, .grid-3, .app-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 2rem; }
  .hero-visual, .hero-visual img { min-height: 0; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
}
