/* DAMARECO landing page. Colors are the brand tokens in docs/brand/BRAND_PRINCIPLES.ja.md (brand/rec is used for shapes only, never text). */
:root {
  --mist: #F3F5F7;
  --mist-2: #DCE1E6;
  --graphite: #16191D;
  --ink: #1C1F24;
  --ink-2: #5B636D;
  --on-graphite: #F3F5F7;
  --on-graphite-2: #A9B0B8;
  --rec: #FF3B40;
  --active: #EFC400;

  --bg: var(--mist);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --line: var(--mist-2);
  --band: var(--graphite);
  --band-line: #2C3138;
  --phone-edge: #C4CBD3;

  --gutter: 16px;
  --max: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", "Yu Gothic UI", Meiryo, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--graphite);
    --text: var(--on-graphite);
    --text-2: var(--on-graphite-2);
    --line: #2C3138;
    --band: #0E1013;
    --band-line: #262A30;
    --phone-edge: #4A525C;
  }
}

@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 40px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.8 var(--font);
  letter-spacing: .02em;
  overflow-x: hidden;
}
@media (min-width: 600px) { body { font-size: 17px; } }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 3px solid #0A6CF0; outline-offset: 4px; border-radius: 4px; }
h1, h2, h3 { font-weight: 600; font-feature-settings: "palt"; letter-spacing: .01em; margin: 0; word-break: auto-phrase; }
h1 span, h2 span, h3 span { display: inline-block; }
p { margin: 0; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -60px; padding: 8px 12px; background: var(--text); color: var(--bg); border-radius: 8px; z-index: 10; }
.skip:focus { top: 12px; }

/* Header */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: .04em; }
.brand svg { width: 30px; height: 30px; }
.site-nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; font-size: 14px; }
.site-nav a { text-decoration: none; color: var(--text-2); padding-block: 6px; }
.site-nav a:hover { color: var(--text); }
.site-nav .lang { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; color: var(--text); }
@media (max-width: 599px) { .site-nav .opt { display: none; } }

/* Viewfinder corners, the frame shape used on the App Store images */
.finder { position: relative; }
.finder > .corner { position: absolute; width: clamp(28px, 5vw, 48px); height: clamp(28px, 5vw, 48px); border: 3px solid var(--text); pointer-events: none; }
.corner.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.corner.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.corner.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.corner.br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }

/* REC label: the red dot is the brand's only red */
.rec { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rec .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rec); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* Hero */
.hero { padding-top: 8px; }
.hero .finder { padding: clamp(28px, 6vw, 64px) clamp(20px, 5vw, 64px); }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.2fr .8fr; gap: 24px; } }
/* Sized so a 9em line (the widest headline so far) always fits on one line of its column */
.hero h1 { font-size: clamp(28px, 8.6vw, 44px); line-height: 1.22; margin: 14px 0 22px; }
@media (min-width: 600px) { .hero h1 { font-size: clamp(44px, 7vw, 60px); } }
@media (min-width: 900px) { .hero h1 { font-size: clamp(40px, 4.4vw + 4px, 58px); } }
.lead { font-size: clamp(16px, 2.2vw, 19px); color: var(--text-2); max-width: 30em; }
.cta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-top: 28px; }
.badge { display: inline-block; line-height: 0; border-radius: 9px; }
.badge img { height: 54px; width: auto; }
.badge .on-dark { display: none; }
@media (prefers-color-scheme: dark) { .badge .on-light { display: none; } .badge .on-dark { display: block; } }
.cta-meta { font-size: 13px; line-height: 1.6; color: var(--text-2); }

.phones { position: relative; width: min(100%, 440px); margin-inline: auto; aspect-ratio: 1 / 1.36; }
.phones .phone { position: absolute; width: 54%; }
.phones .phone.a { left: 0; top: 0; z-index: 2; }
.phones .phone.b { right: 0; top: 13%; }

.phone {
  aspect-ratio: 1320 / 2868;
  padding: 2.4%;
  border-radius: 15% / 7%;
  background: #08090B;
  box-shadow: 0 0 0 1.5px var(--phone-edge), 0 28px 50px -24px rgba(22, 25, 29, .45);
}
.phone img { width: 100%; height: 100%; border-radius: 12.6% / 5.9%; object-fit: cover; background: #000; }

/* Sections */
.section { padding-block: clamp(72px, 11vw, 128px); }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .12em; color: var(--text-2); margin-bottom: 12px; }
.section h2 { font-size: clamp(28px, 5.2vw, 44px); line-height: 1.3; }
.section-lead { margin-top: 18px; color: var(--text-2); max-width: 36em; }

/* How it works: the tape of frames. Only the latest 3 minutes stay; you pick the part you landed. */
.tape { margin: clamp(40px, 6vw, 64px) 0 0; }
.tape-labels { display: grid; grid-template-columns: 45fr 55fr; align-items: end; font-size: 13px; line-height: 1.5; color: var(--text-2); margin-bottom: 10px; }
.tape-labels .keep { color: var(--text); font-weight: 600; text-align: center; border-bottom: 2px solid var(--text); padding-bottom: 6px; position: relative; }
.tape-labels .keep::before, .tape-labels .keep::after { content: ""; position: absolute; bottom: -2px; width: 2px; height: 10px; background: var(--text); }
.tape-labels .keep::before { left: 0; }
.tape-labels .keep::after { right: 0; }
@media (min-width: 600px) { .tape-labels { grid-template-columns: 55fr 45fr; font-size: 14px; } }

.tape-track { position: relative; height: 64px; }
.tape-frames {
  position: absolute; inset: 0;
  background: url("img/tape-frame.webp") 0 50% / 26px 39px repeat-x;
  animation: flow 8s linear infinite;
}
.tape-fade { position: absolute; inset: 0 auto 0 0; width: 45%; background: linear-gradient(90deg, var(--bg) 4%, transparent); background: linear-gradient(90deg, var(--bg) 4%, color-mix(in srgb, var(--bg) 55%, transparent) 60%, transparent); }
@media (min-width: 600px) { .tape-fade { width: 55%; } }
.tape-now { position: absolute; right: -2px; top: -4px; bottom: -4px; width: 3px; border-radius: 2px; background: var(--text); }
.tape-now::before { content: ""; position: absolute; left: 50%; top: -14px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--rec); animation: rec-on 8s linear infinite; }
.tape-trim {
  position: absolute; right: 2%; width: 56px; top: 6px; bottom: 6px;
  border: solid var(--active); border-width: 3px 12px; border-radius: 7px;
  animation: trim-in 8s ease infinite;
}
.tape-trim::before, .tape-trim::after { content: ""; position: absolute; top: 50%; width: 6px; height: 6px; margin-top: -3px; border: solid #1C1F24; border-width: 0 0 2px 2px; }
.tape-trim::before { left: -8px; transform: rotate(45deg); }
.tape-trim::after { right: -8px; transform: rotate(-135deg); }
@media (min-width: 600px) { .tape-trim { width: 72px; } }
.tape-pick { display: flex; justify-content: flex-end; margin-top: 12px; font-size: 13px; font-weight: 600; }
.tape-pick span { animation: trim-in 8s ease infinite; }
@media (min-width: 600px) { .tape-pick { font-size: 14px; } }

/* The tape flows while recording (0–60%), stops, then the trim appears. Offset is a multiple of the 26px tile, so the loop is seamless. */
@keyframes flow { 0% { background-position-x: 0; } 60%, 100% { background-position-x: -260px; } }
@keyframes rec-on { 0%, 59% { opacity: 1; } 60%, 100% { opacity: 0; } }
@keyframes trim-in { 0%, 62% { opacity: 0; } 68%, 94% { opacity: 1; } 100% { opacity: 0; } }

.steps { list-style: none; margin: clamp(48px, 7vw, 72px) 0 0; padding: 0; display: grid; gap: 28px; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
.steps li { counter-increment: step; border-top: 1px solid var(--line); padding-top: 20px; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 30px; height: 30px; margin-bottom: 12px; border: 2px solid var(--text); border-radius: 8px; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.steps h3 { font-size: 19px; line-height: 1.5; margin-bottom: 8px; }
.steps p { color: var(--text-2); font-size: 15px; }

/* Feature rows */
.feature { display: grid; gap: 36px; align-items: center; }
.feature .phone { width: min(62%, 300px); margin-inline: auto; }
@media (min-width: 820px) {
  .feature { grid-template-columns: 1fr 1fr; gap: 64px; }
  .feature:not(.flip) .shot { order: -1; }
}
.feature p { margin-top: 18px; color: var(--text-2); }
.note { font-size: 13px; color: var(--text-2); margin-top: 14px; }
.ticks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 22px; font-size: 15px; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: .42em; width: 6px; height: 11px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Graphite band: the red recording bands read best on the dark ground */
.band { background: var(--band); color: var(--on-graphite); }
.band .eyebrow, .band p, .band .note { color: var(--on-graphite-2); }
.band .phone { --phone-edge: #4A525C; }

/* Three-up */
.trio { list-style: none; margin: clamp(40px, 6vw, 64px) 0 0; padding: 0; display: grid; gap: 40px; }
.trio li { display: grid; grid-template-columns: minmax(0, 40%) 1fr; gap: 20px; align-items: center; }
.trio h3 { font-size: 20px; line-height: 1.45; }
.trio p { margin-top: 10px; color: var(--text-2); font-size: 15px; }
@media (max-width: 420px) {
  .trio li { grid-template-columns: minmax(0, 34%) 1fr; gap: 16px; }
  .trio h3 { font-size: 18px; }
}
@media (min-width: 820px) {
  .trio { grid-template-columns: repeat(3, 1fr); gap: 40px; }
  .trio li { grid-template-columns: 1fr; align-items: start; gap: 28px; }
  .trio .phone { width: 78%; margin-inline: auto; }
}

/* Specs */
.specs { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 0 40px; }
@media (min-width: 700px) { .specs { grid-template-columns: 1fr 1fr; } }
.specs li { border-top: 1px solid var(--line); padding: 16px 0; }
.specs b { display: block; font-weight: 600; }
.specs span { display: block; color: var(--text-2); font-size: 15px; margin-top: 2px; }

/* FAQ */
.faq { margin-top: 32px; border-bottom: 1px solid var(--line); }
.faq details { border-top: 1px solid var(--line); }
.faq summary { word-break: auto-phrase; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 10px; height: 10px; border: solid var(--text-2); border-width: 0 2px 2px 0; transform: translateY(-3px) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq details p { padding: 0 0 20px; color: var(--text-2); max-width: 44em; }

/* Closing */
.closing .finder { padding: clamp(48px, 8vw, 88px) 24px; text-align: center; }
.closing .app-icon { width: 96px; height: 96px; margin: 0 auto 22px; }
.closing h2 { font-size: clamp(26px, 5vw, 40px); line-height: 1.35; }
.closing .cta { justify-content: center; }

/* Footer */
/* How it works, three.js guide. assets/lp.js sets .guide-on to reserve the height and .guide-ready once the stage can replace .tape and .steps. */
.guide { display: none; }
#how.guide-ready .tape, #how.guide-ready .steps { display: none; }
#how.guide-on .guide { display: block; width: 100vw; height: calc(640vh - var(--guide-static, 0px)); height: calc(640svh - var(--guide-static, 0px)); margin: 24px calc(50% - 50vw) 0; }
#how.guide-ready .guide { height: 640vh; height: 640svh; }
#how:not(.guide-ready) .guide-stage { visibility: hidden; }
.guide-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.guide-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.guide-frame.finder { position: absolute; inset: 8px; pointer-events: none; }
.guide-marks { position: absolute; top: 24px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.guide-marks button { position: relative; width: 34px; height: 34px; padding: 0; border: 2px solid var(--text); border-radius: 8px; background: transparent; color: var(--text); font: 600 14px/1 var(--font); font-variant-numeric: tabular-nums; cursor: pointer; }
.guide-marks button::after { content: ""; position: absolute; inset: -5px; }
.guide-marks button[aria-current="step"] { background: var(--active); border-color: var(--active); color: var(--ink); }
.guide-marks button:focus-visible { outline: 3px solid #0A6CF0; outline-offset: 2px; }
.guide-steps { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 28px; display: grid; margin: 0; padding: 0; list-style: none; }
.guide-steps li { grid-area: 1 / 1; align-self: end; opacity: 0; transition: opacity .2s; pointer-events: none; }
.guide-steps li.is-active { opacity: 1; pointer-events: auto; }
.guide-steps h3 { font-size: 21px; line-height: 1.4; margin-bottom: 4px; }
.guide-steps p { color: var(--text-2); font-size: 15px; line-height: 1.7; }
.guide-steps .badge { margin-top: 12px; }
.guide-labels { position: absolute; inset: 0; pointer-events: none; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.guide-labels span { position: absolute; top: 0; left: 0; }
.guide-labels .older { text-align: right; }
.guide-labels .keep { color: var(--text); font-weight: 600; text-align: center; border-top: 2px solid var(--text); padding-top: 6px; }
@media (min-width: 900px) and (min-aspect-ratio: 95/100) {
  .guide-marks { top: calc(50% - 130px); left: max(var(--gutter), calc(50vw - var(--max) / 2 + var(--gutter))); right: auto; justify-content: flex-start; }
  .guide-steps { top: calc(50% - 80px); bottom: auto; right: auto; left: max(var(--gutter), calc(50vw - var(--max) / 2 + var(--gutter))); width: min(34vw, 380px); }
  .guide-steps li { align-self: start; }
  .guide-steps h3 { font-size: 26px; }
  .guide-steps p { font-size: 16px; }
}

.site-footer { border-top: 1px solid var(--line); padding-block: 32px 48px; font-size: 13px; color: var(--text-2); }
.site-footer .wrap { display: grid; gap: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .rec .dot, .tape-frames, .tape-now::before, .tape-trim, .tape-pick span { animation: none; }
}

/* PC: from 1200px the page uses the window instead of showing the phone column larger. Narrower windows keep the rules above. */
@media (min-width: 1200px) {
  :root { --max: clamp(1120px, 88vw, 1720px); --gutter: 48px; }
  body { font-size: 18px; }

  /* The hero fills the first screen; 64vw stops it stretching on a portrait monitor */
  .hero { padding-top: 0; }
  .hero .finder { display: grid; align-items: center; min-height: min(calc(100vh - 84px), 64vw); min-height: min(calc(100svh - 84px), 64vw); padding: 32px clamp(48px, 4vw, 96px); }
  .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; }
  /* 9em is the widest headline line so far and must fit the left column */
  .hero h1 { font-size: clamp(50px, calc(4.8vw - 8px), 84px); }
  .lead { font-size: clamp(19px, 1.35vw, 23px); max-width: 28em; }
  .phones { width: min(100%, calc((100vh - 170px) / 1.36)); width: min(100%, calc((100svh - 170px) / 1.36)); }
  .phones .phone { width: 56%; }

  .section { padding-block: clamp(96px, 13vh, 168px); }
  .section h2 { font-size: clamp(44px, 3.5vw, 64px); }

  /* Section heads: the heading on the left, the explanation on the right */
  #how > .wrap { display: grid; grid-template-columns: 1fr 1fr; column-gap: 72px; }
  #how > .wrap > * { grid-column: 1 / -1; }
  #how > .wrap > h2 { grid-column: 1; }
  #how > .wrap > .section-lead { grid-column: 2; align-self: end; margin-top: 0; }

  .feature { gap: 96px; }
  .feature .phone { width: min(72%, calc(80vh * 1320 / 2868)); width: min(72%, calc(80svh * 1320 / 2868)); }

  .trio { gap: 64px; }
  .trio .phone { width: min(84%, calc(76vh * 1320 / 2868)); width: min(84%, calc(76svh * 1320 / 2868)); }
  .trio h3 { font-size: 24px; }
  .trio p { font-size: 17px; }

  /* 378px of phone shows the largest screenshot (720px wide) at 2x */
  .feature .phone, .trio .phone { max-width: 378px; }

  .specs { grid-template-columns: repeat(3, 1fr); gap: 0 56px; margin-top: 56px; }

  /* FAQ: the heading stays beside the answers */
  #faq > .wrap { display: grid; grid-template-columns: 5fr 7fr; grid-template-rows: auto 1fr; column-gap: 72px; }
  #faq .eyebrow, #faq h2 { grid-column: 1; }
  #faq h2 { font-size: clamp(36px, 2.8vw, 52px); }
  #faq .faq { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }

  .closing .finder { padding-block: 112px; }
  .closing h2 { font-size: clamp(40px, 3.5vw, 64px); }
}
@media (min-width: 1200px) and (min-aspect-ratio: 95/100) {
  .guide-steps { width: min(34vw, 480px); }
  .guide-steps h3 { font-size: 32px; }
  .guide-steps p { font-size: 18px; }
}
