/* =========================================================================
   DUDUALM. — portfolio
   Minimal type-led layout, one accent colour, light & dark themes.
   ========================================================================= */

:root {
  --bg: #f2f1ec;
  --bg-2: #e8e7e1;
  --fg: #121211;
  --muted: #6c6b66;
  --line: rgba(18, 18, 17, .14);
  --accent: #ff4f1f;
  --on-accent: #121211;

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;

  --gutter: clamp(16px, 3.2vw, 48px);
  --max: 1680px;
  --radius: 10px;
  --ease: cubic-bezier(.7, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0c; --bg-2: #171716; --fg: #eeede7; --muted: #8e8d87;
    --line: rgba(238, 237, 231, .14); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0c; --bg-2: #171716; --fg: #eeede7; --muted: #8e8d87;
  --line: rgba(238, 237, 231, .14); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: clamp(16px, 1.05vw, 18px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color .3s, color .3s;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 18px var(--gutter);
  transition: transform .5s var(--ease-out), background-color .4s, backdrop-filter .4s;
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
}
.site-header.is-hidden { transform: translateY(-110%); }
.logo { font-weight: 700; letter-spacing: -.02em; font-size: 18px; justify-self: start; display: inline-block; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: clamp(16px, 2.4vw, 36px); font-size: 14px; }
.nav a { position: relative; padding: 4px 0; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease);
}
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); transform-origin: left; }
.header__tools { justify-self: end; display: flex; align-items: center; gap: 14px; font-size: 14px; }
.lang { display: inline-flex; gap: 4px; padding: 6px 4px; opacity: .7; transition: opacity .2s; }
.lang:hover { opacity: 1; }
.lang__cur { font-weight: 700; }
.lang__sep { opacity: .5; }
.theme-toggle { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.theme-toggle svg { width: 22px; height: 22px; transition: transform .6s var(--ease); }
.theme-toggle:hover svg { transform: rotate(180deg); }

/* ---------- loader (intro) ---------- */
.loader { display: none; }
.has-loader .page-home .loader {
  position: fixed; inset: 0; z-index: 100; background: var(--fg); color: var(--bg);
  display: flex; flex-direction: column; justify-content: flex-end; padding: var(--gutter);
}
.loader__word { display: flex; font-weight: 800; font-size: clamp(64px, 17vw, 300px); line-height: .85; letter-spacing: -.06em; }
.loader__char { display: inline-block; overflow: hidden; }
.loader__char > span { display: inline-block; transform: translateY(110%); }
.loader__char:last-child { color: var(--accent); }
.loader__count { position: absolute; top: var(--gutter); right: var(--gutter); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh; padding: 120px var(--gutter) 32px;
  display: flex; flex-direction: column; justify-content: flex-end; max-width: var(--max); margin: 0 auto;
}
.hero__role { font-size: 14px; color: var(--muted); margin: 0 0 24px; display: flex; gap: 10px; align-items: center; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero__title {
  margin: 0; font-weight: 500; font-size: clamp(44px, 8.4vw, 168px); line-height: .95; letter-spacing: -.055em;
}
.hero__title em { color: var(--accent); padding-right: .04em; }
.hero__foot { display: flex; justify-content: space-between; margin-top: clamp(40px, 8vh, 96px); font-size: 13px; color: var(--muted); }
.hero__scroll { display: inline-flex; align-items: center; gap: 12px; }
.hero__scroll-line { width: 1px; height: 36px; background: var(--line); position: relative; overflow: hidden; }
.hero__scroll-line::after { content: ""; position: absolute; inset: 0; background: var(--fg); animation: drip 2s var(--ease) infinite; }
@keyframes drip { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* split helpers */
.line-mask { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }

/* ---------- manifesto ---------- */
.manifesto { padding: clamp(80px, 16vh, 200px) var(--gutter); max-width: var(--max); margin: 0 auto; }
.manifesto__text {
  margin: 0; font-size: clamp(28px, 4.2vw, 72px); line-height: 1.12; letter-spacing: -.035em; font-weight: 500; max-width: 22ch;
}
.kw { display: inline-flex; align-items: center; gap: .18em; font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); white-space: nowrap; }
.kw__img {
  display: inline-block; width: 1.5em; height: .95em; border-radius: .2em; overflow: hidden; vertical-align: middle;
  transform: rotate(-4deg);
}
.kw__img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 18px 0; white-space: nowrap; }
.marquee__track { display: inline-flex; gap: 32px; align-items: center; font-size: clamp(22px, 3vw, 44px); letter-spacing: -.03em; font-weight: 500; will-change: transform; }
.marquee__dot { color: var(--accent); font-size: .6em; }
.no-js .marquee__track, .reduced .marquee__track { animation: none; }

/* ---------- section head ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 0 var(--gutter); max-width: var(--max); margin: 0 auto 24px; }
.section-head__title { margin: 0; font-size: clamp(32px, 5vw, 80px); font-weight: 500; letter-spacing: -.05em; line-height: 1; }
.section-head__count { color: var(--muted); font-size: 14px; }

/* ---------- work list ---------- */
.work { padding: clamp(80px, 14vh, 180px) 0 clamp(60px, 10vh, 120px); }
.work__list { list-style: none; margin: 0 auto; padding: 0 var(--gutter); max-width: var(--max); }
.row { border-top: 1px solid var(--line); }
.row:last-child { border-bottom: 1px solid var(--line); }
.row__link {
  display: grid; grid-template-columns: 56px 1fr auto minmax(40px, auto); align-items: center; gap: 16px;
  padding: clamp(18px, 2.4vw, 34px) 0; position: relative;
}
.row__idx { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row__title { font-size: clamp(30px, 5.4vw, 96px); font-weight: 500; letter-spacing: -.05em; line-height: 1; overflow: hidden; }
.row__title-in { display: inline-block; transition: transform .6s var(--ease-out), color .3s; }
.row__tags { font-size: 13px; color: var(--muted); text-align: right; max-width: 28ch; }
.row__arrow { font-size: 24px; justify-self: end; transition: transform .5s var(--ease-out); }
.row__soon { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px; justify-self: end; white-space: nowrap; }
.row__thumb { display: none; }
@media (hover: hover) {
  .row__link:hover .row__title-in { transform: translateX(clamp(12px, 2vw, 32px)); }
  .row__link:hover .row__arrow { transform: translateX(6px) rotate(-45deg); color: var(--accent); }
  .work__list:hover .row__link { opacity: .35; transition: opacity .4s; }
  .work__list:hover .row__link:hover { opacity: 1; }
}
.row.is-soon .row__title-in { color: var(--muted); }

/* floating preview that follows the cursor */
.preview {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  width: clamp(260px, 26vw, 460px); aspect-ratio: 4 / 3; margin: calc(clamp(260px, 26vw, 460px) * -.375) 0 0 calc(clamp(260px, 26vw, 460px) * -.5);
  opacity: 0; transform: scale(.6);
}
.preview__inner { position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.preview__inner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.15); transition: opacity .35s, transform .7s var(--ease-out); }
.preview__inner img.is-active { opacity: 1; transform: scale(1); }
@media (hover: none), (max-width: 860px) {
  .preview { display: none; }
  .row__link { grid-template-columns: 32px 1fr auto; row-gap: 14px; }
  .row__arrow { display: none; }
  .row__tags { grid-column: 2 / -1; text-align: left; grid-row: 2; }
  .row__soon { grid-column: 3; grid-row: 1; }
  .row__thumb { display: block; grid-column: 1 / -1; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10 !important; }
  .row__thumb .media__el { width: 100%; height: 100%; object-fit: cover; }
}

/* ---------- media ---------- */
.media { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--bg-2); }
.media__el { width: 100%; height: 100%; object-fit: cover; }

/* ---------- case ---------- */
.case__hero { padding: 120px var(--gutter) clamp(40px, 6vw, 80px); max-width: var(--max); margin: 0 auto; }
.case__back { display: inline-flex; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: clamp(40px, 8vh, 96px); transition: color .2s; }
.case__back:hover { color: var(--fg); }
.case__idx { font-size: 13px; color: var(--muted); margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.case__title { margin: 0; font-size: clamp(48px, 10.5vw, 200px); font-weight: 600; letter-spacing: -.06em; line-height: .9; overflow-wrap: anywhere; }
.case__title .word { display: inline-block; white-space: nowrap; }
.case__title .char { display: inline-block; }
.case__intro { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(24px, 6vw, 120px); margin-top: clamp(32px, 6vh, 72px); align-items: start; }
.case__lead { margin: 0; font-size: clamp(19px, 1.7vw, 28px); line-height: 1.35; letter-spacing: -.015em; max-width: 36ch; }
.case__meta { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; font-size: 14px; }
.case__meta dt { color: var(--muted); margin-bottom: 6px; }
.case__meta dd { margin: 0; }
.case__cover { padding: 0 var(--gutter); max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; }
.case__cover .media { border-radius: calc(var(--radius) * 1.4); }
.case__body {
  max-width: var(--max); margin: 0 auto; padding: clamp(64px, 10vh, 140px) var(--gutter);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 32px);
}
.case__body > * { grid-column: 1 / -1; margin: 0 0 clamp(20px, 2.4vw, 36px); }
.case__h { grid-column: 1 / 6; font-size: clamp(26px, 2.8vw, 46px); line-height: 1.05; letter-spacing: -.04em; font-weight: 500; margin-top: clamp(40px, 6vw, 96px); }
.case__p { grid-column: 6 / -1; font-size: clamp(17px, 1.25vw, 21px); line-height: 1.6; color: color-mix(in srgb, var(--fg) 82%, var(--bg)); }
.case__p p { margin: 0 0 1em; max-width: 62ch; }
.case__h + .case__p { margin-top: clamp(40px, 6vw, 96px); }
.case__h + .case__h { margin-top: 0; }
.case__q {
  grid-column: 1 / -1; margin: clamp(48px, 8vw, 140px) 0 !important; font-size: clamp(32px, 5.2vw, 88px); line-height: 1.02;
  letter-spacing: -.045em; font-weight: 500; max-width: 18ch;
}
.case__fig, .case__grid { margin-block: clamp(12px, 1.6vw, 28px); }
.case__grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 28px); }
.case__grid .media { height: 100%; }
@media (max-width: 860px) {
  .case__intro { grid-template-columns: 1fr; }
  .case__h, .case__p { grid-column: 1 / -1; }
  .case__h + .case__p { margin-top: 0; }
  .case__grid { grid-template-columns: 1fr; }
}

/* next project */
.next {
  display: grid; place-items: center; text-align: center; gap: 12px; position: relative; overflow: hidden;
  padding: clamp(80px, 16vh, 200px) var(--gutter); border-top: 1px solid var(--line); isolation: isolate;
}
.next__label { font-size: 14px; color: var(--muted); }
.next__title { font-size: clamp(40px, 8vw, 150px); font-weight: 500; letter-spacing: -.06em; line-height: 1; transition: transform .6s var(--ease-out); }
.next__img { position: absolute !important; width: min(40vw, 480px); left: 50%; top: 50%; translate: -50% -50%; z-index: -1; opacity: 0; scale: .7; rotate: -6deg; transition: opacity .5s, scale .8s var(--ease-out), rotate .8s var(--ease-out); }
.next:hover .next__img { opacity: .9; scale: 1; rotate: 3deg; }
.next:hover .next__title { transform: scale(.96); }

/* ---------- about ---------- */
.about__hero { padding: 160px var(--gutter) clamp(48px, 8vh, 96px); max-width: var(--max); margin: 0 auto; }
.about__title { margin: 0; font-size: clamp(44px, 7.6vw, 150px); font-weight: 500; letter-spacing: -.055em; line-height: .98; }
.about__title em { color: var(--accent); }
.about__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 8vw, 160px); padding: 0 var(--gutter); max-width: var(--max); margin: 0 auto; }
.about__bio p { margin: 0 0 1.2em; font-size: clamp(18px, 1.5vw, 24px); line-height: 1.45; letter-spacing: -.01em; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; align-content: start; }
.stat { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.stat:last-child { border-bottom: 1px solid var(--line); }
.stat__num { font-size: clamp(48px, 6vw, 96px); font-weight: 500; letter-spacing: -.06em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--muted); font-size: 14px; text-align: right; }
.about__section { padding: clamp(80px, 14vh, 160px) var(--gutter) 0; max-width: var(--max); margin: 0 auto; }
.about__section .section-head__title { margin-bottom: 32px; }
.skills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.skills li { border: 1px solid var(--line); border-radius: 99px; padding: 10px 18px; font-size: clamp(15px, 1.2vw, 19px); transition: background .3s, color .3s, border-color .3s; }
.skills li:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.edu-list { list-style: none; margin: 0; padding: 0; }
.edu { display: grid; grid-template-columns: 160px 1fr 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); align-items: baseline; }
.edu:last-child { border-bottom: 1px solid var(--line); }
.edu__year { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.edu__title { font-size: clamp(18px, 1.6vw, 26px); letter-spacing: -.02em; }
.edu__org { color: var(--muted); font-size: 15px; }
@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
  .edu { grid-template-columns: 1fr; gap: 4px; }
}

/* contact form */
.contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 8vw, 160px); padding-bottom: clamp(80px, 14vh, 160px); }
.contact__sub { color: var(--muted); max-width: 34ch; }
.form { display: grid; gap: 28px; }
.form__honey { position: absolute; left: -9999px; }
.field { position: relative; display: block; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: clamp(18px, 1.4vw, 22px); color: var(--fg); background: transparent;
  border: 0; border-bottom: 1px solid var(--line); padding: 26px 0 12px; border-radius: 0; resize: vertical; transition: border-color .3s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--fg); }
.field span { position: absolute; left: 0; top: 26px; color: var(--muted); pointer-events: none; transition: transform .35s var(--ease-out), font-size .35s; transform-origin: left top; font-size: clamp(18px, 1.4vw, 22px); }
.field input:focus + span, .field input:not(:placeholder-shown) + span,
.field textarea:focus + span, .field textarea:not(:placeholder-shown) + span { transform: translateY(-24px) scale(.62); }
.field::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.field:focus-within::after { transform: scaleX(1); }
.form__status { margin: 0; min-height: 1.5em; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; gap: 14px; justify-self: start; position: relative; overflow: hidden; isolation: isolate;
  background: var(--fg); color: var(--bg); padding: 18px 28px; border-radius: 99px; font-weight: 500;
}
.btn::before { content: ""; position: absolute; inset: 0; background: var(--accent); border-radius: inherit; transform: translateY(101%); transition: transform .5s var(--ease); z-index: -1; }
.btn:hover::before { transform: translateY(0); }
.btn:hover { color: var(--on-accent); }
.btn[disabled] { opacity: .6; pointer-events: none; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { padding: clamp(80px, 16vh, 200px) var(--gutter) 28px; max-width: var(--max); margin: 0 auto; border-top: 1px solid var(--line); }
.footer__eyebrow { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.footer__cta {
  margin: 0; font-size: clamp(48px, 10.6vw, 210px); line-height: .92; letter-spacing: -.06em; font-weight: 500; user-select: none;
}
.footer__cta .wchar { display: inline-block; font-variation-settings: "wght" 500; }
.footer__email {
  margin-top: clamp(28px, 4vw, 56px); display: inline-flex; align-items: center; gap: 12px; font-size: clamp(20px, 2.4vw, 40px);
  letter-spacing: -.03em; padding-bottom: 4px; border-bottom: 2px solid var(--accent);
}
.footer__email-icon { font-size: .7em; color: var(--accent); }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: clamp(64px, 12vh, 140px); font-size: 14px; }
.socials { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.socials a { display: inline-block; padding: 10px 16px; border: 1px solid var(--line); border-radius: 99px; transition: background .3s, color .3s; }
.socials a:hover { background: var(--fg); color: var(--bg); }
.footer__note { margin: 0; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90; translate: -50% 150%; opacity: 0;
  background: var(--fg); color: var(--bg); padding: 12px 20px; border-radius: 99px; font-size: 14px;
  transition: translate .5s var(--ease-out), opacity .3s;
}
.toast.is-on { translate: -50% 0; opacity: 1; }

/* ---------- custom cursor ---------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .has-cursor .cursor {
    display: grid; place-items: center; position: fixed; left: 0; top: 0; z-index: 120; pointer-events: none;
    width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; mix-blend-mode: difference;
    transition: width .45s var(--ease-out), height .45s var(--ease-out), margin .45s var(--ease-out), background .3s, opacity .3s;
  }
  .has-cursor .cursor.is-hover { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
  .has-cursor .cursor.is-label { width: 104px; height: 104px; margin: -52px 0 0 -52px; background: var(--accent); mix-blend-mode: normal; }
  .has-cursor .cursor.is-hidden { opacity: 0; }
  .cursor__label { font-size: 13px; font-weight: 600; color: var(--on-accent); opacity: 0; transition: opacity .2s; white-space: nowrap; }
  .cursor.is-label .cursor__label { opacity: 1; transition-delay: .1s; }
}

/* ---------- reveal initial states (only when JS animations are on) ---------- */
.anim [data-reveal] { opacity: 0; transform: translateY(24px); }
.anim .media--reveal { clip-path: inset(100% 0 0 0 round var(--radius)); }
.anim .media--reveal .media__el { transform: scale(1.18); }
.anim [data-split-hero], .anim [data-split-lines], .anim .case__title { visibility: hidden; }

/* ---------- 404 ---------- */
.notfound { min-height: 100svh; display: grid; place-content: center; text-align: center; gap: 24px; padding: 120px var(--gutter); }
.notfound__title { margin: 0; font-size: clamp(120px, 30vw, 420px); letter-spacing: -.07em; line-height: .85; font-weight: 500; }
.notfound .btn { justify-self: center; }

/* ---------- page transitions ---------- */
/* Cross-document View Transitions (Chrome/Edge 126+, Safari 18.2+) */
@view-transition { navigation: auto; }
html:not(.theme-vt)::view-transition-old(root) { animation: vt-out .7s var(--ease) both; }
html:not(.theme-vt)::view-transition-new(root) { animation: vt-in .9s var(--ease) both; }
::view-transition-group(case-cover) { animation-duration: .9s; animation-timing-function: var(--ease); }
@keyframes vt-out { to { opacity: .2; transform: translateY(-6vh) scale(.97); } }
@keyframes vt-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
/* theme switch: circular reveal is driven from JS */
html.theme-vt::view-transition-old(root), html.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* fallback curtain for browsers without cross-document view transitions */
.curtain { position: fixed; inset: 0; z-index: 110; background: var(--fg); transform: translateY(100%); pointer-events: none; }
.curtain.is-in { transition: transform .55s var(--ease); transform: translateY(0); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- small screens ---------- */
.dock { display: none; }
@media (max-width: 720px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-header .nav { display: none; }
  .hero__title br { display: none; }
  .hero { min-height: 86svh; padding-bottom: 96px; }
  .dock {
    display: flex; gap: 4px; position: fixed; left: 50%; bottom: 16px; translate: -50% 0; z-index: 60;
    background: var(--fg); color: var(--bg); padding: 5px; border-radius: 99px; font-size: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18); transition: translate .5s var(--ease-out);
  }
  .dock a { padding: 9px 14px; border-radius: 99px; }
  .dock a[aria-current] { background: var(--bg); color: var(--fg); }
  .dock.is-hidden { translate: -50% 160%; }
  .site-footer { padding-bottom: 96px; }
}

/* =========================================================================
   Device mockups (MacBook-style laptop, phone with Safari) + interactive demos
   ========================================================================= */
.case__devices { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); margin-block: clamp(24px, 4vw, 64px) !important; perspective: 1600px; }
.case__devices[style*="--cols:1"] { padding-inline: clamp(0px, 4vw, 72px); }
@media (max-width: 860px) { .case__devices { grid-template-columns: 1fr; } }

.device { margin: 0; container-type: inline-size; }
.device .media { border-radius: 0; background: transparent; }
.laptop { transform-style: preserve-3d; will-change: transform; padding-inline: 6.5%; }
.laptop__lid {
  position: relative; background: #0c0c0e; border-radius: 3.2cqw 3.2cqw .9cqw .9cqw; padding: 2.1cqw 2.1cqw 2.6cqw;
  box-shadow: inset 0 0 0 .14cqw #2b2b30, 0 3cqw 6cqw -2cqw rgba(8, 18, 48, .35);
}
.laptop__cam { position: absolute; top: .75cqw; left: 50%; width: .7cqw; height: .7cqw; border-radius: 50%; background: #26262b; translate: -50% 0; box-shadow: inset 0 0 0 .15cqw #111; }
.laptop__screen { border-radius: .6cqw; overflow: hidden; background: #fff; }
.laptop__base {
  position: relative; height: 2.1cqw; margin: 0 -7%; border-radius: .3cqw .3cqw 3cqw 3cqw;
  background: linear-gradient(#e9eaec, #c9cbcf 45%, #a3a6ab);
  box-shadow: 0 2.2cqw 3cqw -1.2cqw rgba(8, 18, 48, .45);
}
.laptop__base::before { content: ""; position: absolute; left: 50%; top: 0; width: 16%; height: .9cqw; translate: -50% 0; border-radius: 0 0 1cqw 1cqw; background: linear-gradient(#b8babe, #d4d5d8); }

.browser { background: #fff; }
.browser__bar {
  display: grid; grid-template-columns: 1fr minmax(0, 2.2fr) 1fr; align-items: center; gap: 1cqw;
  height: 3.4cqw; padding: 0 1.4cqw; background: #f4f4f5; border-bottom: .08cqw solid #e2e2e5; color: #3c3c43;
}
.browser__dots { display: flex; gap: .7cqw; }
.browser__dots i { width: .95cqw; height: .95cqw; border-radius: 50%; background: #ff5f57; }
.browser__dots i:nth-child(2) { background: #febc2e; }
.browser__dots i:nth-child(3) { background: #28c840; }
.browser__url {
  display: flex; align-items: center; justify-content: center; gap: .6cqw; height: 2.2cqw; border-radius: .7cqw;
  background: #e7e7ea; font-size: 1.05cqw; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 1cqw;
}
.browser__url svg { width: .8cqw; height: .9cqw; flex: none; opacity: .6; }
.browser--dark { background: #0a0a0a; }
.browser--dark .browser__bar { background: #1d1d20; border-color: #2c2c30; color: #d6d6db; }
.browser--dark .browser__url { background: #2c2c31; }
.browser__view { position: relative; }

/* phones */
.phones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 4vw, 72px); padding: clamp(24px, 6vw, 96px) clamp(0px, 6vw, 120px); margin-block: clamp(16px, 3vw, 48px) !important; align-items: start; }
.phones .phone:nth-child(2) { margin-top: 12%; }
@media (max-width: 860px) {
  .phones { grid-template-columns: repeat(3, 70vw); overflow-x: auto; scroll-snap-type: x mandatory; padding-inline: 4px; margin-inline: calc(var(--gutter) * -1) !important; padding-left: var(--gutter); }
  .phones .phone { scroll-snap-align: center; }
  .phones .phone:nth-child(2) { margin-top: 0; }
}
.phone__frame {
  position: relative; padding: 3.4cqw; border-radius: 17cqw; background: #141416;
  box-shadow: inset 0 0 0 .7cqw #2c2c31, inset 0 0 0 1cqw #0b0b0c, 0 6cqw 10cqw -4cqw rgba(8, 18, 48, .45);
}
.phone__frame::before, .phone__frame::after { content: ""; position: absolute; width: .9cqw; border-radius: 1cqw; background: #2c2c31; }
.phone__frame::before { left: -.6cqw; top: 22%; height: 12%; }
.phone__frame::after { right: -.6cqw; top: 28%; height: 18%; }
.phone__screen { position: relative; border-radius: 13.6cqw; overflow: hidden; background: #fff; }
.phone__status { height: 13cqw; display: flex; align-items: center; justify-content: space-between; padding: 1.6cqw 8cqw 0 10cqw; font-size: 4.2cqw; font-weight: 600; color: #000; background: #fff; letter-spacing: -.01em; }
.phone__icons { display: flex; align-items: center; gap: 1.6cqw; }
.phone__icons .sig { display: flex; align-items: flex-end; gap: .5cqw; height: 3cqw; }
.phone__icons .sig b { width: .8cqw; background: currentColor; border-radius: .3cqw; }
.phone__icons .sig b:nth-child(1) { height: 35%; } .phone__icons .sig b:nth-child(2) { height: 55%; }
.phone__icons .sig b:nth-child(3) { height: 78%; } .phone__icons .sig b:nth-child(4) { height: 100%; }
.phone__icons .bat { width: 6.4cqw; height: 3cqw; border-radius: 1cqw; border: .35cqw solid currentColor; padding: .35cqw; display: block; opacity: .9; }
.phone__icons .bat b { display: block; height: 100%; width: 80%; background: currentColor; border-radius: .4cqw; }
.phone__island { position: absolute; top: 5.6cqw; left: 50%; translate: -50% 0; width: 29%; height: 8.2cqw; border-radius: 99px; background: #000; }
.phone__media { border-radius: 0 !important; }
.phone__safari {
  position: absolute; left: 4.5%; right: 4.5%; bottom: 4cqw; height: 12.4cqw; border-radius: 99px;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2cqw; padding: 0 5cqw;
  background: rgba(250, 250, 252, .78); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6);
  box-shadow: 0 1.4cqw 4cqw rgba(0, 0, 0, .14), inset 0 0 0 .25cqw rgba(255, 255, 255, .6);
  font-size: 4cqw; color: #1c1c1e; font-weight: 500;
}
.phone__url { display: flex; align-items: center; justify-content: center; gap: 1.4cqw; }
.phone__url svg { width: 2.6cqw; height: 3cqw; opacity: .55; }
.phone--dark .phone__status { background: #0a0a0a; color: #fff; }
.phone--dark .phone__safari { background: rgba(40, 40, 44, .78); color: #f2f2f7; box-shadow: 0 1.4cqw 4cqw rgba(0, 0, 0, .3), inset 0 0 0 .25cqw rgba(255, 255, 255, .08); }

/* captions */
.cap-fig { margin: 0; min-width: 0; }
.case__grid > *, .case__devices > * { min-width: 0; }
.cap-fig .media { width: 100%; }
.cap-fig figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* stat tiles */
.stat-tiles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-block: 1px solid var(--line); margin-block: clamp(24px, 4vw, 64px) !important; }
.stat-tile { background: var(--bg); padding: clamp(20px, 2.4vw, 36px) clamp(12px, 1.6vw, 24px) clamp(20px, 2.4vw, 36px) 0; display: grid; gap: 10px; align-content: start; }
.stat-tile + .stat-tile { padding-left: clamp(12px, 1.6vw, 24px); }
.stat-tile__num { font-size: clamp(40px, 5vw, 84px); font-weight: 500; letter-spacing: -.06em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-tile__label { font-size: 14px; color: var(--muted); max-width: 26ch; }
@media (max-width: 860px) { .stat-tiles { grid-template-columns: 1fr 1fr; } .stat-tile:nth-child(3) { padding-left: 0; } }

/* demo shell */
.demo-wrap {
  position: relative; border-radius: calc(var(--radius) * 2); padding: clamp(48px, 7vw, 110px) clamp(16px, 5vw, 96px);
  background: radial-gradient(120% 120% at 0% 0%, #2a4ea8 0%, #1c3c85 45%, #0f2457 100%); color: #fff; overflow: hidden; isolation: isolate;
  margin-block: clamp(24px, 4vw, 64px) !important;
}
.demo-wrap::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(40% 50% at 85% 20%, rgba(255,255,255,.14), transparent 70%); }
.demo-tag { position: absolute; top: 20px; left: 24px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; display: inline-flex; gap: 8px; align-items: center; }
.demo-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5df2a6; box-shadow: 0 0 0 4px rgba(93, 242, 166, .2); }

/* AI search demo */
.ai { max-width: 920px; margin: 0 auto; font-family: "Helvetica Neue", Helvetica, Arial, var(--sans); }
.ai__bar {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px;
  background: #fff; color: #0a0a0a; border-radius: 18px; padding: 10px 10px 10px 18px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45), 0 0 0 6px rgba(255, 255, 255, .08);
}
.ai__spark { width: 26px; height: 26px; color: #1c3c85; display: grid; place-items: center; }
.ai__spark svg { width: 24px; height: 24px; }
.ai.is-thinking .ai__spark { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai__text { margin: 0; min-height: 1.5em; font-size: clamp(16px, 1.6vw, 21px); line-height: 1.45; letter-spacing: -.01em; position: relative; }
.ai__ph { color: #8a8a90; }
.ai__typed:not(:empty) ~ .ai__ph { display: none; }
.ai__caret { display: inline-block; width: 2px; height: 1.1em; vertical-align: -.18em; background: #1c3c85; margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ai__seg { transition: background .4s, color .4s, box-shadow .4s; border-radius: 5px; }
.ai__seg.is-key { background: rgba(28, 60, 133, .1); color: #1c3c85; box-shadow: 0 0 0 2px rgba(28, 60, 133, .1); }
.ai__seg.is-off { text-decoration: line-through; color: #9a9aa0; background: transparent; box-shadow: none; }
.ai__mic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #1c3c85; background: #eef2fb; position: relative; }
.ai__mic svg { width: 20px; height: 20px; }
.ai__mic.is-listening::after { content: ""; position: absolute; inset: -4px; border-radius: 14px; border: 2px solid #1c3c85; animation: ring 1.1s ease-out infinite; }
@keyframes ring { from { opacity: .8; transform: scale(.9); } to { opacity: 0; transform: scale(1.25); } }
.ai__go { height: 44px; padding: 0 20px; border-radius: 12px; background: #1c3c85; color: #fff; font-weight: 600; font-size: 15px; transition: transform .2s, background .2s; }
.ai__go:hover { background: #2a52ad; }
.ai__go.is-press { transform: scale(.94); }
.ai__result { margin-top: 28px; min-height: 92px; }
.ai__label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.ai__chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ai__chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 99px; font-size: 15px; font-weight: 500;
  background: #fff; color: #1c3c85; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .45); transition: background .2s, transform .2s;
}
.ai__chip span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #eef2fb; font-size: 12px; transition: background .2s, color .2s; }
.ai__chip:hover span { background: #1c3c85; color: #fff; }
.ai__foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 28px; font-size: 14px; }
.ai__hint { opacity: .7; }
.ai__next { white-space: nowrap; padding: 10px 16px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .35); transition: background .2s, color .2s; }
.ai__next:hover { background: #fff; color: #1c3c85; }
@media (max-width: 600px) {
  .ai__bar { grid-template-columns: auto 1fr auto; }
  .ai__go { grid-column: 1 / -1; }
}

/* favourite card demo */
.demo-wrap--fav { display: grid; place-items: center; background: radial-gradient(120% 120% at 100% 0%, #e9eefb 0%, #dfe6f7 50%, #cfd9f2 100%); color: #0a0a0a; }
:root[data-theme="dark"] .demo-wrap--fav { background: radial-gradient(120% 120% at 100% 0%, #1c2440 0%, #141a2e 60%, #0e1322 100%); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .demo-wrap--fav { background: radial-gradient(120% 120% at 100% 0%, #1c2440 0%, #141a2e 60%, #0e1322 100%); color: #fff; } }
.fav { display: grid; justify-items: center; gap: 18px; }
.pcard { width: min(420px, 100%); background: #fff; color: #0a0a0a; border-radius: 14px; overflow: hidden; font-family: "Helvetica Neue", Helvetica, Arial, var(--sans); box-shadow: 0 40px 80px -30px rgba(15, 36, 87, .45); }
.pcard__img { position: relative; aspect-ratio: 4 / 3; }
.pcard__media { position: absolute !important; inset: 0; aspect-ratio: auto !important; border-radius: 0 !important; }
.pcard__badge { position: absolute; left: 14px; top: 14px; background: #e8f7ee; color: #0b7a3e; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 6px; }
.pcard__heart { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .92); display: grid; place-items: center; color: #1c1c1e; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }
.pcard__heart svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: fill .2s, stroke .2s; }
.pcard__heart[aria-pressed="true"] svg { fill: #e11d48; stroke: #e11d48; }
.pcard__burst { position: absolute; inset: 0; pointer-events: none; }
.pcard__burst i { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: #e11d48; }
.pcard__body { padding: 18px 20px 22px; display: grid; gap: 8px; }
.pcard__loc { font-size: 13px; color: #6b6b72; }
.pcard__title { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.pcard__feat { display: flex; gap: 14px; font-size: 14px; color: #3c3c43; }
.pcard__price { display: flex; align-items: baseline; gap: 12px; margin-top: 6px; }
.pcard__old { color: #8a8a90; font-size: 15px; text-decoration: none; position: relative; }
.pcard__old::after { content: ""; position: absolute; left: 0; right: 0; top: 52%; height: 1.5px; background: currentColor; transform: scaleX(var(--strike, 1)); transform-origin: left; }
.pcard__new { font-size: 24px; letter-spacing: -.03em; color: #1c3c85; font-variant-numeric: tabular-nums; }
.fav__hint { margin: 0; font-size: 14px; opacity: .7; }

/* before/after compare */
.compare { position: relative; --pos: 50%; touch-action: pan-y; user-select: none; }
.compare__layer .media { border-radius: 0; }
.compare__b { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.compare__line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); pointer-events: none; }
.compare__knob {
  position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 4.4cqw; height: 4.4cqw; min-width: 40px; min-height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: #1c3c85; font-weight: 700; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.compare__label { position: absolute; bottom: 16px; padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; background: rgba(255, 255, 255, .9); color: #0a0a0a; pointer-events: none; }
.compare__label--a { left: 16px; }
.compare__label--b { right: 16px; background: rgba(20, 20, 22, .85); color: #fff; }
.compare__range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare__range:focus-visible + .compare__knob, .compare:focus-within .compare__knob { outline: 3px solid var(--accent); }

/* ---- official Apple bezels (MacBook Pro 14" M5, iPhone 18 Pro) ---- */
.mbp { position: relative; aspect-ratio: 3860 / 2540; transform-style: preserve-3d; will-change: transform; filter: drop-shadow(0 40px 50px rgba(8, 18, 48, .22)); }
.mbp__screen { position: absolute; left: 10.829%; top: 11.339%; width: 78.342%; height: 77.323%; overflow: hidden; background: #000; border-radius: 1.65% / 2.55%; }
.mbp__menubar { display: block; height: 3.768%; background: #000; }
.mbp__screen .media { border-radius: 0; background: transparent; }
.mbp__bezel, .iphone__bezel { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.iphone { position: relative; aspect-ratio: 1350 / 2760; filter: drop-shadow(0 40px 50px rgba(8, 18, 48, .28)); }
.iphone__screen { position: absolute; left: 5.333%; top: 2.5%; width: 89.333%; height: 95%; overflow: hidden; border-radius: 13.68% / 6.29%; background: #000; }
.iphone__media { border-radius: 0 !important; width: 100%; height: 100%; }
.iphone__media .media__el { object-fit: cover; object-position: top; }
.phones .iphone:nth-child(2) { margin-top: 12%; }
@media (max-width: 860px) { .phones .iphone { scroll-snap-align: center; } .phones .iphone:nth-child(2) { margin-top: 0; } }
.case__devices[style*="--cols:1"] { padding-inline: clamp(0px, 3vw, 56px); }

/* ---- project colours: work list rows take each identity's accent on hover ---- */
.row { --ra: var(--ra-l, var(--accent)); }
:root[data-theme="dark"] .row { --ra: var(--ra-d, var(--accent)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .row { --ra: var(--ra-d, var(--accent)); } }
@media (hover: hover) {
  .row__link:hover .row__title-in { color: var(--ra); }
  .row__link:hover .row__arrow { color: var(--ra); }
}

/* ---- project identity accents on case pages ---- */
.page-case .case__title { color: var(--accent); }
.page-case .case__idx, .page-case .case__meta dt, .page-case .stat-tile__label::before { color: var(--accent); }
.page-case .case__h { position: relative; padding-top: 22px; }
.page-case .case__h::before { content: ""; position: absolute; top: 0; left: 0; width: 40px; height: 3px; border-radius: 3px; background: var(--accent); }
.page-case .case__q { color: var(--accent); }
.page-case .case__back:hover, .page-case .next:hover .next__title { color: var(--accent); }
.page-case .stat-tile__num { color: var(--accent); }
.page-case .footer__cta { color: var(--fg); }

/* ---- scroll cue (no text): mouse with a moving wheel; a bouncing chevron on touch screens ---- */
.scroll-cue {
  align-self: center; position: relative; display: block; margin-top: clamp(40px, 8vh, 96px);
  width: 26px; height: 42px; border: 1.5px solid color-mix(in srgb, var(--fg) 45%, transparent); border-radius: 14px;
  transition: opacity .5s, border-color .3s;
}
.scroll-cue:hover { border-color: var(--fg); }
.scroll-cue__wheel { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--accent); animation: cue-wheel 1.8s cubic-bezier(.7, 0, .2, 1) infinite; }
@keyframes cue-wheel { 0% { opacity: 0; transform: translateY(-4px); } 25% { opacity: 1; } 70% { opacity: 1; transform: translateY(12px); } 100% { opacity: 0; transform: translateY(16px); } }
@media (hover: none) {
  .scroll-cue { border: 0; width: 28px; height: 28px; border-radius: 0; }
  .scroll-cue__wheel {
    top: 4px; width: 14px; height: 14px; margin-left: -7px; background: none; border-radius: 0;
    border-right: 2px solid var(--fg); border-bottom: 2px solid var(--fg); rotate: 45deg;
    animation: cue-bounce 1.6s ease-in-out infinite;
  }
  @keyframes cue-bounce { 0%, 100% { transform: translate(0, 0); opacity: .5; } 50% { transform: translate(5px, 5px); opacity: 1; } }
}
.scroll-cue.is-gone { opacity: 0 !important; pointer-events: none; }

/* ---- hero caption: editorial line under the title, right column ---- */
.hero__intro {
  align-self: flex-end; max-width: 34ch; margin: clamp(28px, 5vh, 56px) 0 0;
  font-size: clamp(17px, 1.45vw, 23px); line-height: 1.4; letter-spacing: -.012em; color: var(--muted);
}
.hero__intro strong { color: var(--fg); font-weight: 500; }
@media (max-width: 720px) { .hero__intro { align-self: flex-start; } }
