/* Home: one full-screen stage. The side panel swaps what the stage shows. */
body.home { overflow: hidden; height: 100svh; }
.stage { position: fixed; inset: 0; overflow: hidden; }
.layer { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .7s var(--ease), visibility 0s .7s; }
.layer.active { opacity: 1; visibility: visible; transition: opacity .7s var(--ease), visibility 0s; }

/* ---------- Home layer ---------- */
.layer-home { background: var(--ivory); color: var(--green); }
.silk { position: absolute; inset: -20%; filter: blur(70px); opacity: .95; }
.silk i { position: absolute; border-radius: 50%; mix-blend-mode: multiply; }
.silk i:nth-child(1) { width: 60vw; height: 60vw; left: 40%; top: -5%; background: var(--pistachio); animation: drift1 22s ease-in-out infinite alternate; }
.silk i:nth-child(2) { width: 45vw; height: 45vw; left: 5%; top: 35%; background: #E8EFD6; animation: drift2 26s ease-in-out infinite alternate; }
.silk i:nth-child(3) { width: 30vw; height: 30vw; left: 62%; top: 52%; background: #C9D8B4; animation: drift3 19s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-12vw, 10vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(14vw, -8vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(-8vw, -14vh) scale(1.2); } }

/* Everything on the stage starts to the right of the side panel, so nothing overlaps it. */
.stage { --clear: calc(var(--pad) + 250px); }
.headline { position: absolute; left: var(--clear); bottom: 6vh; margin: 0; font: 400 clamp(52px, 7vw, 136px)/1.02 var(--serif); letter-spacing: -.02em; }
.headline em { font-style: italic; }
.home-copy { position: absolute; right: calc(var(--pad) * 2); top: 28vh; width: min(340px, 34vw); display: grid; gap: 22px; justify-items: start; }
.kicker { margin: 0; font: 500 11px/1.7 var(--sans); letter-spacing: .22em; text-transform: uppercase; opacity: .7; }
.intro-text { margin: 0; font: 400 17px/1.5 var(--sans); }
.home-copy .fade-up:nth-child(2) { transition-delay: .12s; } .home-copy .fade-up:nth-child(3) { transition-delay: .24s; }
.headline .reveal-line:nth-child(2) > span { transition-delay: .1s; }

.badge { position: absolute; right: calc(var(--pad) * 2); bottom: 7vh; width: 150px; height: 150px; display: grid; place-items: center; color: var(--green); text-decoration: none; }
.badge svg { position: absolute; inset: 0; animation: spin 18s linear infinite; }
.badge text { font: 500 11.5px var(--sans); letter-spacing: .3em; fill: currentColor; }
.badge span { font: italic 400 34px/1 var(--serif); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Side panel ---------- */
.side { position: fixed; z-index: 30; left: var(--pad); top: 24vh; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.side a { display: inline-flex; align-items: center; height: 34px; padding: 0 15px; border-radius: 999px; font: 400 14px/1 var(--sans); text-decoration: none; color: var(--bar, var(--green)); background: color-mix(in srgb, currentColor 8%, transparent); backdrop-filter: blur(10px); opacity: 0; transform: translateX(-16px); transition: opacity .6s var(--ease), transform .6s var(--ease), background .3s, color .6s var(--ease); }
.side.in a { opacity: 1; transform: none; }
.side a:hover, .side a[aria-current="true"] { background: color-mix(in srgb, currentColor 18%, transparent); }
.side a.all { margin-top: 10px; font-style: italic; font-family: var(--serif); font-size: 18px; }

/* ---------- Project layers ---------- */
.layer-project { background: var(--bg); color: var(--fg); }
.layer-project::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 70% at 70% 40%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%); }
.devices { position: absolute; left: 47%; top: 43%; transform: translate(-50%, -50%) scale(.96); transition: transform 1s var(--ease); width: min(48vw, 800px); }
.layer.active .devices { transform: translate(-50%, -50%) scale(1); }
.laptop { position: relative; width: 100%; }
.laptop .screen { position: relative; aspect-ratio: 16 / 10; background: #0d0d0d; border-radius: 14px 14px 4px 4px; padding: 2.2% 2.2% 3%; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55); }
.laptop .view { width: 100%; height: 100%; overflow: hidden; border-radius: 4px; background: #fff; }
.laptop .view img { width: 100%; transform: translateY(0); }
.layer.active .laptop .view img { animation: siteScroll 16s cubic-bezier(.45, 0, .55, 1) 1s infinite alternate; }
@keyframes siteScroll { to { transform: translateY(var(--dist, -60%)); } }
.laptop .base { height: 14px; margin: 0 -6%; background: linear-gradient(#c9c9c9, #8d8d8d); border-radius: 0 0 16px 16px; }
/* Slim bezel and a lean, phone-shaped screen (9:18). The 9:16 videos lose only a sliver at each side. */
.phone { position: absolute; left: -10%; bottom: -10%; width: 23.5%; background: #0d0d0d; border-radius: 32px; padding: 5px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 70px -20px rgba(0, 0, 0, .6); }
.phone video { display: block; width: 100%; aspect-ratio: 9 / 18; object-fit: cover; border-radius: 27px; background: #222; }
.phone::after { content: ''; position: absolute; top: 12px; left: 50%; width: 22%; height: 9px; transform: translateX(-50%); background: #0d0d0d; border-radius: 99px; }
.devices.solo { width: min(52vw, 860px); transform: translate(-50%, -52%) scale(.96); }
.layer.active .devices.solo { transform: translate(-50%, -52%) scale(1); }

.p-title { position: absolute; left: var(--clear); right: var(--pad); bottom: 3vh; margin: 0; text-align: center; font: 400 clamp(52px, 7.4vw, 150px)/1 var(--serif); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; }
.p-title span { display: inline-block; transform: translateY(105%); transition: transform 1s var(--ease); }
.layer.active .p-title span { transform: none; }
.p-meta { position: absolute; top: 22vh; right: calc(var(--pad) * 1.5); width: min(270px, 20vw); display: grid; gap: 14px; }
.p-meta .no { font: 500 11px/1.7 var(--sans); letter-spacing: .2em; text-transform: uppercase; opacity: .7; }
.p-meta .tags { font: 500 13px/1.4 var(--sans); }
.p-meta p { margin: 0; font: 400 16px/1.5 var(--sans); opacity: .9; }
.p-meta a { justify-self: start; }
.p-meta > * { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease) .25s, transform .8s var(--ease) .25s; }
.layer.active .p-meta > * { opacity: 1; transform: none; }

/* ---------- Phones: vertical concept list ---------- */
.mlist { display: none; }
@media (max-width: 820px) {
  body.home { overflow: auto; height: auto; }
  body.home .stage { position: relative; height: 100svh; }
  body.home .side, body.home .layer-project { display: none; }
  .home .headline { bottom: 48px !important; }
  .mlist { display: grid; gap: 34px; padding: 40px var(--pad) 28px; background: var(--ivory); color: var(--green); }
  .mlist .kicker { margin: 0 0 -10px; }
  .mcard { display: grid; gap: 14px; text-decoration: none; color: inherit; }
  .mvis { position: relative; aspect-ratio: 4 / 4.6; border-radius: 18px; overflow: hidden; background: var(--bg); }
  .mvis::before { content: ''; position: absolute; inset: 0; background: radial-gradient(70% 60% at 70% 30%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%); z-index: 1; pointer-events: none; }
  .msite { position: absolute; left: 7%; top: 8%; width: 74%; height: auto; border-radius: 10px; box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .55); }
  .mphone { position: absolute; z-index: 2; right: 6%; bottom: 6%; width: 32%; padding: 4px; border-radius: 20px; background: #0d0d0d; box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .6); }
  .mphone img { width: 100%; aspect-ratio: 9 / 18; object-fit: cover; border-radius: 16px; }
  .minfo { display: grid; gap: 6px; }
  .minfo .no { font: 500 11px/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; opacity: .65; }
  .minfo b { font: 400 40px/1.05 var(--serif); letter-spacing: -.01em; }
  .minfo .go { font: 500 14px/1 var(--sans); opacity: .8; }
  .mcta { justify-self: start; margin-top: 6px; height: 46px; }
  .mfoot { display: grid; gap: 8px; padding-top: 22px; border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); font-size: 14px; opacity: .8; }
  .mfoot a { text-decoration: none; }
}

/* ---------- Phones and small screens ---------- */
@media (max-width: 820px) {
  .side { top: auto; bottom: 14px; left: 0; right: 0; flex-direction: row; overflow-x: auto; padding: 0 var(--pad); scrollbar-width: none; }
  .side a { flex: none; }
  .side a.all { margin: 0; font-size: 16px; }
  .headline { left: var(--pad); bottom: 92px; font-size: clamp(54px, 15vw, 120px); }
  .home-copy { top: 15vh; left: var(--pad); right: auto; width: auto; max-width: 420px; }
  .badge { width: 110px; height: 110px; right: var(--pad); top: 15vh; bottom: auto; display: none; }
  .devices, .devices.solo { left: 50%; width: 78vw; top: 36%; transform: translate(-50%, -50%) scale(.96); }
  .layer.active .devices, .layer.active .devices.solo { transform: translate(-50%, -50%) scale(1); }
  .phone { left: auto; right: -7%; bottom: -16%; width: 24%; border-radius: 20px; padding: 3px; }
  .phone video { border-radius: 17px; }
  .phone::after { top: 7px; height: 6px; }
  .p-meta { top: auto; bottom: calc(64px + 11vw + 26px); left: var(--pad); right: var(--pad); width: auto; gap: 10px; }
  .p-meta p { display: none; }
  .p-title { left: var(--pad); right: var(--pad); bottom: 70px; text-align: left; font-size: 11vw; line-height: 1.05; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .silk i, .badge svg, .layer.active .laptop .view img { animation: none; }
}
