/* Annageldi Hydyrov portfolio, version 3: "Spark"
   A dark page lit by sparks. The shell (home, work, awards, about) uses coal, sand
   and fire colours. Project pages may switch to a project's own colours while its
   section is on screen. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Theme colours are registered so they can fade from one section to the next. */
@property --bg      { syntax: "<color>"; inherits: true; initial-value: #0b0a09; }
@property --fg      { syntax: "<color>"; inherits: true; initial-value: #efe6d8; }
@property --fg-soft { syntax: "<color>"; inherits: true; initial-value: #a59b8f; }
@property --line    { syntax: "<color>"; inherits: true; initial-value: rgba(239, 230, 216, 0.16); }
@property --accent  { syntax: "<color>"; inherits: true; initial-value: #ff5b1f; }

:root {
  --coal: #0b0a09;
  --ash: #191614;
  --sand: #efe6d8;
  --ember: #ff5b1f;
  --flame: #ffb23e;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 4vw, 56px);
  --section: clamp(88px, 12vw, 184px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; background: #0b0a09; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: --bg 0.8s ease, --fg 0.8s ease, --fg-soft 0.8s ease, --line 0.8s ease, --accent 0.8s ease;
}
/* project colours, used only inside project pages */
body[data-theme="dawn"]  { --bg: #e8dadc; --fg: #2a1a26; --fg-soft: #5d4856; --line: rgba(42, 26, 38, 0.2); --accent: #b53a08; }
body[data-theme="black"] { --bg: #020203; --fg: #f0ebf4; --fg-soft: #b6adc0; --line: rgba(255, 255, 255, 0.22); --accent: #ffb23e; }
body[data-theme="night"] { --bg: #0b2a1e; --fg: #edf5ef; --fg-soft: #b4cdbf; --line: rgba(246, 217, 139, 0.28); --accent: #f6d98b; }

/* a little film grain over everything */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background: url("../img/noise.png"); opacity: 0.5; mix-blend-mode: overlay;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1; letter-spacing: -0.035em; text-wrap: balance; }
h2 { font-size: clamp(2.25rem, 5.6vw, 4.75rem); line-height: 0.96; }
h3 { font-size: clamp(1.5rem, 2.5vw, 2.125rem); line-height: 1.08; letter-spacing: -0.025em; }

p { margin: 0 0 1em; max-width: 62ch; }

a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 3px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--ember); color: #0b0a09; }

.wrap { width: 100%; max-width: 1680px; margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

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

/* ---------- page-to-page transitions (browsers that support them) ---------- */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: page-out 0.5s cubic-bezier(0.6, 0, 0.4, 1) both; }
  ::view-transition-new(root) { animation: page-in 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  ::view-transition-group(*) { animation-duration: 0.7s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@keyframes page-out { to { opacity: 0; transform: translateY(-5vh) scale(0.97); } }
@keyframes page-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- entrance motion (only when JavaScript is running) ---------- */
.js .reveal { opacity: 0; transition: opacity 0.9s ease 0.1s; }
.js .reveal.is-in { opacity: 1; }

.mask { display: block; overflow: hidden; padding-block: 0.14em 0.18em; margin-block: -0.14em -0.18em; }
.mask__in { display: block; }
.js .mask__in { transform: translateY(112%); transition: transform 0.95s var(--ease); }
.js .mask.is-in .mask__in { transform: none; }

/* the picture itself is clipped, not the observed link, so the browser can still see it arrive */
.js .wipe img { clip-path: inset(0 0 100% 0); transform: scale(1.12); transition: clip-path 1.1s var(--ease), transform 1.4s var(--ease); }
.js .wipe.is-in img { clip-path: inset(0 0 0 0); transform: none; }

.js .stagger > * { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.7s var(--ease); transition-delay: calc(var(--n, 0) * 80ms); }
.js .stagger.is-in > * { opacity: 1; transform: none; }
.stagger > :nth-child(2) { --n: 1; } .stagger > :nth-child(3) { --n: 2; } .stagger > :nth-child(4) { --n: 3; }
.stagger > :nth-child(5) { --n: 4; } .stagger > :nth-child(6) { --n: 5; } .stagger > :nth-child(7) { --n: 6; }
.stagger > :nth-child(8) { --n: 7; }

/* ---------- top bar ---------- */
.top { position: fixed; inset: 0 0 auto 0; z-index: 30; transition: transform 0.45s var(--ease); view-transition-name: site-header; }
.top::before { content: ""; position: absolute; inset: 0 0 -24px 0; z-index: -1; pointer-events: none; background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 94%, transparent) 30%, transparent); }
.top.is-hidden { transform: translateY(-110%); }
.top__row { display: flex; align-items: center; gap: 12px 34px; padding: 18px var(--gutter); }
.top__name { font-weight: 800; font-size: 1.0625rem; letter-spacing: -0.015em; text-decoration: none; margin-right: auto; }
.top__nav { display: flex; gap: 30px; font-size: 1rem; }
.top__nav a { text-decoration: none; padding-block: 4px; background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 100% / 0 2px; transition: background-size 0.35s var(--ease); }
.top__nav a:hover, .top__nav a[aria-current="page"] { background-size: 100% 2px; }
.top__time { margin: 0; font-size: 0.9375rem; color: var(--fg-soft); white-space: nowrap; }
.top__menu { display: none; font: inherit; font-weight: 600; font-size: 1rem; color: var(--fg); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; cursor: pointer; }

@media (max-width: 900px) {
  .top__time { display: none; }
  .js .top__menu { display: block; }
  .js .top__nav {
    position: fixed; inset: 0; z-index: -1; height: 100dvh;
    flex-direction: column; justify-content: center; gap: 0;
    padding: 80px var(--gutter) 40px;
    background: var(--bg);
    visibility: hidden; opacity: 0; transition: opacity 0.3s ease, visibility 0s 0.3s;
  }
  .js .top__nav a { font-weight: 900; text-transform: uppercase; letter-spacing: -0.04em; font-size: clamp(2.75rem, 15vw, 5rem); line-height: 1.02; background: none; }
  .js .top__nav a[aria-current="page"] { color: var(--accent); }
  .js .top.is-open .top__nav { visibility: visible; opacity: 1; transition: opacity 0.3s ease; }
  .js .top.is-open { transform: none; }
  html:not(.js) .top { position: static; }
  html:not(.js) .top__row { flex-wrap: wrap; }
  html:not(.js) .top__nav { flex-wrap: wrap; gap: 6px 20px; }
}

/* ---------- the cursor ---------- */
.cursor { display: none; }
.has-cursor .cursor { display: block; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: 0; transition: opacity 0.25s ease; }
.has-cursor .cursor.is-on { opacity: 1; }
.cursor__dot { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 14px 3px rgba(255, 91, 31, 0.75); transition: opacity 0.2s ease; }
.cursor__ring {
  position: absolute; left: 0; top: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--fg) 50%, transparent);
  display: grid; place-items: center;
  transition: width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease), background-color 0.3s ease, border-color 0.3s ease;
}
.cursor.is-link .cursor__ring { width: 68px; height: 68px; margin: -34px 0 0 -34px; border-color: var(--ember); background: rgba(255, 91, 31, 0.14); }
.cursor.is-label .cursor__ring { width: 96px; height: 96px; margin: -48px 0 0 -48px; border-color: var(--ember); background: var(--ember); }
.cursor.is-down .cursor__ring { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
.cursor__label { font-size: 0.8125rem; font-weight: 800; color: #0b0a09; opacity: 0; transition: opacity 0.2s ease; }
.cursor.is-label .cursor__label { opacity: 1; }
.cursor.is-label .cursor__dot { opacity: 0; }
.has-cursor, .has-cursor a, .has-cursor button, .has-cursor input, .has-cursor summary, .has-cursor .zoom, .has-cursor .rail { cursor: none; }

/* ---------- hero with a spark title ---------- */
.hero { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: 100svh; overflow: hidden; background: var(--bg); }
.hero--page { min-height: clamp(440px, 72svh, 760px); }
@media (max-width: 700px) { .hero { min-height: 86svh; } .hero--page { min-height: 62svh; } }
.embers { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; mix-blend-mode: screen; }
.hero__inner { width: 100%; padding: 104px var(--gutter) clamp(20px, 3.2vw, 44px); display: grid; gap: clamp(20px, 3vw, 44px); }
.title { margin: 0; font-weight: 900; text-transform: uppercase; letter-spacing: -0.045em; line-height: 0.84; font-size: clamp(3rem, 12.5vw, 12rem); }
.title .line { display: block; white-space: nowrap; }
.embers-on .title { color: transparent; }
.hero__foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 48px; border-top: 1px solid var(--line); padding-top: clamp(14px, 1.8vw, 22px); }
.hero__role { margin: 0; max-width: 36ch; font-size: clamp(1.0625rem, 1.55vw, 1.375rem); line-height: 1.3; font-weight: 500; }
.hero__meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 36px; color: var(--fg-soft); font-size: 1rem; }
.hero__meta strong { display: block; color: var(--fg); font-weight: 600; }
.hero__cue { margin: 0; display: flex; align-items: center; gap: 12px; color: var(--fg-soft); font-size: 0.9375rem; }
.hero__cue::after { content: ""; width: 1px; height: 44px; background: linear-gradient(var(--ember), transparent); transform-origin: top; }
.js .hero__foot { opacity: 0; animation: fade 1.2s ease 1.1s forwards; }
@keyframes fade { to { opacity: 1; } }

/* ---------- home: statement ---------- */
.statement { padding-block: var(--section); }
.scrub { margin: 0; max-width: 20em; font-size: clamp(1.75rem, 4.7vw, 4.5rem); line-height: 1.06; letter-spacing: -0.035em; font-weight: 700; text-wrap: pretty; }
.scrub span { color: color-mix(in srgb, var(--fg) 20%, transparent); transition: color 0.5s ease; }
.scrub span.is-lit { color: var(--fg); }

/* ---------- section heads ---------- */
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 32px; }
.more { font-weight: 600; white-space: nowrap; }

/* ---------- home: work list ---------- */
.block { padding-block: var(--section); }
.block--tight { padding-top: 0; }
.index { list-style: none; margin: clamp(24px, 3.4vw, 48px) 0 0; padding: 0; border-top: 1px solid var(--line); }
.index a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 24px;
  padding-block: clamp(12px, 1.7vw, 24px); border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.index__name {
  font-size: clamp(2.25rem, 7.6vw, 7rem); line-height: 0.96; letter-spacing: -0.045em; text-transform: uppercase;
  font-weight: 500; color: var(--fg-soft);
  transition: font-weight 0.55s var(--ease), color 0.3s ease, transform 0.55s var(--ease);
  transform-origin: left center;
}
.index__kind { color: var(--fg-soft); font-size: 1rem; }
.index a:hover .index__name, .index a:focus-visible .index__name { font-weight: 900; color: var(--fg); transform: translateX(clamp(8px, 1.6vw, 26px)); }
@media (max-width: 700px) {
  .index a { grid-template-columns: minmax(0, 1fr); }
  .index__name { font-weight: 800; color: var(--fg); }
}

.preview {
  position: fixed; left: 0; top: 0; z-index: 20; pointer-events: none;
  width: min(30vw, 440px); aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden;
  opacity: 0; transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(0.7) rotate(var(--lean, 0deg));
  transition: opacity 0.3s ease;
  background: var(--ash);
}
.preview.is-on { opacity: 1; transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(1) rotate(var(--lean, 0deg)); }
.preview > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.25s ease; }
.preview > .is-on { opacity: 1; }
@media (hover: none), (max-width: 900px) { .preview { display: none; } }

/* drawn posters for projects that have no picture yet */
.poster { display: grid; place-items: center; padding: 10%; background: radial-gradient(120% 90% at 50% 110%, rgba(255, 91, 31, 0.5), transparent 60%), var(--ash); color: var(--sand); }
.poster svg { width: 100%; height: auto; overflow: visible; }
.poster--chat { grid-template-rows: repeat(3, 15%); align-content: center; justify-items: start; row-gap: 9%; }
.poster--chat span { display: block; height: 100%; width: 44%; border-radius: 999px; background: var(--sand); }
.poster--chat span:nth-child(2) { width: 76%; justify-self: end; background: var(--ember); }
.poster--chat span:nth-child(3) { width: 58%; }
.poster--word { font-weight: 900; text-transform: uppercase; letter-spacing: -0.05em; line-height: 0.86; font-size: clamp(2rem, 7vw, 6rem); text-align: center; color: transparent; -webkit-text-stroke: 1.5px var(--sand); }

/* ---------- buttons ---------- */
.button {
  display: inline-block; font: inherit; font-weight: 700; font-size: 1.0625rem; text-decoration: none;
  padding: 16px 28px; border-radius: 999px; border: 1px solid var(--ember);
  background: var(--ember); color: #0b0a09;
  transition: background-color 0.2s ease, color 0.2s ease;
  will-change: transform;
}
.button:hover { background: var(--flame); border-color: var(--flame); }
.button--line { background: transparent; color: var(--fg); border-color: var(--line); }
.button--line:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }

/* ---------- sideways tracks (work page, Clock Islands) ---------- */
.walk__stage { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; padding-block: 84px 22px; }
.walk__head { padding-inline: var(--gutter); }
.walk__head .summary { margin-bottom: 0; max-width: 34ch; }
.walk__track { position: relative; display: flex; align-items: center; gap: clamp(28px, 6vw, 110px); padding: 20px var(--gutter); overflow-x: auto; scrollbar-width: thin; }
.walk__foot { padding-inline: var(--gutter); }
.walk__caps { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.walk__cap h3 { font-size: clamp(1.5rem, 2.6vw, 2.25rem); }
.walk__cap p { margin: 8px 0 0; color: var(--fg-soft); max-width: 46ch; }
.walk__meter, .walk__hint { display: none; }

/* pinned mode: turned on by the script when motion is allowed */
.walk--pinned .walk__stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.walk--pinned .walk__track { overflow: visible; width: max-content; will-change: transform; }
.walk--pinned .walk__caps { display: block; position: relative; min-height: 6.6em; }
.walk--pinned .walk__cap { position: absolute; inset: 0 auto auto 0; opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.6s var(--ease); }
.walk--pinned .walk__cap.is-active { opacity: 1; transform: none; }
.walk--pinned .walk__meter { display: block; height: 2px; background: var(--line); margin-top: 14px; }
.walk--pinned .walk__meter span { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.walk--pinned .walk__hint { display: block; margin: 10px 0 0; font-size: 0.9375rem; color: var(--fg-soft); }
@media (max-height: 640px) { .walk--pinned .walk__head .summary { display: none; } }

/* island pictures inside the Clock Islands walk */
.walk__panel { flex: none; margin: 0; height: clamp(180px, 40svh, 460px); aspect-ratio: 5 / 1; }
.walk__panel img {
  width: 100%; height: 100%; object-fit: cover;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 82%, transparent 100%), linear-gradient(to right, transparent 0%, #000 3%, #000 97%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 82%, transparent 100%), linear-gradient(to right, transparent 0%, #000 3%, #000 97%, transparent 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}

/* project cards on the work page */
.pcard { flex: none; width: min(62vw, 900px, calc((100svh - 250px) * 1.6)); display: grid; gap: 18px; text-decoration: none; transition: transform 0.8s var(--ease), opacity 0.6s ease; }
@media (max-width: 700px) { .pcard { width: min(84vw, calc((100svh - 250px) * 1.6)); } }
.walk--pinned .pcard:not(.is-active) { opacity: 0.4; transform: scale(0.9) rotate(var(--r, 0deg)); }
.pcard:nth-child(odd) { --r: -2deg; } .pcard:nth-child(even) { --r: 2deg; }
.pcard__media { aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--ash); }
.pcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
a.pcard:hover .pcard__media img { transform: scale(1.05); }
.pcard__text { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; }
.pcard__name { font-size: clamp(1.75rem, 3.8vw, 3.5rem); font-weight: 900; text-transform: uppercase; letter-spacing: -0.04em; line-height: 0.95; }
.pcard__kind { color: var(--fg-soft); }

/* ---------- project pages ---------- */
.project { padding-block: var(--section); }
.project--tight { padding-top: 0; }
.project__sub { font-size: clamp(1.875rem, 3.8vw, 3.25rem); margin-bottom: 24px; }
.lead-media { padding-inline: var(--gutter); margin: 0; }
.lead-media img { width: 100%; border-radius: 14px; }

.split { display: grid; gap: clamp(32px, 5vw, 84px); align-items: start; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .split--media-first { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}
@media (max-width: 899px) {
  /* on one column the heading always comes before the pictures */
  .split--media-first .split__media { order: 2; }
  .d-label { font-size: 20px; }
}

.summary { font-size: clamp(1.25rem, 1.9vw, 1.5rem); line-height: 1.3; margin: 18px 0 24px; max-width: 30ch; font-weight: 600; letter-spacing: -0.015em; }
.split__text > p:not(.summary) { color: var(--fg-soft); }

.shot { width: 100%; border-radius: 8px; }
.zoom { display: block; cursor: zoom-in; border-radius: 8px; overflow: hidden; }
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.shots--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.note { font-size: 0.9375rem; color: var(--fg-soft); margin: 12px 0 4px; max-width: none; }

.facts { margin: 32px 0 0; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 16px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--fg-soft); }
.facts dd { margin: 0; font-weight: 500; }
.facts--wide { margin-top: 12px; }
.facts--row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 clamp(20px, 3vw, 40px); border-top: 0; margin-top: clamp(36px, 5vw, 64px); }
.facts--row > div { grid-template-columns: minmax(0, 1fr); gap: 2px; border-top: 1px solid var(--line); border-bottom: 0; padding-block: 14px 0; }

.next { display: block; padding: clamp(48px, 7vw, 96px) var(--gutter); border-top: 1px solid var(--line); text-decoration: none; }
.next span { display: block; color: var(--fg-soft); margin-bottom: 8px; }
.next strong { display: block; font-size: clamp(2.5rem, 9vw, 8.5rem); line-height: 0.9; letter-spacing: -0.045em; text-transform: uppercase; font-weight: 500; color: var(--fg-soft); transition: font-weight 0.55s var(--ease), color 0.3s ease; }
.next:hover strong, .next:focus-visible strong { font-weight: 900; color: var(--fg); }

/* YashylOS */
.os-title { display: flex; align-items: center; gap: 16px; }
.os-mark { flex: none; width: clamp(44px, 5vw, 64px); height: auto; }
.compare { position: relative; border-radius: 12px; overflow: hidden; outline: 1px solid var(--line); outline-offset: -1px; --pos: 55%; }
.compare img { width: 100%; display: block; }
.compare__top { position: absolute; inset: 0; height: 100%; object-fit: cover; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #f6d98b; pointer-events: none; }
.compare__handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: #d9a441; box-shadow: 0 0 0 3px #0b2a1e; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }

.download { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.download__soon { display: inline-block; margin: 0; padding: 14px 25px; border: 1px solid var(--line); border-radius: 999px; font-weight: 700; font-size: 1.0625rem; color: var(--accent); }
.download__meta { font-size: 0.9375rem; color: var(--fg-soft); margin: 14px 0 0; }
.download__meta + .download__meta { margin-top: 6px; }
.checksums { margin-top: 18px; font-size: 0.9375rem; color: var(--fg-soft); }
.checksums summary { cursor: pointer; width: fit-content; }
.checksums p { margin: 12px 0 0; max-width: none; }
.checksums code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.8125rem; overflow-wrap: anywhere; color: var(--fg); }

.letters { margin-top: clamp(56px, 8vw, 104px); }
.letters__row {
  display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 0.05em 0.3em;
  font-weight: 800; line-height: 1.15; letter-spacing: -0.02em;
  font-size: clamp(2.5rem, 10.5vw, 5.5rem);
  color: var(--accent);
  margin: 0; max-width: none;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding-block: clamp(14px, 2vw, 28px);
}
@media (min-width: 1000px) { .letters__row { grid-template-columns: repeat(8, auto); font-size: clamp(3.4rem, 5.6vw, 5.5rem); } }
.letters__row span { display: inline-block; cursor: default; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .js .letters__row.is-in span { transition: transform 0.45s var(--ease), color 0.3s ease; transition-delay: 0s; }
  .js .letters__row.is-in span:hover { transform: translateY(-0.12em) scale(1.14); color: var(--fg); }
}
.letters__caption { margin: 18px 0 0; color: var(--fg-soft); max-width: 48ch; }

/* line diagram */
.diagram { margin: 0; }
.diagram svg { width: 100%; height: auto; overflow: visible; }
.diagram figcaption { font-size: 0.9375rem; color: var(--fg-soft); margin-top: 14px; max-width: 46ch; }
.d-axis { stroke: var(--fg); stroke-width: 1.5; }
.d-threshold { stroke: var(--fg-soft); stroke-width: 1.5; stroke-dasharray: 5 6; }
.d-line { fill: none; stroke: var(--fg); stroke-width: 2; stroke-linejoin: round; }
.d-dots circle { fill: var(--fg); }
.d-dots--over circle { fill: var(--flame); stroke: var(--bg); stroke-width: 1.5; }
.d-wake { fill: var(--ember); stroke: var(--bg); stroke-width: 2; transform-box: fill-box; transform-origin: center; }
.d-pointer, .d-bracket { stroke: var(--fg); stroke-width: 1.5; fill: none; }
.d-label { font-family: var(--font); font-size: 14px; fill: var(--fg-soft); }
.d-label--strong { fill: var(--fg); font-weight: 700; }
.js .draw .d-line { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.2s ease 0.3s; }
.js .draw.is-in .d-line { stroke-dashoffset: 0; }
.js .draw .d-dots { opacity: 0; transition: opacity 0.6s ease 2.1s; }
.js .draw.is-in .d-dots { opacity: 1; }
.js .draw .d-wakegroup { opacity: 0; transition: opacity 0.4s ease 1.7s; }
.js .draw.is-in .d-wakegroup { opacity: 1; }
.js .draw .d-wake { transform: scale(0); transition: transform 0.7s cubic-bezier(0.3, 1.8, 0.5, 1) 1.7s; }
.js .draw.is-in .d-wake { transform: none; }

.steps__title { margin-top: clamp(56px, 8vw, 96px); }
.steps { list-style: none; counter-reset: step; margin: 28px 0 0; padding: 0; display: grid; gap: 0 clamp(24px, 4vw, 56px); grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.2em minmax(0, 1fr); column-gap: 8px; padding-block: 16px; border-top: 1px solid var(--line); }
.steps li::before { content: counter(step); grid-row: span 2; font-weight: 900; font-size: 1.5rem; line-height: 1.2; color: var(--accent); }
.steps strong { font-weight: 700; }
.steps span { color: var(--fg-soft); font-size: 1rem; }
.steps__note { margin: 24px 0 0; color: var(--fg-soft); }

/* ---------- about: experience, education, skills ---------- */
.cv { padding-block: var(--section); }
.cv--tight { padding-top: 0; }
.cv__grid { display: grid; gap: 28px clamp(32px, 6vw, 96px); align-items: start; }
@media (min-width: 900px) { .cv__grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }
.cv h2 { font-size: clamp(2rem, 4.2vw, 3.5rem); }
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.timeline li { display: grid; gap: 4px clamp(16px, 3vw, 40px); padding-block: clamp(18px, 2.4vw, 30px); border-bottom: 1px solid var(--line); transition: padding-left 0.45s var(--ease); }
@media (min-width: 620px) { .timeline li { grid-template-columns: 11em minmax(0, 1fr); } }
@media (hover: hover) { .timeline li:hover { padding-left: 16px; } .timeline li:hover strong { color: var(--accent); } }
.timeline__when { color: var(--fg-soft); padding-top: 0.3em; }
.timeline strong { display: block; font-weight: 800; font-size: clamp(1.375rem, 2.4vw, 2rem); line-height: 1.08; letter-spacing: -0.025em; transition: color 0.3s ease; }
.timeline__where { display: block; margin-top: 6px; font-weight: 600; }
.timeline p { margin: 10px 0 0; color: var(--fg-soft); max-width: 56ch; }
.skills { display: grid; gap: 0; border-top: 1px solid var(--line); margin: 0; }
.skills > div { display: grid; gap: 6px clamp(16px, 3vw, 40px); padding-block: 18px; border-bottom: 1px solid var(--line); }
@media (min-width: 620px) { .skills > div { grid-template-columns: 11em minmax(0, 1fr); } }
.skills dt { color: var(--fg-soft); }
.skills dd { margin: 0; font-weight: 500; }
.lede { font-size: clamp(1.5rem, 3vw, 2.5rem); line-height: 1.12; letter-spacing: -0.03em; font-weight: 700; max-width: 26ch; text-wrap: pretty; }

/* ---------- awards ---------- */
.award { display: grid; gap: clamp(28px, 6vw, 96px); align-items: center; }
@media (min-width: 760px) { .award { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); } }
.award__image, .award__image.zoom { position: relative; display: block; max-width: 400px; perspective: 900px; overflow: visible; }
.award__image img { border-radius: 6px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--line); transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.5s var(--ease); will-change: transform; }
.tilt__glare { position: absolute; inset: 0; border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity 0.4s ease; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.45), transparent 55%); transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.is-tilting .tilt__glare { opacity: 1; }
.is-tilting img, .is-tilting .tilt__glare { transition: transform 0.1s linear, opacity 0.4s ease; }
.award__text .summary { margin-top: 16px; max-width: 34ch; }
.award__text p:not(.summary) { color: var(--fg-soft); }
.wins { list-style: none; margin: clamp(20px, 3vw, 36px) 0; padding: 0; border-top: 1px solid var(--line); }
.wins li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 4px clamp(16px, 3vw, 40px); padding-block: 16px; border-bottom: 1px solid var(--line); }
.wins__year { font-weight: 900; font-size: clamp(1.75rem, 3.4vw, 3rem); letter-spacing: -0.04em; color: var(--accent); }
.wins strong { font-weight: 800; font-size: clamp(1.25rem, 2.1vw, 1.75rem); letter-spacing: -0.025em; line-height: 1.1; display: block; }
.wins span span { color: var(--fg-soft); }

.rail-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; margin-top: clamp(64px, 9vw, 120px); }
.rail-hint { margin: 0; font-size: 0.9375rem; color: var(--fg-soft); }
.rail {
  list-style: none; margin: 20px 0 0; padding: 30px var(--gutter) 40px;
  display: flex; align-items: flex-start; gap: clamp(20px, 3vw, 44px);
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  cursor: grab; -webkit-user-select: none; user-select: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.card { flex: none; width: min-content; scroll-snap-align: center; transform: rotate(var(--r, 0deg)); transition: transform 0.5s var(--ease); }
.js .rail.stagger > .card { transform: translateY(60px) rotate(calc(var(--r, 0deg) * 4)); }
.js .rail.stagger.is-in > .card { transform: rotate(var(--r, 0deg)); }
.card:nth-child(4n + 1) { --r: -2.4deg; } .card:nth-child(4n + 2) { --r: 1.8deg; }
.card:nth-child(4n + 3) { --r: -1.2deg; } .card:nth-child(4n + 4) { --r: 2.6deg; }
.js .rail.stagger.is-in > .card:hover, .js .rail.stagger.is-in > .card:focus-within, .card:hover, .card:focus-within { transform: rotate(0deg) translateY(-10px); transition-delay: 0s; }
.card .zoom { position: relative; border-radius: 4px; overflow: visible; perspective: 800px; }
.card img { height: clamp(210px, 27vw, 320px); width: auto; max-width: none; border-radius: 4px; box-shadow: 0 30px 50px -26px rgba(0, 0, 0, 0.95), 0 0 0 1px var(--line); transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.5s var(--ease); }
.card strong { display: block; margin-top: 18px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.card span, .card time { display: block; color: var(--fg-soft); font-size: 0.9375rem; line-height: 1.4; margin-top: 3px; }
.card .tilt__glare { margin: 0; }
.certs__note { margin: 4px 0 0; padding-inline: var(--gutter); color: var(--fg-soft); font-size: 1rem; max-width: none; }

/* ---------- contact (bottom of every page) ---------- */
.contact { padding-top: clamp(96px, 13vw, 200px); border-top: 1px solid var(--line); overflow: hidden; }
.contact__inner { padding-inline: var(--gutter); }
.contact__kicker { font-size: clamp(1.25rem, 1.9vw, 1.5rem); font-weight: 600; margin: 0 0 8px; }
.contact__big { font-size: calc((100vw - 2 * var(--gutter)) / 5.9); line-height: 0.9; letter-spacing: -0.05em; text-transform: uppercase; font-weight: 900; white-space: nowrap; margin-left: -0.03em; }
.contact__big a { text-decoration: none; display: inline-block; background: linear-gradient(100deg, var(--fg) 0 50%, var(--flame) 50%, var(--ember) 100%) no-repeat 0 0 / 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; transition: background-position 0.9s var(--ease); }
.contact__big a:hover, .contact__big a:focus-visible { background-position: 100% 0; }
.contact__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; margin-top: clamp(28px, 4vw, 56px); }
.contact__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.contact__time { margin: 0; color: var(--fg-soft); }
.contact__legal { margin: clamp(56px, 8vw, 104px) 0 0; padding: 0 var(--gutter) 28px; max-width: none; font-size: 0.9375rem; color: var(--fg-soft); }

/* ---------- picture viewer ---------- */
.lightbox { border: 0; padding: 24px; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: rgba(6, 5, 5, 0.96); color: var(--sand); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(6, 5, 5, 0.96); }
.lightbox figure { margin: 0; display: grid; gap: 14px; justify-items: center; }
.lightbox img { max-width: min(1500px, 92vw); max-height: 80dvh; width: auto; height: auto; border-radius: 6px; }
.lightbox figcaption { font-size: 1rem; text-align: center; max-width: 60ch; }
.lightbox__close { position: absolute; top: 18px; right: 18px; font: inherit; font-weight: 700; color: #0b0a09; background: var(--sand); border: 0; border-radius: 999px; padding: 10px 20px; cursor: pointer; }

/* ---------- placeholders that must be replaced before publishing ---------- */
.is-placeholder { opacity: 0.55; }
.todo { display: inline-block; margin: 18px 0 0; padding: 8px 14px; border: 2px dashed var(--ember); border-radius: 8px; font-size: 0.9375rem; font-weight: 600; max-width: 34ch; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .stagger > *, .js .hero__foot, .js .rail.stagger > .card { opacity: 1; transform: none; animation: none; transition: none; }
  .js .mask__in { transform: none; transition: none; }
  .js .wipe img { clip-path: none; transform: none; transition: none; }
  .js .draw .d-line { stroke-dashoffset: 0; transition: none; }
  .js .draw .d-dots, .js .draw .d-wakegroup { opacity: 1; transition: none; }
  .js .draw .d-wake { transform: none; transition: none; }
  .scrub span { color: var(--fg); }
  body { transition: none; }
}
