/* Home page only. Shared pieces are in site.css, the phone in app.css, the Mac in mac.css. */

/* 1. Hero */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 120px var(--gutter) 96px;
}
.hero .jewel { margin-bottom: 40px; }
.hero h1 { font-size: clamp(46px, 7.6vw, 108px); }

/* 2. The problem, lit word by word */
.problem { height: 240svh; }
.problem .pin { display: flex; flex-direction: column; justify-content: center; padding: 0 var(--gutter); max-width: 1180px; margin: 0 auto; }
.said { font-size: clamp(30px, 4.3vw, 58px); font-weight: 460; line-height: 1.14; letter-spacing: -.035em; max-width: 18em; }
.said .w { opacity: calc(.14 + .86 * var(--lit, 0)); transition: opacity .25s linear; }
.turn { margin-top: 40px; font-size: clamp(16px, 1.4vw, 19px); color: var(--ink-2); opacity: 0; transform: translateY(10px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.problem.lit .turn { opacity: .9; transform: none; }

/* 3. How it works: steps beside the phone */
.how { padding-top: clamp(40px, 8vh, 100px); }
.how-track { height: 360svh; }
.how .pin {
  display: grid; grid-template-columns: minmax(0, 430px) auto; align-items: center; justify-content: center;
  gap: clamp(48px, 8vw, 140px); padding: 72px var(--gutter) 24px;
}
.steps { list-style: none; display: grid; }
.steps button {
  display: grid; grid-template-columns: 48px 1fr; text-align: left; width: 100%;
  padding: 26px 0 28px; position: relative; opacity: .32; transition: opacity .6s var(--ease);
}
.steps button::before, .steps button::after { content: ""; position: absolute; top: 0; left: 0; height: 1px; }
.steps button::before { right: 0; background: var(--line); }
.steps button::after { width: calc(var(--p, 0) * 100%); background: var(--ink-3); }
.steps .n { grid-row: span 2; font-size: 12px; padding-top: 8px; color: var(--ink-4); font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.steps .t { font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -.02em; line-height: 1.25; }
.steps .d { margin-top: 8px; color: var(--ink-3); font-size: 15px; line-height: 1.55; max-width: 26em; }
.steps button:hover { opacity: .6; }
.steps button.on { opacity: 1; }
.steps button.on .n { color: var(--ink-2); }
.ticks { display: none; }

@media (max-width: 900px), (orientation: landscape) and (max-height: 500px) {
  .how-track { height: 330svh; }
  .how .pin { grid-template-columns: 1fr; grid-template-rows: auto auto auto; justify-items: center; align-content: center; gap: 22px; padding: 76px var(--gutter) 20px; }
  .how .device { grid-row: 1; }
  .how .phone { height: min(560px, calc(100svh - 330px)); min-height: 340px; }
  .steps { grid-row: 2; width: 100%; max-width: 420px; }
  .steps li { grid-area: 1 / 1; }
  .steps button { padding: 0; opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .6s var(--ease); pointer-events: none; text-align: center; grid-template-columns: 1fr; }
  .steps button.on { opacity: 1; transform: none; pointer-events: auto; }
  .steps button::before, .steps button::after { display: none; }
  .steps .n { display: none; }
  .steps .d { margin-inline: auto; }
  .ticks { grid-row: 3; display: flex; gap: 6px; }
  .ticks i { width: 22px; height: 2px; border-radius: 1px; background: var(--line-2); transition: background .4s; }
  .ticks i.on { background: var(--amber); }
}
/* A phone on its side: too short to stack, so the steps sit beside the phone again. */
@media (orientation: landscape) and (max-height: 500px) {
  .how .pin { grid-template-columns: minmax(0, 360px) auto; grid-template-rows: auto auto; justify-items: start; align-content: center; gap: 18px 56px; padding: 64px var(--gutter) 12px; }
  .how .device { grid-row: 1 / span 2; grid-column: 2; }
  .how .phone { height: calc(100svh - 84px); min-height: 0; }
  .steps { grid-row: 1; grid-column: 1; }
  .steps button { text-align: left; }
  .steps .d { margin-inline: 0; }
  .ticks { grid-row: 2; grid-column: 1; }
}

/* 4. Focus, on a Mac */
.focus { padding-top: clamp(120px, 20vh, 220px); }
.focus-track { height: 420svh; }
.focus .pin { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; padding: 70px var(--gutter) 20px; }
.focus-fine { max-width: 38em; margin: 8px auto 0; padding: 0 var(--gutter); text-align: center; }
/* Where the pointer is in each beat (on the 1280 × 800 screen) */
.b-1 .cur, .b-2 .cur { left: calc(var(--u) * 640); top: calc(var(--u) * 360); }
.b-3 .cur { left: calc(var(--u) * 480); top: calc(var(--u) * 500); }
@media (max-width: 700px) { .focus .pin { gap: 14px; } }

/* 5. Keep: the day as a card (components/RecapCard.tsx): 9 × 16, in Stone, three of its six layouts */
.keep { padding-top: clamp(140px, 22vh, 240px); }
.cards { display: flex; justify-content: center; align-items: center; margin: 72px auto 0; padding: 0 var(--gutter); }
.card {
  --cw: clamp(176px, 21vw, 280px);
  position: relative; flex: none; width: var(--cw); aspect-ratio: 9 / 16; container-type: inline-size;
  border-radius: 14px; overflow: hidden; margin: 0 calc(var(--cw) * -.12);
  background: radial-gradient(95% 38% at 50% -4%, rgba(243, 178, 94, .17), transparent 72%), #0a0908; color: #f4ede2;
  box-shadow: 0 40px 90px -30px #000, 0 0 0 1px rgba(255, 255, 255, .07);
  transition: transform 1.3s var(--ease), opacity 1s var(--ease);
}
.card > * { position: absolute; }
.cards.reveal { opacity: 1; transform: none; }
.cards:not(.in) .card { opacity: 0; }
.cards:not(.in) .c-moments { transform: translateX(55%) rotate(0deg) translateY(30px); }
.cards:not(.in) .c-rings { transform: translateX(-55%) rotate(0deg) translateY(30px); }
.cards:not(.in) .c-photo { transform: translateY(40px); }
.c-moments { transform: rotate(-7deg) translateY(22px); z-index: 1; transition-delay: .15s; }
.c-photo { z-index: 2; transform: translateY(-6px); }
.c-rings { transform: rotate(7deg) translateY(22px); z-index: 1; transition-delay: .15s; }
@media (hover: hover) {
  .cards.in:hover .c-moments { transform: rotate(-9deg) translate(-12%, 18px); transition-delay: 0s; }
  .cards.in:hover .c-rings { transform: rotate(9deg) translate(12%, 18px); transition-delay: 0s; }
}
.card-names { display: flex; justify-content: center; gap: clamp(56px, 12vw, 180px); margin-top: 40px; font-size: 13px; color: var(--ink-4); }

/* What every layout shares: the day over it, the song, the mark */
.cd-over { left: 8cqw; top: 9cqw; font-size: 2.5cqw; letter-spacing: .18em; text-transform: uppercase; color: #8c8377; }
.cd-song { left: 8cqw; right: 8cqw; bottom: 15cqw; display: flex; align-items: center; gap: 2.4cqw; font-size: 3.2cqw; white-space: nowrap; }
.cd-song img { width: 6.4cqw; height: 6.4cqw; border-radius: .8cqw; object-fit: cover; }
.cd-song span { color: #8c8377; }
.cd-mark { right: 8cqw; bottom: 7cqw; display: flex; align-items: center; gap: 1.2cqw; font-size: 2.2cqw; letter-spacing: .22em; text-transform: uppercase; color: #8c8377; }
.cd-mark img { width: 2.6cqw; height: 2.6cqw; }
.cd-sum { font-size: 3.2cqw; color: #8c8377; }

/* Photo: the day's photo, its name under it */
.c-photo > img { left: 0; top: 0; width: 100%; height: 66%; object-fit: cover; -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent); }
.c-photo .cd-over { top: auto; bottom: 74cqw; }
.cd-day { left: 8cqw; bottom: 58cqw; font-size: 12cqw; font-weight: 300; letter-spacing: -.02em; line-height: 1; }
.c-photo .cd-sum { left: 8cqw; bottom: 51cqw; }

/* Moments: the time, a photo or three, where it went */
.cd-time { left: 8cqw; top: 14.5cqw; font-size: 7.4cqw; font-weight: 300; letter-spacing: -.015em; }
.cd-grid { left: 8cqw; right: 8cqw; top: 28cqw; display: grid; grid-template-columns: 1fr 1fr; gap: 1.8cqw; }
.cd-grid img { width: 100%; height: 38cqw; object-fit: cover; border-radius: 1.4cqw; }
.cd-grid img:first-child { grid-column: span 2; height: 48cqw; }
.cd-bar { left: 8cqw; right: 8cqw; top: 122cqw; display: flex; gap: .6cqw; height: 2.2cqw; }
.cd-bar b { border-radius: 99px; background: #f4ede2; }
.cd-bar b + b { background: #8c8377; }
.c-moments .cd-sum { left: 8cqw; top: 127cqw; }

/* Rings: each area against its aim */
.cd-rings { left: 14cqw; top: 22cqw; width: 72cqw; aspect-ratio: 1; }
.cd-rings svg { position: absolute; inset: 0; width: 100%; transform: rotate(-90deg); }
.cd-rings circle { fill: none; stroke-width: 4.2; stroke-linecap: round; }
.cd-rings .tr { stroke: rgba(244, 237, 226, .07); stroke-linecap: butt; }
.cd-rings .o { stroke: var(--good); }
.cd-rings .i { stroke: #a6c96f; stroke-dasharray: 1; stroke-dashoffset: .5; }
.cd-rings p { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 8.6cqw; font-weight: 300; letter-spacing: -.02em; }
.cd-rings small { font-size: 2.4cqw; letter-spacing: .18em; text-transform: uppercase; color: #8c8377; }
.cd-legend { left: 12cqw; right: 12cqw; top: 104cqw; list-style: none; font-size: 3.3cqw; }
.cd-legend li { display: flex; align-items: center; gap: 2.4cqw; padding: 1.4cqw 0; }
.cd-legend i { width: 2cqw; height: 2cqw; border-radius: 50%; background: var(--good); }
.cd-legend li + li i { background: #a6c96f; }
.cd-legend span { margin-left: auto; }
.cd-legend small { font-size: inherit; color: #8c8377; }

@media (max-width: 700px) {
  .card { --cw: 46vw; margin: 0 -9vw; }
  .card-names { gap: 18vw; }
}

/* 6. Two doors: Plugins, AI */
.more { padding-top: clamp(140px, 22vh, 240px); }
.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 1040px; margin: 64px auto 0; padding: 0 var(--gutter); }
.door {
  display: flex; flex-direction: column; gap: 14px; padding: clamp(28px, 4vw, 44px); border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 240, 220, .035), rgba(255, 240, 220, .01)); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .5s var(--ease), background .5s var(--ease);
}
.door:hover { box-shadow: inset 0 0 0 1px var(--line-2); background: linear-gradient(180deg, rgba(255, 240, 220, .055), rgba(255, 240, 220, .015)); }
.door-icons { display: flex; align-items: center; gap: 4px; min-height: 92px; margin: 0 0 6px -8px; }
.door-icons img { flex: 1 1 0; min-width: 0; max-width: 64px; height: auto; aspect-ratio: 1; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .6)); transition: transform .6s var(--ease); }
.door:hover .door-icons img { transform: translateY(-3px); }
.door:hover .door-icons img:nth-child(2) { transition-delay: .04s; }
.door:hover .door-icons img:nth-child(3) { transition-delay: .08s; }
.door:hover .door-icons img:nth-child(4) { transition-delay: .12s; }
.door:hover .door-icons img:nth-child(5) { transition-delay: .16s; }
.door:hover .door-icons img:nth-child(6) { transition-delay: .2s; }
/* The card under Driff's pop-up ring, as Focus draws it: the tutor checking in */
.door-pop { display: grid; justify-items: center; gap: 2px; width: min(300px, 100%); margin: 0 0 6px; padding: 12px; border-radius: 16px; text-align: center; background: #0a0908; box-shadow: inset 0 0 0 1px #2d2b29, 0 18px 40px -16px #000; transition: transform .6s var(--ease); }
.door:hover .door-pop { transform: translateY(-3px); }
.door-pop .dp-text { font-size: 14px; line-height: 1.35; color: var(--ink); }
.door-pop .dp-sub { font-size: 13px; line-height: 1.35; color: var(--ink-3); }
.door-pop .dp-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.door-pop .dp-acts i { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 14px; box-shadow: inset 0 0 0 1px #2d2b29; font-style: normal; font-size: 12px; color: var(--ink); }
.door-pop .dp-acts i:first-child { background: var(--ink); color: #0a0908; box-shadow: none; }
.door-t { font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -.025em; line-height: 1.2; }
.door-d { color: var(--ink-3); font-size: 15.5px; line-height: 1.6; max-width: 28em; }
.door-names { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.door-go { margin-top: auto; padding-top: 18px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.door:hover .door-go { color: var(--ink); }
.door:hover .chev { transform: translateX(3px); }
.doors .reveal:nth-child(2) { transition-delay: .08s; }
@media (max-width: 760px) { .doors { grid-template-columns: minmax(0, 1fr); } }

/* 7. Private */
.private { padding: clamp(140px, 22vh, 240px) var(--gutter) 0; }
.private .vault { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: end; gap: 40px; }
.vault h2 { text-align: left; }
.vault .sub { margin: 22px 0 0; }
.vault .onward { text-align: left; margin-top: 22px; }
.private .tags { justify-content: flex-end; }
@media (max-width: 860px) {
  .private .vault { grid-template-columns: 1fr; }
  .private .tags { justify-content: flex-start; }
}

/* 8. Close */
.close { padding: clamp(160px, 26vh, 280px) var(--gutter) 0; text-align: center; }
.close h2 { font-size: clamp(34px, 5vw, 66px); line-height: 1.06; letter-spacing: -.035em; }
.jewel.big { width: clamp(150px, 18vw, 220px); margin-bottom: 56px; }
.close .sub { margin-top: 18px; }
.close .actions { margin-top: 36px; }

@media (prefers-reduced-motion: reduce) {
  .card, .steps button, .turn { transition-duration: .01s !important; transition-delay: 0s !important; }
}
