/* ==========================================================================
   Yohannes Sida — portfolio
   Paper-and-ink gallery; the page borrows each project's colours as you pass it.
   ========================================================================== */

/* Registered so the whole page can glide between project palettes. */
@property --bg  { syntax: "<color>"; inherits: true; initial-value: #f3efe8; }
@property --fg  { syntax: "<color>"; inherits: true; initial-value: #191714; }
@property --acc { syntax: "<color>"; inherits: true; initial-value: #d9542c; }

:root {
  --paper: #f3efe8;
  --paper-2: #ebe5db;
  --ink: #191714;
  --muted: #6c655b;
  --vermilion: #d9542c;

  --bg: var(--paper);
  --fg: var(--ink);
  --acc: var(--vermilion);
  --line: color-mix(in oklab, var(--fg) 16%, transparent);
  --soft: color-mix(in oklab, var(--fg) 62%, var(--bg));

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.22, .8, .2, 1);
  --nav-h: 68px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-h); transition: --bg 1s var(--ease), --fg 1s var(--ease), --acc 1s var(--ease); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--acc); color: var(--bg); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* ---------- Shared bits ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  margin: 0 0 1.2rem; font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--soft);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); flex: none; }
.h2 {
  margin: 0; font: 400 clamp(2.4rem, 5.6vw, 5rem)/1 var(--serif); letter-spacing: -.02em;
  font-variation-settings: "opsz" 72; text-wrap: balance;
}
.lede { max-width: 38rem; font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--soft); text-wrap: pretty; }

.btn {
  --b: var(--fg);
  display: inline-flex; align-items: center; gap: .55em; min-height: 48px; padding: 0 1.35em;
  border: 0; border-radius: 999px; background: var(--b); color: var(--bg);
  font-weight: 600; font-size: .98rem; text-decoration: none; cursor: pointer;
  transition: transform .4s var(--ease), background-color .3s, box-shadow .4s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -12px color-mix(in oklab, var(--fg) 60%, transparent); }
.btn span { transition: transform .4s var(--ease); }
.btn:hover span { transform: translateX(3px); }
.btn--small { min-height: 40px; padding: 0 1.1em; font-size: .9rem; }
.btn--big { min-height: 60px; padding: 0 1.8em; font-size: 1.08rem; }
.link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 600; text-decoration: none; background: linear-gradient(currentColor 0 0) 0 calc(100% - 10px) / 100% 1px no-repeat;
  transition: background-size .4s var(--ease);
}
.link:hover { background-size: 0 1px; background-position-x: 100%; }

.mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--fg); color: var(--bg); font: italic 500 1.05rem/1 var(--serif); letter-spacing: -.02em; padding-bottom: 2px;
}
.mark--big { width: 96px; height: 96px; font-size: 2.8rem; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 40; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 var(--gutter);
  transition: background-color .5s, box-shadow .5s, transform .5s var(--ease);
}
.nav.is-solid {
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 0 var(--line);
}
.nav.is-hidden { transform: translateY(-100%); }
.nav__brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; font-weight: 600; letter-spacing: -.01em; min-height: 44px; }
.nav__links { display: flex; gap: 2rem; }
.nav__links a { text-decoration: none; font-size: .95rem; color: var(--soft); transition: color .3s; padding: 10px 0; }
.nav__links a:hover { color: var(--fg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: grid; align-content: end;
  padding: calc(var(--nav-h) + 4vh) var(--gutter) clamp(28px, 6vh, 64px); overflow: hidden; isolation: isolate;
}
.wall {
  position: absolute; z-index: -2; top: -18%; right: -20%; width: 92%; height: 140%;
  display: flex; gap: 22px; transform: perspective(1800px) rotateX(24deg) rotateY(-14deg) rotateZ(9deg);
  transform-origin: 60% 40%;
}
.wall__col { flex: 1; display: flex; flex-direction: column; gap: 22px; animation: drift var(--dur, 60s) linear infinite; will-change: transform; }
.wall__col:nth-child(even) { animation-direction: reverse; }
.wall:hover .wall__col { animation-play-state: paused; }
@keyframes drift { to { transform: translateY(-50%); } }
.tile {
  position: relative; display: block; width: 100%; border: 0; padding: 0; cursor: pointer; background: #111;
  border-radius: 10px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(25, 23, 20, .55), 0 0 0 1px rgba(25, 23, 20, .08);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.tile::before { content: ""; display: block; height: 16px; background: #ece7df linear-gradient(90deg, #e2654d 0 6px, transparent 6px 12px, #e7b04c 12px 18px, transparent 18px 24px, #6bb26f 24px 30px, transparent 30px) 8px 50% / 30px 6px no-repeat; }
.tile img, .tile video { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.tile video { position: absolute; left: 0; bottom: 0; opacity: 0; transition: opacity .6s; }
.tile video.is-on { opacity: 1; }
.tile:hover { transform: scale(1.05); box-shadow: 0 40px 80px -30px rgba(25, 23, 20, .7); z-index: 2; }
.hero__veil {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, var(--paper) 0%, color-mix(in oklab, var(--paper) 94%, transparent) 40%, color-mix(in oklab, var(--paper) 55%, transparent) 56%, color-mix(in oklab, var(--paper) 0%, transparent) 76%),
    linear-gradient(0deg, var(--paper) 0%, transparent 34%),
    linear-gradient(180deg, var(--paper) 0%, transparent 18%);
}
.hero__inner { max-width: 62rem; }
.hero__title {
  margin: 0 0 1.6rem; font: 350 clamp(3rem, 8.4vw, 8.4rem)/.92 var(--serif); letter-spacing: -.035em;
  font-variation-settings: "opsz" 72; text-wrap: balance;
}
.hero__title em { font-style: italic; font-weight: 300; color: var(--acc); }
.hero__lede { max-width: 33rem; margin: 0 0 2rem; font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--soft); text-wrap: pretty; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1.6rem; }
.hero__foot {
  display: flex; align-items: center; gap: .7rem; margin: clamp(2.5rem, 7vh, 4.5rem) 0 0;
  font-size: .85rem; color: var(--soft);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #3fb950; box-shadow: 0 0 0 0 rgba(63, 185, 80, .5); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(63, 185, 80, 0); } 100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); } }

/* ---------- Ticker ---------- */
.ticker { overflow: hidden; border-block: 1px solid var(--line); padding: 1.1rem 0; }
.ticker__track { display: flex; width: max-content; gap: 2.2rem; align-items: center; animation: tick 48s linear infinite; }
.ticker span { font: italic 300 clamp(1.4rem, 2.6vw, 2.2rem)/1 var(--serif); white-space: nowrap; }
.ticker i { font-style: normal; color: var(--acc); font-size: 1.2rem; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- Work ---------- */
.work { position: relative; overflow-x: clip; padding-top: clamp(80px, 14vh, 160px); }
.work__intro { padding: 0 var(--gutter) clamp(40px, 8vh, 90px); max-width: 64rem; }
.work__intro .h2 { margin-bottom: 1.4rem; }
.work__note { max-width: 44rem; margin: 0; padding: clamp(40px, 8vh, 80px) var(--gutter) 0; font-size: .85rem; color: var(--soft); }

/* Each project: a tall section with a pinned stage, so scrolling past it scrubs the preview. */
.proj { position: relative; height: 210svh; background: var(--p-bg); color: var(--p-fg); }
.js .proj { background: transparent; color: inherit; }
.proj__pin {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: grid; grid-template-columns: minmax(300px, .78fr) 1.6fr; align-items: center; gap: clamp(24px, 4vw, 72px);
  padding: calc(var(--nav-h) + 2vh) calc(var(--gutter) + 64px) 4vh var(--gutter);
}
.proj__ghost {
  position: absolute; z-index: 0; left: 0; bottom: -.12em; margin: 0; white-space: nowrap; pointer-events: none;
  font: italic 300 clamp(8rem, 24vw, 26rem)/1 var(--serif); letter-spacing: -.05em;
  color: transparent; -webkit-text-stroke: 1px color-mix(in oklab, var(--acc) 55%, transparent);
  transform: translate3d(calc(12vw - var(--k, 0) * 40vw), 0, 0);
  opacity: .9;
}
.proj__meta { position: relative; z-index: 2; max-width: 30rem; }
.proj__kind { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin: 0 0 1.2rem; font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.proj__kind span:first-child { color: var(--acc); }
.proj__kind span:last-child { color: var(--soft); }
.proj__title { margin: 0 0 1.1rem; font: 400 clamp(2.4rem, 4.6vw, 4.6rem)/.95 var(--serif); letter-spacing: -.03em; font-variation-settings: "opsz" 72; }
.proj__story { margin: 0 0 1.4rem; color: var(--soft); font-size: 1.04rem; text-wrap: pretty; }
.proj__tags { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.8rem; padding: 0; list-style: none; }
.proj__tags li { padding: .32rem .75rem; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; background: var(--bg); }
.proj__open { --b: var(--acc); color: var(--bg); }
.proj--dark .proj__open { color: #0b0b0b; }

.win {
  position: relative; z-index: 1; display: block; text-decoration: none; cursor: pointer;
  border-radius: 14px; overflow: hidden; background: #0d0d0d;
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .55), 0 0 0 1px color-mix(in oklab, var(--fg) 14%, transparent);
  transform: perspective(2200px) rotateY(calc(-9deg + var(--k, 0) * 12deg)) rotateX(calc(4deg - var(--k, 0) * 6deg)) translateY(calc(30px - var(--k, 0) * 60px));
  transition: box-shadow .6s var(--ease);
}
.win:hover { box-shadow: 0 60px 120px -40px rgba(0, 0, 0, .7), 0 0 0 1px var(--acc); }
.win__chrome { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; background: #1b1b1d; }
.win__chrome i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.win__chrome i:nth-child(2) { background: #febc2e; }
.win__chrome i:nth-child(3) { background: #28c840; }
.win__url {
  flex: 1; max-width: 26rem; margin-inline: auto; padding: .28rem .8rem; border-radius: 7px; background: #2a2a2d;
  color: #a5a5aa; font-size: .74rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.win__screen { position: relative; display: block; aspect-ratio: 16 / 10; }
.win__screen img, .win__screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.win__screen video { opacity: 0; transition: opacity .5s; }
.win__screen video.is-ready { opacity: 1; }

/* Project index rail */
.rail {
  position: fixed; z-index: 30; right: clamp(12px, 2vw, 28px); top: 50%; transform: translate(12px, -50%);
  display: flex; flex-direction: column; gap: 2px; opacity: 0; pointer-events: none; transition: opacity .5s, transform .5s var(--ease);
}
.in-work .rail { opacity: 1; pointer-events: auto; transform: translate(0, -50%); }
.rail a {
  position: relative; display: flex; align-items: center; justify-content: flex-end; gap: .7rem; min-height: 26px;
  text-decoration: none; font-size: .78rem; color: var(--fg);
}
.rail a span { opacity: 0; transform: translateX(6px); transition: opacity .3s, transform .3s var(--ease); white-space: nowrap; }
.rail a::after { content: ""; width: 14px; height: 2px; border-radius: 2px; background: currentColor; opacity: .3; transition: width .4s var(--ease), opacity .3s, background-color .3s; }
.rail a[aria-current="true"]::after { width: 34px; opacity: 1; background: var(--acc); }
.rail:hover a span, .rail a:focus-visible span { opacity: 1; transform: none; }
.rail:hover { padding-left: 1.4rem; background: color-mix(in oklab, var(--bg) 86%, transparent); border-radius: 12px; }
.rail:hover a:not(:hover):not([aria-current="true"]) span { opacity: .55; }

/* ---------- Approach ---------- */
.approach { padding: clamp(100px, 18vh, 200px) var(--gutter) clamp(80px, 12vh, 140px); }
.approach__head { max-width: 50rem; margin-bottom: clamp(48px, 8vh, 90px); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 44px); margin: 0 0 clamp(48px, 8vh, 80px); padding: 0; list-style: none; }
.step { padding-top: 1.4rem; border-top: 1px solid var(--fg); }
.step h3 { margin: 0 0 .8rem; font: 400 1.65rem/1.1 var(--serif); letter-spacing: -.015em; }
.step p { margin: 0; color: var(--soft); font-size: .98rem; }
.included { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.included li { padding: .55rem 1.05rem; border-radius: 999px; background: color-mix(in oklab, var(--fg) 6%, var(--bg)); font-size: .92rem; }

/* ---------- About ---------- */
.about {
  display: grid; grid-template-columns: minmax(260px, .8fr) 1fr; gap: clamp(32px, 6vw, 100px); align-items: center;
  padding: clamp(60px, 10vh, 120px) var(--gutter);
}
.portrait { position: relative; margin: 0; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; background: var(--paper-2); }
.portrait img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.portrait__empty {
  position: absolute; inset: 14px; display: grid; place-content: center; justify-items: center; gap: 1rem;
  border: 1.5px dashed color-mix(in oklab, var(--fg) 28%, transparent); border-radius: 12px; color: var(--soft); font-size: .9rem;
}
.portrait figcaption {
  position: absolute; z-index: 2; left: 16px; bottom: 16px; padding: .35rem .8rem; border-radius: 999px;
  background: var(--bg); font-size: .78rem; font-weight: 600;
}
.about__copy { max-width: 36rem; }
.about__copy .h2 { margin-bottom: 1.6rem; }
.about__copy p { color: var(--soft); font-size: 1.08rem; text-wrap: pretty; }
.about__personal { font-family: var(--serif); font-style: italic; font-size: 1.25rem !important; color: var(--fg) !important; }
.facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 2.4rem; margin: 2.2rem 0 0; }
.facts div { display: flex; flex-direction: column-reverse; }
.facts dt { font-size: .78rem; color: var(--soft); }
.facts dd { margin: 0; font: 400 2.4rem/1.1 var(--serif); }

/* ---------- Contact ---------- */
.contact { padding: clamp(100px, 18vh, 200px) var(--gutter); text-align: center; display: grid; justify-items: center; }
.contact__title em { font-style: italic; font-weight: 300; color: var(--acc); }
.contact__title { margin: 0 0 1.4rem; max-width: 14ch; font: 350 clamp(3rem, 9vw, 8.8rem)/.92 var(--serif); letter-spacing: -.035em; text-wrap: balance; }
.contact .lede { margin: 0 auto 2.4rem; }
.contact__cta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.2rem 2rem; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem 2rem;
  padding: 28px var(--gutter) 36px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--soft);
}
.foot a { text-decoration: none; }

/* ---------- Viewer (live project inside the page) ---------- */
.viewer {
  --v-bg: #141414; --v-acc: var(--vermilion);
  position: fixed; inset: 0; z-index: 80; display: grid; grid-template-rows: auto 1fr;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in oklab, var(--v-bg) 88%, #fff 12%), color-mix(in oklab, var(--v-bg) 78%, #000));
  color: #f4f2ee; opacity: 0; transition: opacity .45s var(--ease), --v-bg .6s;
}
.viewer[hidden] { display: none; }
.viewer.is-open { opacity: 1; }
.viewer.is-light { color: #191714; }
.viewer__bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 12px clamp(12px, 2vw, 24px);
}
.viewer__title { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.viewer__title b { font: 400 1.35rem/1.1 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer__title span { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.seg { display: flex; padding: 4px; border-radius: 999px; background: color-mix(in oklab, currentColor 12%, transparent); }
.seg button {
  display: flex; align-items: center; gap: .45rem; min-height: 40px; padding: 0 1rem; border: 0; border-radius: 999px;
  background: transparent; cursor: pointer; font-size: .86rem; font-weight: 600; opacity: .75; transition: background-color .3s, opacity .3s, color .3s;
}
.seg button[aria-pressed="true"] { background: currentColor; opacity: 1; }
.seg button[aria-pressed="true"] span, .seg button[aria-pressed="true"] svg { color: var(--v-bg); }
.seg svg, .ibtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.viewer__nav { display: flex; justify-content: flex-end; gap: 6px; }
.ibtn {
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
  background: color-mix(in oklab, currentColor 10%, transparent); transition: background-color .3s, transform .3s var(--ease);
}
.ibtn:hover { background: color-mix(in oklab, currentColor 20%, transparent); }
.ibtn--close { background: currentColor; }
.ibtn--close svg { color: var(--v-bg); }
.ibtn--close:hover { transform: rotate(90deg); background: currentColor; }

.viewer__stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 4px 16px 20px; }
.device {
  position: relative; display: flex; flex-direction: column; background: #1b1b1d; border-radius: 12px; overflow: hidden;
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .08);
  transform: translateY(16px) scale(.98); opacity: 0;
  transition: border-radius .6s var(--ease), padding .6s var(--ease), transform .6s var(--ease), opacity .5s;
}
.viewer.is-open .device { transform: none; opacity: 1; }
.device__chrome { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; flex: none; transition: height .5s var(--ease), opacity .3s; }
.device__chrome i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; flex: none; }
.device__chrome i:nth-child(2) { background: #febc2e; }
.device__chrome i:nth-child(3) { background: #28c840; }
.device__url {
  display: flex; align-items: center; justify-content: center; gap: .4rem; flex: 1; max-width: 30rem; margin-inline: auto;
  padding: .32rem .9rem; border-radius: 8px; background: #2a2a2d; color: #b5b5ba; font-size: .78rem; white-space: nowrap; overflow: hidden;
}
.device__url svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.device__notch { display: none; }
.device__screen {
  position: relative; width: var(--sw, 960px); height: var(--sh, 600px); overflow: hidden; background: #0d0d0d;
  transition: width .6s var(--ease), height .6s var(--ease), border-radius .6s var(--ease);
}
.device__screen iframe {
  position: absolute; left: 0; top: 0; width: var(--vw, 1440px); height: var(--vh, 900px); border: 0;
  transform: scale(var(--s, 1)); transform-origin: 0 0; background: #fff;
  opacity: 0; transition: opacity .5s;
}
.device__screen.is-loaded iframe { opacity: 1; }
.device__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; filter: blur(6px) saturate(1.1); transform: scale(1.05); }
.device__loading { position: absolute; left: 50%; top: 50%; width: 120px; height: 3px; margin: -1px 0 0 -60px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, .25); }
.device__loading span { position: absolute; inset: 0; width: 40%; background: #fff; border-radius: 3px; animation: load 1.1s var(--ease) infinite; }
.device__screen.is-loaded .device__loading { display: none; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* tablet + phone get a bezel instead of browser chrome */
.device.is-tablet, .device.is-phone { padding: 14px; background: #0f0f10; box-shadow: 0 60px 120px -40px rgba(0, 0, 0, .85), inset 0 0 0 2px #2b2b2e, 0 0 0 1px rgba(255, 255, 255, .1); }
.device.is-tablet { border-radius: 34px; }
.device.is-phone { padding: 11px; border-radius: 50px; }
.device.is-tablet .device__chrome, .device.is-phone .device__chrome { height: 0; opacity: 0; overflow: hidden; padding: 0; }
.device.is-tablet .device__screen { border-radius: 20px; }
.device.is-phone .device__screen { border-radius: 39px; }
.device.is-phone .device__notch { display: block; position: absolute; z-index: 3; top: 20px; left: 50%; width: 92px; height: 26px; margin-left: -46px; border-radius: 20px; background: #000; }

.viewer__try {
  position: absolute; left: clamp(12px, 2vw, 28px); bottom: clamp(12px, 3vh, 28px); z-index: 2; max-width: 300px;
  padding: 16px 40px 16px 18px; border-radius: 16px; background: #f4f2ee; color: #191714;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .6); transform: translateY(12px); opacity: 0;
  transition: transform .6s var(--ease) .5s, opacity .5s .5s;
}
.viewer.is-open .viewer__try { transform: none; opacity: 1; }
.viewer__try[hidden] { display: none; }
.viewer__try-label { display: inline-flex; align-items: center; gap: .45rem; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--v-acc); }
.viewer__try-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.viewer__try p { margin: .4rem 0 0; font-size: .92rem; line-height: 1.45; }
.viewer__try-x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; font-size: 1.3rem; line-height: 1; opacity: .55; }
.viewer__try-x:hover { opacity: 1; }
.is-locked { overflow: hidden; }

/* ---------- Cursor (fine pointers only) ---------- */
.cursor { display: none; }
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .cursor {
    position: fixed; z-index: 90; left: 0; top: 0; display: grid; place-items: center;
    width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--acc); pointer-events: none;
    transition: width .45s var(--ease), height .45s var(--ease), margin .45s var(--ease), background-color .4s, opacity .3s;
  }
  .cursor span { opacity: 0; font-size: .82rem; font-weight: 600; color: #fff; white-space: nowrap; transition: opacity .25s; }
  .cursor.is-big { width: 108px; height: 108px; margin: -54px 0 0 -54px; }
  .cursor.is-big span { opacity: 1; transition-delay: .12s; }
  .cursor.is-gone { opacity: 0; }
  .win, .tile { cursor: none; }
}

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .proj__pin { grid-template-columns: 1fr 1.3fr; padding-right: calc(var(--gutter) + 40px); }
}
@media (max-width: 860px) {
  :root { --nav-h: 60px; }
  .nav__links { display: none; }
  .nav__name { font-size: .95rem; }
  .wall { top: -6%; right: -50%; width: 150%; height: 90%; gap: 12px; transform: perspective(1200px) rotateX(26deg) rotateY(-10deg) rotateZ(10deg); }
  .wall__col { gap: 12px; }
  .wall__col:nth-child(n+4) { display: none; }
  .hero__veil { background: linear-gradient(0deg, var(--paper) 0%, var(--paper) 60%, color-mix(in oklab, var(--paper) 0%, transparent) 84%), linear-gradient(180deg, var(--paper) 0%, transparent 16%); }
  .proj { height: auto; overflow: clip; }
  .proj__pin { position: relative; height: auto; display: flex; flex-direction: column-reverse; align-items: stretch; gap: 28px; padding: 56px var(--gutter) 72px; overflow: visible; }
  .proj__ghost { top: 0; bottom: auto; font-size: 34vw; transform: translate3d(calc(4vw - var(--k, 0) * 30vw), 0, 0); }
  .win { transform: none; border-radius: 10px; }
  .win__chrome { height: 28px; }
  .rail { display: none; }
  .steps { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .portrait { max-width: 420px; }
  .facts { gap: 1.6rem; }
  .facts dd { font-size: 1.9rem; }
  .viewer__bar { grid-template-columns: 1fr auto; }
  .viewer__bar .seg { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .seg button span { display: none; }
  .seg button { padding: 0 1.1rem; }
  .viewer__stage { padding: 4px 8px 12px; }
  .viewer__try { left: 10px; right: 10px; max-width: none; bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .wall__col { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
  .win, .proj__ghost { transform: none; }
}
