@import url('https://fonts.googleapis.com/css2?family=Klee+One:wght@400;600&family=Noto+Sans+JP:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #183b35;
  --pine: #0c302c;
  --moss: #38684e;
  --leaf: #7e9d6d;
  --cream: #f3efe3;
  --paper: #fffdf5;
  --amber: #e3a642;
  --line: rgba(24, 59, 53, .16);
  --shadow: 0 28px 80px rgba(10, 43, 38, .16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.site-header {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 5vw, 76px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; font-size: 11px; line-height: 1.2; letter-spacing: .12em; }
.brand strong { font-size: 16px; font-weight: 800; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--ink); border-radius: 50%; font-size: 17px;
}
.header-link { font-size: 13px; font-weight: 700; letter-spacing: .04em; border-bottom: 1px solid var(--ink); padding: 6px 0; }

.intro {
  min-height: calc(100svh - 92px);
  display: grid;
  grid-template-columns: minmax(360px, .8fr) minmax(520px, 1.2fr);
  background: var(--paper);
}

.intro-copy {
  align-self: center;
  padding: clamp(56px, 8vw, 120px) clamp(34px, 6vw, 100px);
}

.eyebrow, .section-kicker {
  margin: 0 0 18px; color: var(--moss); font-size: 11px; font-weight: 800;
  letter-spacing: .22em;
}

.intro h1, h2 { margin: 0; letter-spacing: -.055em; line-height: 1.32; }
.intro h1 { font-family: "Klee One", serif; font-size: clamp(38px, 5.1vw, 72px); font-weight: 600; }
.intro h1 em { color: var(--moss); font-style: normal; white-space: nowrap; }
.lead { max-width: 470px; margin: 30px 0 38px; color: #4e625e; line-height: 2; font-size: 14px; }

.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  min-height: 54px; padding: 0 24px; display: inline-flex; align-items: center; justify-content: center; gap: 11px;
  border: 1px solid transparent; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 700;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button:focus-visible, .crop-handle:focus-visible, .text-button:focus-visible { outline: 3px solid #f3bb54; outline-offset: 3px; }
.button span { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; }
.button-primary { color: white; background: var(--pine); box-shadow: 0 10px 24px rgba(12, 48, 44, .16); }
.button-primary:hover { background: #174a42; }
.button-ghost { color: var(--ink); background: transparent; border-color: var(--line); }

.forest-window {
  position: relative; min-height: 560px; overflow: hidden;
  background: #789075 url("forest-scene.png") center / cover no-repeat;
  isolation: isolate;
}
.forest-window::after {
  content: ""; position: absolute; inset: auto 0 0; height: 38%; z-index: 1;
  background: linear-gradient(transparent, rgba(8, 44, 36, .25));
}
.sun-glow { position: absolute; width: 300px; height: 300px; top: 8%; left: 42%; border-radius: 50%; background: rgba(255, 220, 145, .24); filter: blur(35px); }
.demo-fox {
  position: absolute; z-index: 2; left: 12%; bottom: 16%; width: min(34%, 310px);
  filter: sepia(1) saturate(1.8) hue-rotate(340deg) drop-shadow(0 16px 10px rgba(12, 38, 30, .3));
  animation: demo-walk 9s ease-in-out infinite alternate, bob .48s ease-in-out infinite alternate;
}
.forest-caption { position: absolute; z-index: 3; right: 30px; bottom: 22px; margin: 0; color: white; font-size: 9px; letter-spacing: .18em; writing-mode: vertical-rl; }
.forest-caption span { display: inline-block; height: 35px; width: 1px; background: white; margin-bottom: 10px; }

@keyframes demo-walk { from { left: 8%; } to { left: 58%; } }
@keyframes bob { from { transform: translateY(0) rotate(-1deg); } to { transform: translateY(-7px) rotate(1deg); } }

.steps { padding: 105px clamp(24px, 7vw, 110px); background: var(--cream); }
.steps h2, .upload-heading h2, .result-copy h2 { font-family: "Klee One", serif; font-size: clamp(32px, 4vw, 54px); font-weight: 600; }
.step-list { list-style: none; margin: 55px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.step-list li { padding: 30px 4vw 10px 0; display: grid; gap: 9px; border-right: 1px solid var(--line); }
.step-list li + li { padding-left: 4vw; }
.step-list li:last-child { border-right: 0; }
.step-no { color: var(--amber); font-family: Georgia, serif; font-size: 13px; font-style: italic; }
.step-list strong { font-family: "Klee One", serif; font-size: 23px; }
.step-list small { color: #667873; font-size: 12px; }

.upload-section { padding: 110px clamp(24px, 7vw, 110px); background: #e5e9dc; }
.upload-heading { display: flex; align-items: end; justify-content: space-between; gap: 50px; margin-bottom: 54px; }
.upload-heading > p { max-width: 430px; margin: 0; color: #596c67; font-size: 13px; line-height: 2; }

.upload-card {
  min-height: 360px; padding: 50px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; border: 1px dashed rgba(24, 59, 53, .34); border-radius: 20px;
  background-color: rgba(255, 253, 245, .48);
  background-image: radial-gradient(rgba(24, 59, 53, .065) 1px, transparent 1px); background-size: 15px 15px;
  transition: background .2s, border-color .2s;
}
.upload-card.dragover { background-color: rgba(255,255,255,.85); border-color: var(--moss); }
.upload-icon { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 15px; border: 1px solid var(--ink); border-radius: 50%; }
.upload-icon span { font-size: 25px; transform: translateY(-2px); }
.upload-card h3 { margin: 0; font-family: "Klee One", serif; font-size: 24px; }
.upload-card > p { margin: 7px 0 22px; color: #71807c; font-size: 11px; }
.upload-card > small { margin-top: 14px; color: #71807c; font-size: 10px; }
.file-button input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }

.editor { margin-top: 26px; padding: clamp(20px, 4vw, 48px); background: var(--paper); border-radius: 22px; box-shadow: var(--shadow); }
.editor-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 24px; }
.editor-head h3 { margin: 0; font-family: "Klee One", serif; font-size: clamp(22px, 3vw, 34px); }
.text-button { border: 0; border-bottom: 1px solid currentColor; padding: 6px 0; color: #697a76; background: transparent; cursor: pointer; font-size: 12px; }
.crop-stage { position: relative; width: fit-content; max-width: 100%; margin: auto; overflow: hidden; background: #d9ddd6; touch-action: none; }
#photoCanvas { display: block; max-width: 100%; max-height: 68svh; }
.crop-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.crop-lines polygon { fill: rgba(227, 166, 66, .06); stroke: #f1b243; stroke-width: 2; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.crop-handle {
  position: absolute; z-index: 3; width: 32px; height: 32px; margin: -16px; border: 5px solid white; border-radius: 50%;
  background: var(--amber); box-shadow: 0 3px 14px rgba(0,0,0,.28); cursor: grab; touch-action: none;
}
.crop-handle:active { cursor: grabbing; transform: scale(1.1); }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; }
.editor-footer p { margin: 0; color: #687975; font-size: 12px; }

.result { display: grid; grid-template-columns: minmax(320px, .65fr) minmax(520px, 1.35fr); min-height: 670px; color: white; background: var(--pine); }
.result-copy { align-self: center; padding: 60px clamp(28px, 6vw, 90px); }
.result-copy .section-kicker { color: #c5a965; }
.result-copy > p:not(.section-kicker) { margin: 24px 0 34px; color: #c7d3ce; font-size: 13px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button-light { color: var(--pine); background: var(--paper); }
.button-outline-light { color: white; background: transparent; border-color: rgba(255,255,255,.35); }
.result-stage { position: relative; min-height: 520px; overflow: hidden; background: url("forest-scene.png") center / cover no-repeat; }
.result-stage::after { content: ""; position: absolute; inset: 60% 0 0; background: linear-gradient(transparent, rgba(7,35,30,.45)); }
.walker-track { position: absolute; z-index: 4; left: -35%; bottom: 15%; width: 30%; animation: cross-forest 13s linear infinite; }
.walker-track img { display: block; width: 100%; max-height: 260px; object-fit: contain; filter: drop-shadow(0 13px 8px rgba(0, 20, 15, .38)); animation: step-bob .42s ease-in-out infinite alternate; }
.mist { position: absolute; z-index: 3; width: 60%; height: 70px; border-radius: 50%; background: rgba(236,241,216,.16); filter: blur(22px); animation: drift 10s linear infinite alternate; }
.mist-a { left: -10%; bottom: 22%; }.mist-b { right: -15%; bottom: 36%; animation-delay: -4s; }
.leaf { position: absolute; z-index: 5; color: #d5b25b; opacity: .75; animation: leaf-fall 7s linear infinite; }
.leaf-one { left: 20%; top: -5%; }.leaf-two { left: 55%; top: -8%; animation-delay: -2s; }.leaf-three { left: 80%; top: -10%; animation-delay: -5s; }
@keyframes cross-forest { 0% { left: -32%; transform: scaleX(1); } 48% { left: 100%; transform: scaleX(1); } 49% { left: 100%; transform: scaleX(-1); } 98% { left: -32%; transform: scaleX(-1); } 100% { left: -32%; transform: scaleX(1); } }
@keyframes step-bob { to { transform: translateY(-9px) rotate(1.5deg); } }
@keyframes drift { to { transform: translateX(25%); } }
@keyframes leaf-fall { to { top: 110%; transform: translateX(80px) rotate(360deg); } }

footer { min-height: 250px; padding: 60px clamp(24px, 7vw, 110px); display: grid; grid-template-columns: 1fr 1fr; align-items: end; background: #082823; color: white; }
.footer-brand { align-self: start; }
footer p { margin: 0; text-align: right; font-family: "Klee One", serif; font-size: 18px; }
footer small { grid-column: 1 / -1; color: rgba(255,255,255,.45); font-size: 9px; letter-spacing: .14em; }

.toast { position: fixed; z-index: 50; left: 50%; bottom: 30px; padding: 12px 20px; color: white; background: rgba(8,40,35,.94); border-radius: 99px; opacity: 0; transform: translate(-50%, 20px); pointer-events: none; transition: .25s; font-size: 12px; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* Printable coloring sheet */
.print-page { background: #dfe5df; }
.print-toolbar { max-width: 900px; margin: 24px auto; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.print-toolbar a { border-bottom: 1px solid; font-size: 12px; font-weight: 700; }
.print-toolbar p { margin: 0; color: #5f716c; font-size: 11px; }
.print-sheet {
  position: relative; width: 210mm; height: 297mm; margin: 0 auto 40px; overflow: hidden;
  color: #111; background: white; box-shadow: 0 20px 70px rgba(15,40,35,.2);
}
.sheet-head { text-align: center; padding-top: 28mm; }
.sheet-head p { margin: 0 0 5mm; font-family: sans-serif; font-size: 7pt; font-weight: 700; letter-spacing: .3em; }
.sheet-head h1 { margin: 0; font-family: "Klee One", serif; font-size: 23pt; }
.sheet-head small { display: block; margin-top: 3mm; font-size: 9pt; }
.print-animal {
  position: absolute; left: 15%; top: 35%; width: 70%; height: auto;
  filter:
    drop-shadow(.6mm 0 0 #000) drop-shadow(-.6mm 0 0 #000)
    drop-shadow(0 .6mm 0 #000) drop-shadow(0 -.6mm 0 #000)
    drop-shadow(.45mm .45mm 0 #000) drop-shadow(-.45mm -.45mm 0 #000)
    drop-shadow(.45mm -.45mm 0 #000) drop-shadow(-.45mm .45mm 0 #000);
}
.name-line { position: absolute; left: 22mm; right: 22mm; bottom: 35mm; display: flex; align-items: end; gap: 6mm; font-size: 9pt; }
.name-line span { flex: 1; border-bottom: 1px solid #111; }
.sheet-note { position: absolute; bottom: 18mm; left: 20mm; right: 20mm; margin: 0; text-align: center; font-size: 8pt; }
.print-marker { position: absolute; width: 12mm; height: 12mm; display: grid; place-items: center; }
.print-marker span { width: 4mm; height: 4mm; border-radius: 50%; background: #000; }
.marker-tl { left: 8mm; top: 8mm; }.marker-tr { right: 8mm; top: 8mm; }.marker-br { right: 8mm; bottom: 8mm; }.marker-bl { left: 8mm; bottom: 8mm; }

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; }
  .intro-copy { padding-block: 70px; }
  .forest-window { min-height: 58svh; }
  .upload-heading { align-items: start; flex-direction: column; }
  .result { grid-template-columns: 1fr; }
  .result-stage { grid-row: 1; min-height: 58svh; }
  .result-copy { text-align: center; }
  .result-actions { justify-content: center; }
}

@media (max-width: 620px) {
  .site-header { height: 74px; }
  .brand-mark { width: 32px; height: 32px; }
  .header-link { font-size: 11px; }
  .intro { min-height: auto; }
  .intro-copy { padding: 52px 24px 58px; }
  .lead { margin-block: 24px 30px; }
  .intro-actions { flex-direction: column; align-items: stretch; }
  .forest-window { min-height: 430px; }
  .demo-fox { width: 40%; }
  .steps, .upload-section { padding: 78px 22px; }
  .step-list { grid-template-columns: 1fr; }
  .step-list li, .step-list li + li { padding: 22px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .upload-heading { margin-bottom: 32px; }
  .upload-card { min-height: 330px; }
  .editor { padding: 16px; border-radius: 16px; }
  .editor-head, .editor-footer { align-items: stretch; flex-direction: column; }
  .editor-footer .button { width: 100%; }
  .text-button { align-self: start; }
  .result-copy { padding: 58px 24px; }
  .result-stage { min-height: 420px; }
  .walker-track { width: 44%; }
  footer { grid-template-columns: 1fr; gap: 35px; }
  footer p { text-align: left; }
  footer small { grid-column: 1; }
  .print-toolbar { flex-wrap: wrap; }
  .print-sheet { transform-origin: top left; transform: scale(calc((100vw - 20px) / 793.7)); margin-left: 10px; margin-bottom: calc((100vw - 20px) * 1.4142 - 1122.5px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  .print-page { background: white; }
  .print-toolbar { display: none; }
  .print-sheet { margin: 0; box-shadow: none; transform: none; }
}
