/* ==========================================================================
   HANI DEV — Portfolio
   Structure: tokens → base → components → sections → motion → responsive
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #0a0a0a;
  --surface: #131313;
  --surface-2: #1a1a1a;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f1efea;
  --text-2: #a6a39c;
  --text-3: #75726c;
  --accent: #ff6b3d;

  --sans: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --serif: "Instrument Serif", "Lora", "Iowan Old Style", Georgia, serif;

  /* Layout */
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1440px;
  --nav-h: 72px;
  --radius: clamp(18px, 2vw, 28px);

  /* Fluid type scale */
  --hero-vw: 8.6vw;
  --fs-hero: clamp(2.15rem, min(var(--hero-vw), 16vh), 8.75rem);
  --fs-h2: clamp(2.5rem, 6.2vw, 6rem);
  --fs-contact: clamp(2.5rem, 6.4vw, 6.25rem);
  --fs-statement: clamp(1.45rem, 3vw, 3rem);
  --fs-project: clamp(2rem, 3.6vw, 3.75rem);
  --fs-service: clamp(1.6rem, 2.8vw, 2.75rem);
  --fs-lead: clamp(1rem, 0.9rem + 0.35vw, 1.1875rem);

  /* Fluid spacing */
  --section-y: clamp(64px, 8vw, 120px);
  --head-gap: clamp(32px, 4.5vw, 64px);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}
html.has-smooth { scroll-behavior: auto; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
h1, h2, h3, p { overflow-wrap: break-word; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
::selection { background: var(--text); color: var(--bg); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
section[tabindex="-1"]:focus-visible { outline: none; }

.container { width: min(var(--max), 100% - var(--gutter) * 2); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-2); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 1000;
  padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg);
  font-weight: 500; font-size: 14px; transform: translateY(-160%); transition: transform 0.3s var(--ease-out);
}
.skip-link:focus { transform: none; }

/* Grain overlay — static texture */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Scroll progress */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--text); transform-origin: 0 50%; transform: scaleX(0); opacity: 0.85; }

/* ---------- Buttons ---------- */
.btn {
  --x: 50%; --y: 50%;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: 54px; padding: 0 26px; border-radius: 999px; overflow: hidden; isolation: isolate;
  font-size: 15px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap;
  transition: transform 0.6s var(--ease-out), color 0.45s var(--ease-out);
}
.btn__label, .btn__icon { position: relative; z-index: 1; transition: transform 0.6s var(--ease-out); }
.btn__icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn__fill {
  position: absolute; z-index: 0; left: var(--x); top: var(--y);
  width: 260%; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  transform: translate(-50%, -50%) scale(0); transition: transform 0.65s var(--ease-out);
}
.btn:hover .btn__fill, .btn:focus-visible .btn__fill { transform: translate(-50%, -50%) scale(1); }
.btn--light { background: var(--text); color: var(--bg); }
.btn--light .btn__fill { background: var(--accent); }
.btn--light:hover, .btn--light:focus-visible { color: #140903; }
.btn--ghost { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--ghost .btn__fill { background: var(--text); }
.btn--ghost:hover, .btn--ghost:focus-visible { color: var(--bg); }
.btn:hover .btn__icon { transform: translateX(2px); }

/* Rolling text links */
.roll { position: relative; display: inline-flex; }
.roll__c { display: block; overflow: hidden; line-height: 1.4; }
.roll__c > span { display: block; position: relative; transition: transform 0.6s var(--ease-out); }
.roll__c > span::after { content: attr(data-text); position: absolute; left: 0; top: 100%; }
.roll:hover .roll__c > span, .roll:focus-visible .roll__c > span { transform: translateY(-100%); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500;
  padding: 8px 0; position: relative;
}
.link-arrow::after {
  content: ""; position: absolute; left: 0; right: 28px; bottom: 3px; height: 1px; background: currentColor;
  transform-origin: right; transform: scaleX(0.35); opacity: 0.5; transition: transform 0.6s var(--ease-out), opacity 0.4s;
}
.link-arrow:hover::after, .link-arrow:focus-visible::after { transform-origin: left; transform: scaleX(1); opacity: 1; }
.link-arrow svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.5s var(--ease-out);
}
.link-arrow:hover svg { transform: translate(3px, -3px); }
.link-arrow--down:hover svg { transform: translateX(4px); }

/* Non-interactive tag lists: plain text, clearly not buttons */
.tags { display: flex; flex-wrap: wrap; gap: 4px 0; font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.tags li + li::before { content: "/"; margin: 0 10px; color: var(--line-2); }

.tag { font-size: 12px; padding: 5px 11px; border-radius: 999px; line-height: 1.2; white-space: nowrap; }
.tag--concept { color: var(--text-2); background: rgba(255, 255, 255, 0.05); }
.tag--concept::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; }

.label { display: flex; gap: 10px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.label span { color: var(--text-3); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--nav-h);
  transition: transform 0.6s var(--ease-out), background-color 0.5s, border-color 0.5s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(10, 10, 10, 0.75); border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
}
.nav.is-hidden { transform: translateY(-100%); }
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav__logo { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -0.02em; font-size: 16px; }
.nav__mark { width: 30px; height: 30px; color: var(--text); transition: transform 0.8s var(--ease-out); }
.nav__logo:hover .nav__mark { transform: rotate(-90deg); }
.nav__word { text-transform: uppercase; letter-spacing: 0.08em; font-size: 13.5px; }
.nav__word span { color: var(--text-3); margin-left: 6px; }
.nav__links { display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); }
.nav__links a { padding: 7px 16px; border-radius: 999px; font-size: 14px; color: var(--text-2); transition: color 0.3s, background-color 0.3s; }
.nav__links a:hover, .nav__links a[aria-current="true"] { color: var(--text); }
.nav__links a[aria-current="true"] { background: rgba(255, 255, 255, 0.08); }
.nav__toggle { display: none; position: relative; width: 46px; height: 46px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); }
.nav__toggle span { position: absolute; left: 14px; right: 14px; height: 1.5px; background: var(--text); border-radius: 2px; transition: transform 0.5s var(--ease-out), top 0.5s var(--ease-out); }
.nav__toggle span:first-child { top: 19px; } .nav__toggle span:last-child { top: 26px; }
.nav__toggle[aria-expanded="true"] span:first-child { top: 22.5px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { top: 22.5px; transform: rotate(-45deg); }

/* Mobile menu */
.menu {
  position: fixed; inset: 0; z-index: 95; background: var(--bg);
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: calc(var(--nav-h) + 24px) 0 calc(28px + env(safe-area-inset-bottom));
  overflow-y: auto; overscroll-behavior: contain;
  clip-path: inset(0 0 100% 0); transition: clip-path 0.7s var(--ease-io), visibility 0s 0.7s; visibility: hidden;
}
.menu[hidden] { display: none; }
.menu.is-open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path 0.7s var(--ease-io), visibility 0s; }
.menu__links { display: flex; flex-direction: column; }
.menu__links a {
  display: flex; align-items: baseline; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line);
  font-size: clamp(32px, min(11vw, 9vh), 64px); font-weight: 500; letter-spacing: -0.05em; line-height: 1.1;
  opacity: 0; transform: translateY(32px);
  transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out);
}
.menu.is-open .menu__links a { opacity: 1; transform: none; transition-delay: calc(0.2s + var(--i) * 0.05s); }
.menu__n { font-family: var(--mono); font-size: 12px; color: var(--text-3); letter-spacing: 0; }
.menu__foot { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 15px; color: var(--text-2); opacity: 0; transition: opacity 0.5s 0.4s; }
.menu.is-open .menu__foot { opacity: 1; }
.menu__foot a { color: var(--text); border-bottom: 1px solid var(--line-2); }

/* Cursor bubble (only over project previews, fine pointers) */
.cursor { position: fixed; left: 0; top: 0; z-index: 150; pointer-events: none; width: 0; height: 0; display: none; }
.cursor__label {
  position: absolute; left: 0; top: 0; display: grid; place-items: center;
  width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 50%;
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 500; text-align: center;
  transform: scale(0); transition: transform 0.45s var(--ease-out);
}
.cursor.is-on .cursor__label { transform: scale(1); }
@media (hover: hover) and (pointer: fine) { .cursor { display: block; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: stretch;
  padding: calc(var(--nav-h) + clamp(16px, 3vh, 36px)) 0 clamp(28px, 5vh, 52px); overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; pointer-events: none; }
.hero__cols {
  position: absolute; inset: 0; width: min(var(--max), 100% - var(--gutter) * 2); margin-inline: auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.hero__cols i { border-left: 1px solid rgba(255, 255, 255, 0.035); transform-origin: top; }
.hero__cols i:last-child { position: absolute; right: 0; top: 0; bottom: 0; }
.hero__glow {
  position: absolute; left: 0; top: 0; width: 900px; height: 900px; margin: -450px 0 0 -450px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 140, 90, 0.085), rgba(255, 140, 90, 0.025) 55%, transparent 75%);
  transform: translate3d(70vw, 30vh, 0); opacity: 0; transition: opacity 1.6s var(--ease-out);
}
.is-ready .hero__glow { opacity: 1; }
.hero__inner { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: clamp(28px, 5vh, 48px); }
.hero__meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.status { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.status__dot { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #5ee38a; }
.status__dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid #5ee38a; animation: ping 2.4s var(--ease-out) infinite; }
@keyframes ping { from { transform: scale(0.6); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }

.hero__title {
  font-size: var(--fs-hero); font-weight: 500; line-height: 0.94; letter-spacing: -0.055em;
  margin: auto 0; max-width: 100%;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.07em; margin-bottom: -0.07em; }
.hero__title .line__i { display: inline-block; max-width: 100%; }
.hero__title .line:nth-child(2) { padding-left: clamp(0px, 9vw, 9rem); }
.hero__title em { font-size: 1.06em; letter-spacing: -0.025em; padding-right: 0.1em; }

.hero__bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: clamp(20px, 3vw, 56px); }
.hero__intro { max-width: 34em; font-size: var(--fs-lead); line-height: 1.55; color: var(--text-2); }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

.badge { position: relative; width: 112px; height: 112px; display: grid; place-items: center; border-radius: 50%; }
.badge > svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 22s linear infinite; }
.badge text { fill: var(--text-2); font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
.badge__arrow {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--line-2);
  display: grid; place-items: center; transition: background-color 0.4s, transform 0.6s var(--ease-out);
}
.badge__arrow svg { width: 18px; height: 18px; fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s var(--ease-out); }
.badge:hover .badge__arrow, .badge:focus-visible .badge__arrow { background: var(--accent); transform: scale(1.1); }
.badge:hover .badge__arrow svg, .badge:focus-visible .badge__arrow svg { stroke: #140903; transform: rotate(45deg); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden; border-block: 1px solid var(--line); padding: clamp(14px, 1.6vw, 22px) 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; width: max-content; will-change: transform; }
.marquee__group { display: flex; align-items: center; flex-shrink: 0; }
.marquee span { font-size: clamp(22px, 3.2vw, 44px); font-weight: 500; letter-spacing: -0.045em; padding: 0 clamp(16px, 2vw, 30px); line-height: 1.15; white-space: nowrap; }
.marquee span:nth-of-type(even) { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; color: var(--text-2); }
.marquee i { font-style: normal; font-size: clamp(12px, 1.2vw, 18px); color: var(--accent); }

/* ---------- Sections ---------- */
.section { position: relative; padding: var(--section-y) 0; }
.section__head { display: grid; gap: 20px 64px; margin-bottom: var(--head-gap); }
.section__head--split { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); align-items: end; }
.section__head--split > div { display: grid; gap: 20px; }
.section__title { font-size: var(--fs-h2); font-weight: 500; line-height: 0.95; letter-spacing: -0.052em; }
.section__title em, .contact__title em { padding-right: 0.08em; }
.contact__title em { white-space: nowrap; }
.section__note { max-width: 400px; color: var(--text-2); font-size: 15.5px; }
.work .section__head { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); align-items: end; }
.work .section__head .label { grid-column: 1 / -1; }

/* ---------- Work / projects ---------- */
.projects { position: relative; display: grid; gap: clamp(20px, 3vh, 32px); }
.project { position: sticky; top: calc(var(--nav-h) + 2vh + var(--i) * 14px); }
.projects.no-stick .project { position: relative; top: auto; }
.project__card {
  --mx: 50%; --my: 50%;
  position: relative; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(20px, 3vw, 44px);
  padding: clamp(14px, 1.4vw, 20px);
  background: var(--surface); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line), 0 -30px 60px -30px rgba(0, 0, 0, 0.9);
  transform-origin: 50% 0;
}
.project__card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.05), transparent 45%);
  opacity: 0; transition: opacity 0.5s;
}
.project__card:hover::before { opacity: 1; }
.project__card::after { /* dim layer for stacked cards */
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: #000; opacity: var(--dim, 0); pointer-events: none;
}
.project__info { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: clamp(10px, 1.4vw, 22px); min-width: 0; }
.project__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.project__kind { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 12px; }
.project__title { font-size: var(--fs-project); font-weight: 500; letter-spacing: -0.05em; line-height: 1; margin-bottom: 16px; }
.project__desc { color: var(--text-2); max-width: 26em; font-size: 15.5px; }
.project__bottom { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

.project__media {
  position: relative; display: flex; flex-direction: column; border-radius: calc(var(--radius) - 8px); overflow: hidden;
  background: #1c1c1c; box-shadow: inset 0 0 0 1px var(--line); min-width: 0;
}
@media (hover: hover) and (pointer: fine) { .project__media { cursor: none; } }
.browser { flex: none; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; background: #1c1c1c; position: relative; z-index: 1; }
.browser span { width: 9px; height: 9px; border-radius: 50%; background: #3a3a3a; flex: none; }
.browser em { margin-left: 10px; font-family: var(--mono); font-style: normal; font-size: 11px; color: var(--text-3); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project__img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.project__img img {
  position: absolute; left: 0; top: -4%; width: 100%; height: 108%; object-fit: cover; object-position: center top;
  transform: translate3d(0, var(--py, 0px), 0) scale(1.02); transition: transform 1.2s var(--ease-out);
}
.project__media:hover .project__img img { transform: translate3d(0, var(--py, 0px), 0) scale(1.05); }

/* ---------- Services ---------- */
.services__list { border-top: 1px solid var(--line); }
.service {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.05fr); gap: 12px 32px; align-items: baseline;
  padding: clamp(20px, 2.2vw, 32px) 0; border-bottom: 1px solid var(--line);
}
.service__n { color: var(--text-3); }
.service__title { font-size: var(--fs-service); font-weight: 500; letter-spacing: -0.045em; line-height: 1.05; }
.service__body { display: grid; gap: 12px; }
.service__body p { color: var(--text-2); max-width: 30em; }
.services__cta { display: flex; justify-content: space-between; align-items: center; gap: 12px 32px; flex-wrap: wrap; padding-top: clamp(20px, 2.4vw, 32px); color: var(--text-2); }

.process { margin-top: clamp(48px, 6vw, 88px); }
.process__line { height: 1px; background: var(--line); margin: 20px 0 0; }
.process__line span { display: block; height: 100%; background: var(--text-2); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.process__steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.process__steps li { padding-top: 22px; position: relative; }
.process__steps li::before { content: ""; position: absolute; top: -4px; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--text); }
.process__steps h3 { font-size: 20px; font-weight: 500; letter-spacing: -0.03em; margin: 10px 0 6px; }
.process__steps p { color: var(--text-2); font-size: 15px; max-width: 18em; }

/* ---------- About ---------- */
.about__statement {
  margin: 24px 0 clamp(40px, 5vw, 72px); max-width: 30em;
  font-size: var(--fs-statement); font-weight: 450; letter-spacing: -0.038em; line-height: 1.15;
}
.about__statement .w { transition: opacity 0.35s linear; }
.js .about__statement .w { opacity: 0.18; }
.js .about__statement .w.is-lit { opacity: 1; }
.about__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px clamp(40px, 6vw, 96px); align-items: start; }
.about__intro > p { font-size: var(--fs-lead); color: var(--text-2); max-width: 32em; margin-bottom: 16px; }
.principles { margin-top: 28px; border-top: 1px solid var(--line); }
.principles li { display: grid; grid-template-columns: 30px 1fr; padding: 16px 0; border-bottom: 1px solid var(--line); }
.principles li .mono { color: var(--accent); padding-top: 3px; }
.principles h3 { font-size: 17px; font-weight: 500; letter-spacing: -0.02em; }
.principles p { color: var(--text-2); font-size: 15px; }
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.skills__group { padding: clamp(18px, 1.8vw, 24px); border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.skills__group:last-child { grid-column: 1 / -1; }
.skills__group h3 { margin-bottom: 12px; }
.skills__group ul { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.skills__group li { font-size: 16px; letter-spacing: -0.015em; }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(48px, 6vw, 88px); }
.contact__title { margin: 20px 0 18px; max-width: 13em; font-size: var(--fs-contact); font-weight: 500; line-height: 0.95; letter-spacing: -0.055em; }
.contact__text { color: var(--text-2); max-width: 30em; font-size: var(--fs-lead); }
.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 40px clamp(40px, 6vw, 96px); align-items: end; margin-top: clamp(32px, 4.5vw, 56px); }
.contact__main { container-type: inline-size; min-width: 0; }
.contact__mail { margin-bottom: 28px; }
.brief { padding: clamp(20px, 2vw, 26px); border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.brief h3 { margin-bottom: 10px; }
.brief li { display: grid; grid-template-columns: 32px 1fr; padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.brief li .mono { color: var(--text-3); padding-top: 1px; }
.mail {
  display: inline-flex; align-items: center; gap: clamp(12px, 2vw, 28px); max-width: 100%;
  font-size: clamp(1.4rem, 4.6vw, 4.5rem); font-size: clamp(1.35rem, 7.6cqi, 4.75rem);
  font-weight: 450; letter-spacing: -0.045em; line-height: 1.15; position: relative; padding-bottom: 8px;
}
.mail__text { overflow-wrap: anywhere; min-width: 0; }
.mail::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line-2); }
.mail::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--text); z-index: 1;
  transform: scaleX(0); transform-origin: right; transition: transform 0.9s var(--ease-out);
}
.mail:hover::before, .mail:focus-visible::before { transform: scaleX(1); transform-origin: left; }
.mail__icon {
  flex: none; width: 1.05em; height: 1.05em; min-width: 40px; min-height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--text); transition: transform 0.7s var(--ease-out), background-color 0.4s;
}
.mail__icon svg { width: 42%; height: 42%; fill: none; stroke: var(--bg); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mail:hover .mail__icon, .mail:focus-visible .mail__icon { background: var(--accent); transform: rotate(45deg); }
.contact__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer { padding: 0 0 calc(24px + env(safe-area-inset-bottom)); overflow: hidden; }
.footer__word {
  display: flex; white-space: nowrap; font-size: 19.5vw; font-weight: 500; letter-spacing: -0.065em; line-height: 0.8;
  padding: 0.05em 0 0.08em; color: var(--text); overflow: hidden; user-select: none;
}
.footer__word span { display: inline-block; transform: translate3d(0, var(--fy, 0%), 0); }
.footer__word .sp { width: 0.28em; }
.footer__row { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer__links a, .totop { transition: color 0.3s; padding: 4px 0; }
.footer__links a:hover, .totop:hover { color: var(--text); }
.totop { display: inline-flex; align-items: center; gap: 8px; }
.totop svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s var(--ease-out); }
.totop:hover svg { transform: translateY(-3px); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 160;
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
  padding: 12px 20px; border-radius: 20px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; line-height: 1.4;
  transform: translate(-50%, 160%); opacity: 0; transition: transform 0.6s var(--ease-out), opacity 0.4s; pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ==========================================================================
   Motion states — only while JS runs and motion is allowed.
   Entrance starts on the first frame: nothing waits on a loader.
   ========================================================================== */
.js:not(.no-motion) .hero__title .line__i { transform: translate3d(0, 108%, 0) rotate(2deg); transform-origin: 0 100%; }
.js:not(.no-motion) .hero .fade-in { opacity: 0; transform: translate3d(0, 16px, 0); }
.js:not(.no-motion) .hero__cols i { transform: scaleY(0); }

.is-ready .hero__title .line__i { transform: none !important; transition: transform 1.1s var(--ease-out); }
.is-ready .hero__title .line:nth-child(2) .line__i { transition-delay: 0.07s; }
.is-ready .hero__title .line:nth-child(3) .line__i { transition-delay: 0.14s; }
.is-ready .hero .fade-in { opacity: 1 !important; transform: none !important; transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: 0.25s; }
.is-ready .hero__meta .fade-in { transition-delay: 0.1s; }
.is-ready .hero__cta.fade-in { transition-delay: 0.32s; }
.is-ready .badge.fade-in { transition-delay: 0.4s; }
.is-ready .hero__cols i { transform: none !important; transition: transform 1.4s var(--ease-io); }
.is-ready .hero__cols i:nth-child(2) { transition-delay: 0.05s; } .is-ready .hero__cols i:nth-child(3) { transition-delay: 0.1s; }
.is-ready .hero__cols i:nth-child(4) { transition-delay: 0.15s; } .is-ready .hero__cols i:nth-child(5) { transition-delay: 0.2s; }

/* Generic reveal */
.js:not(.no-motion) [data-reveal] { opacity: 0; transform: translate3d(0, 24px, 0); }
.js [data-reveal].is-in {
  opacity: 1; transform: none;
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0ms);
}

/* Word-split reveal */
.w { display: inline-block; }
.split .w { overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; padding-right: 0.02em; }
.split .w__i { display: inline-block; }
.split em .w { padding-right: 0.12em; margin-right: -0.1em; }
.js:not(.no-motion) .split .w__i { transform: translate3d(0, 105%, 0); }
.js .split.is-in .w__i { transform: none; transition: transform 1s var(--ease-out); transition-delay: calc(var(--wi) * 45ms); }

/* Project cards rise in */
.js:not(.no-motion) .project__card { opacity: 0; transform: translate3d(0, 60px, 0); }
.js .project.is-in .project__card { opacity: 1; transform: translate3d(0, 0, 0) scale(var(--s, 1)); transition: opacity 0.9s var(--ease-out), transform 1s var(--ease-out); }
.js .project.is-in.is-settled .project__card { transition: none; }
.js:not(.no-motion) .project__img img { clip-path: inset(100% 0 0 0); }
.js .project.is-in .project__img img { clip-path: inset(0 0 0 0); transition: clip-path 1.2s var(--ease-io) 0.1s, transform 1.2s var(--ease-out); }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Laptops & small desktops */
@media (max-width: 1280px) {
  .project__card { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
}

/* Tablets landscape / small laptops */
@media (max-width: 1100px) {
  .hero__bottom { grid-template-columns: minmax(0, 1fr) auto; }
  .hero__intro { grid-column: 1 / -1; }
  .section__head--split, .work .section__head { grid-template-columns: 1fr; }
  .project, .projects.no-stick .project { position: relative; top: auto; }
  .projects { gap: 20px; }
  .service { grid-template-columns: 48px minmax(0, 1fr); }
  .service__body { grid-column: 2; }
  .about__grid, .contact__grid { grid-template-columns: 1fr; }
  .brief { max-width: 560px; }
}

/* Tablets portrait & large phones */
@media (max-width: 860px) {
  :root { --nav-h: 66px; --hero-vw: 10.6vw; }
  .nav__links { display: none; }
  .nav__toggle { display: block; }
  .hide-sm { display: none; }
  .hero__title .line:nth-child(2) { padding-left: 0; }
  .hero__cols { grid-template-columns: repeat(2, 1fr); }
  .hero__cols i:nth-child(3), .hero__cols i:nth-child(4) { display: none; }
  .process__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
  .project__card { grid-template-columns: 1fr; gap: 8px; }
  .project__media { order: -1; }
  .project__info { gap: 20px; }
}

/* Phones */
@media (max-width: 600px) {
  :root { --hero-vw: 11.2vw; --section-y: 64px; }
  body { font-size: 15.5px; }
  .hero__bottom { grid-template-columns: 1fr; gap: 24px; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .badge { display: none; }
  .hero__meta .mono { display: none; }
  .project__desc { font-size: 15px; }
  .browser { height: 28px; padding: 0 12px; } .browser em { font-size: 10px; }
  .service { grid-template-columns: 1fr; gap: 8px; }
  .service__body { grid-column: 1; }
  .process__line { display: none; }
  .process__steps { grid-template-columns: 1fr; gap: 0; margin-top: 20px; }
  .process__steps li { padding: 0 0 24px 24px; border-left: 1px solid var(--line-2); }
  .process__steps li:last-child { padding-bottom: 0; border-left-color: transparent; }
  .process__steps li::before { top: 4px; left: -4px; }
  .process__steps h3 { margin-top: 4px; }
  .skills { grid-template-columns: 1fr; }
  .contact__actions .btn { flex: 1 1 100%; }
  .footer__row { flex-direction: column; align-items: flex-start; }
}

/* Very small phones */
@media (max-width: 360px) {
  .nav__word { font-size: 12.5px; }
  .btn { padding: 0 20px; }
}

/* Short landscape screens (phones turned sideways) */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: auto; padding-bottom: 40px; }
  .hero__title { margin: 24px 0; }
}

/* ==========================================================================
   Reduced motion: keep everything visible and calm
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; }
}
