/* ============================================================
   ERBERK — liquid chrome on OLED black
   ============================================================ */
:root {
  --bg: #000;
  --fg: #f1f1f1;
  --dim: #8d8d8d;
  --faint: #2a2a2a;
  --rule: rgba(255, 255, 255, 0.12);
  --sans: "Archivo", system-ui, sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --chrome: linear-gradient(180deg, #ffffff 0%, #d6d6d6 30%, #6b6b6b 48%, #1d1d1d 52%, #9a9a9a 62%, #f4f4f4 82%, #8a8a8a 100%);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { color: var(--fg); font-family: var(--sans); font-size: clamp(15px, 0.95rem + 0.15vw, 17px); line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: clip; }
body.is-loading { overflow: hidden; }
/* the page is something you play with: clicks splash the metal, they should never select copy */
body { -webkit-user-select: none; user-select: none; }
input, textarea, .proj__blurb, .contact__foot b { -webkit-user-select: text; user-select: text; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: #fff; color: #000; }
:focus-visible { outline: 1.5px solid #fff; outline-offset: 4px; border-radius: 4px; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.chrome-text { background: var(--chrome); background-size: 100% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.split .line { padding-bottom: 0.06em; margin-bottom: -0.06em; }

/* ------------------------------------------------------------ layers */
#chrome { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; display: block; pointer-events: none; opacity: 0; transition: opacity 0.9s ease; }
#chrome.is-on { opacity: 1; }
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 90; opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.progress { position: fixed; top: 0; left: 0; right: 0; height: 1px; background: #fff; z-index: 120; transform: scaleX(0); transform-origin: 0 50%; }

/* ------------------------------------------------------------ cursor */
.cursor { position: fixed; left: 0; top: 0; z-index: 95; pointer-events: none; }
.cursor__ring {
  position: fixed; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45); display: grid; place-items: center; opacity: 0;
  transition: width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease), background-color 0.35s var(--ease), border-color 0.35s, opacity 0.3s;
}
html.cursor-live .cursor__ring { opacity: 1; }
.cursor__label { font-style: normal; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: #000; opacity: 0; transition: opacity 0.2s; }
.cursor.is-link .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: #fff; }
.cursor.is-label .cursor__ring { width: 78px; height: 78px; margin: -39px 0 0 -39px; background: #fff; border-color: #fff; }
.cursor.is-label .cursor__label { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ------------------------------------------------------------ preloader */
.pre { position: fixed; inset: 0; z-index: 200; background: #000; display: grid; grid-template-rows: auto 1fr auto; padding: var(--gutter); }
.pre__top { display: flex; justify-content: space-between; color: var(--dim); }
.pre__count { align-self: end; font-weight: 200; font-stretch: 125%; font-size: clamp(5rem, 22vw, 20rem); line-height: 0.8; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; overflow: hidden; }
.pre__count span { display: inline-block; }
.pre__bar { height: 1px; background: var(--rule); margin-top: var(--gutter); }
.pre__bar i { display: block; height: 100%; background: #fff; transform-origin: 0 50%; transform: scaleX(0); }

/* ------------------------------------------------------------ nav */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 80; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 1.25rem var(--gutter); }
.nav::before { content: ""; position: absolute; inset: 0 0 -1.5rem 0; z-index: -1; pointer-events: none; background: linear-gradient(to bottom, rgba(0,0,0,0.92), rgba(0,0,0,0.6) 60%, transparent); }
.nav__mark { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; font-stretch: 125%; letter-spacing: -0.03em; font-size: 15px; justify-self: start; }
.nav__logo { width: 26px; height: 26px; transition: transform 0.6s var(--ease); }
.nav__mark:hover .nav__logo { transform: rotate(-12deg) scale(1.08); }
.nav__links { display: flex; gap: 2rem; }
.nav__links a { position: relative; color: var(--dim); transition: color 0.25s; }
.nav__links a:hover { color: #fff; }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px; background: #fff; transform: scaleX(0); transform-origin: right; transition: transform 0.45s var(--ease); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__time { justify-self: end; color: var(--dim); }

section { position: relative; padding: 0 var(--gutter); }
.label { color: var(--dim); margin-bottom: 1.8rem; display: flex; gap: 0.9rem; }
.label b { color: #fff; font-weight: 500; }
.h2 { font-weight: 300; font-stretch: 118%; font-size: clamp(2.4rem, 5.4vw, 5.8rem); line-height: 0.96; letter-spacing: -0.05em; max-width: 16ch; }
.h2 em { font-size: 1.08em; letter-spacing: -0.02em; }

/* ------------------------------------------------------------ hero */
.hero { height: 100svh; min-height: 620px; display: grid; grid-template-rows: auto 1fr auto; padding-top: 5.5rem; padding-bottom: 2rem; }
.hero__meta { display: flex; justify-content: space-between; color: var(--dim); }
.hero__hint { display: flex; align-items: center; gap: 0.6rem; }
.hero__hint::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: ping 1.8s var(--ease) infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.55); } 100% { box-shadow: 0 0 0 12px rgba(255,255,255,0); } }
.hero__name { align-self: end; display: grid; font-weight: 800; font-stretch: 125%; font-size: clamp(4rem, 15.5vw, 17.5rem); line-height: 0.82; letter-spacing: -0.065em; margin: 0 0 1.6rem -0.05em; pointer-events: none; }
.hero__name .line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.hero__name .line--b { font-weight: 300; font-style: italic; }
.hero__name .char { display: inline-block; }
.hero__name .line--b .char { background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__foot { display: flex; justify-content: space-between; align-items: end; gap: 2rem; border-top: 1px solid var(--rule); padding-top: 1.2rem; }
.hero__sub { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.35rem); line-height: 1.35; color: #cfcfcf; }
.hero__cta { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 1.4rem; border: 1px solid rgba(255,255,255,0.3); border-radius: 999px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s; }
.btn:hover { border-color: #fff; }
.btn--solid { background: #fff; color: #000; border-color: #fff; }
.btn--solid:hover { background: #cfcfcf; border-color: #cfcfcf; }

/* ------------------------------------------------------------ impact */
.impact { padding-top: 22vh; padding-bottom: 14vh; }
.impact .h2 { margin-bottom: 4.5rem; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem 3rem; max-width: 56%; }
.stat { border-top: 1px solid var(--rule); padding-top: 1.1rem; }
.stat .n { display: block; font-weight: 200; font-stretch: 125%; font-size: clamp(3rem, 5.6vw, 6rem); line-height: 0.9; letter-spacing: -0.06em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat .lbl { display: block; margin-top: 0.9rem; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.5; max-width: 30ch; }
.stat .det { margin-top: 0.6rem; color: var(--dim); font-size: 14px; max-width: 36ch; }

/* the heatmap sits beneath the canvas, so the metal flows over it rather than behind it */
.gh { margin-top: 6rem; border-top: 1px solid var(--rule); padding-top: 1.6rem; position: relative; z-index: -2; }
.gh__head { display: flex; justify-content: space-between; gap: 1rem; color: var(--dim); margin-bottom: 1.4rem; }
.gh__head a:hover { color: #fff; }
.gh__grid { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; width: 100%; aspect-ratio: 53 / 7; max-height: 190px; }
.gh-cell { background: #121212; border-radius: 2px; transition: transform 0.2s var(--ease); }
.gh-cell:hover { transform: scale(1.7); position: relative; z-index: 2; }
.gh-cell.l1, .gh__legend .s1 { background: #3a3a3a; }
.gh-cell.l2, .gh__legend .s2 { background: #737373; }
.gh-cell.l3, .gh__legend .s3 { background: #b5b5b5; }
.gh-cell.l4, .gh__legend .s4 { background: linear-gradient(160deg, #fff, #a8a8a8); }
.gh__legend { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.2rem; color: var(--dim); flex-wrap: wrap; }
.gh__legend .sw { width: 12px; height: 12px; border-radius: 2px; }
.gh__legend .s0 { background: #121212; }
.gh__stat { margin-left: auto; display: flex; align-items: baseline; gap: 0.5rem; }
.gh__total { margin-left: 2rem; }
.gh__stat b { color: #fff; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 24px; letter-spacing: -0.01em; text-transform: none; }

/* ------------------------------------------------------------ work */
.work { padding-top: 22vh; padding-bottom: 12vh; }
.work__head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin: 0 0 3rem auto; max-width: 60%; flex-wrap: wrap; }
.work > .label { justify-content: flex-end; }
.work__filter { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.work__filter button { padding: 0.55rem 0.9rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--dim); font: inherit; transition: color 0.25s, border-color 0.25s, background-color 0.25s; }
.work__filter button:hover { color: #fff; border-color: rgba(255,255,255,0.4); }
.work__filter button[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; }
.work__list { list-style: none; max-width: 60%; margin-left: auto; border-top: 1px solid var(--rule); }
.proj { border-bottom: 1px solid var(--rule); }
.proj[hidden] { display: none; }
.proj__btn { width: 100%; display: grid; grid-template-columns: 3rem 1fr auto; align-items: baseline; gap: 1rem; padding: 1.25rem 0; text-align: left; }
.proj__num { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--dim); }
.proj__name { font-weight: 700; font-stretch: 122%; font-size: clamp(1.7rem, 3.2vw, 3.2rem); letter-spacing: -0.05em; line-height: 1; transition: transform 0.6s var(--ease), color 0.3s; color: #cfcfcf; }
.proj__name em { font-weight: 400; font-size: 1.1em; }
.proj__tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); text-align: right; }
.proj__btn:hover .proj__name, .proj.is-open .proj__name { transform: translateX(0.8rem); color: #fff; }
.proj.is-open .proj__name em, .proj__btn:hover .proj__name em { background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.06em; }
.proj__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.6s var(--ease); }
.proj.is-open .proj__body { grid-template-rows: 1fr; }
.proj__inner { overflow: hidden; padding-left: 4rem; }
.proj__inner > div { padding: 0 0 1.6rem; display: grid; gap: 1rem; max-width: 60ch; }
.proj__blurb { color: #c9c9c9; }
.proj__stack { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; }
.proj__stack li { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; border: 1px solid var(--rule); border-radius: 999px; padding: 0.35rem 0.7rem; color: var(--dim); }
.proj__link { justify-self: start; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,0.4); padding-bottom: 2px; }
.proj__link:hover { border-color: #fff; }

/* ------------------------------------------------------------ journey */
.journey { padding-top: 22vh; padding-bottom: 12vh; }
.journey__head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.6rem; margin-bottom: 3.5rem; max-width: 58%; }
.journey__intro { color: var(--dim); max-width: 46ch; }
.rows { max-width: 58%; border-top: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: 11rem 1fr; gap: 0.6rem 2rem; padding: 1.8rem 0; border-bottom: 1px solid var(--rule); transition: opacity 0.5s var(--ease); }
.rows.has-active .row { opacity: 0.38; }
.rows.has-active .row.is-active { opacity: 1; }
.row__when { color: var(--dim); padding-top: 0.5rem; }
.row__title { font-weight: 400; font-family: var(--serif); font-style: italic; font-size: clamp(1.5rem, 2.2vw, 2.1rem); line-height: 1.1; letter-spacing: -0.01em; }
.row__title span { display: block; font-family: var(--mono); font-style: normal; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-top: 0.5rem; }
.row__note { grid-column: 2; color: var(--dim); font-size: 15px; max-width: 58ch; }
.row__note ul { list-style: none; margin-top: 0.8rem; display: grid; gap: 0.45rem; }
.row__note li { position: relative; padding-left: 1.3rem; }
.row__note li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 0.7rem; height: 1px; background: #fff; }

/* ------------------------------------------------------------ contact */
.contact { min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; gap: 2.5rem; padding-top: 8rem; padding-bottom: 2rem; }
.contact__top { display: flex; justify-content: space-between; color: var(--dim); }
.contact__top b { color: #fff; font-weight: 500; margin-right: 0.6rem; }
.contact__headline { align-self: center; font-weight: 300; font-stretch: 118%; font-size: clamp(3.2rem, 9.5vw, 10rem); line-height: 0.9; letter-spacing: -0.055em; }
.contact__headline .line { display: block; overflow: hidden; padding-bottom: 0.05em; }
.contact__headline em { font-size: 1.08em; }
.say { display: inline-block; margin-top: 0.15em; font-weight: 800; font-stretch: 125%; padding-right: 0.08em; }
.contact__foot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem; border-top: 1px solid var(--rule); padding-top: 1.6rem; }
.contact__foot .col { color: var(--dim); }
.contact__foot .col b { display: block; margin-top: 0.4rem; color: #fff; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 21px; letter-spacing: 0; text-transform: none; overflow-wrap: anywhere; }
.contact__foot .col a { border-bottom: 1px solid var(--rule); transition: border-color 0.25s; }
.contact__foot .col a:hover { border-color: #fff; }

/* ------------------------------------------------------------ mail popup */
.mail-pop { position: fixed; inset: 0; z-index: 300; pointer-events: none; opacity: 0; transition: opacity 0.3s ease; }
.mail-pop.open { opacity: 1; pointer-events: auto; }
.mail-pop__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.mail-pop__card { position: absolute; right: 2rem; bottom: 2rem; width: min(440px, calc(100vw - 2rem)); background: #0a0a0a; border: 1px solid var(--rule); border-radius: 16px; padding: 1.7rem; transform: translateY(20px) scale(0.98); transition: transform 0.35s var(--ease); box-shadow: 0 30px 80px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.08); }
.mail-pop.open .mail-pop__card { transform: none; }
.mail-pop__head { display: flex; justify-content: space-between; align-items: center; color: var(--dim); margin-bottom: 1rem; }
.mail-pop__x { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--rule); color: var(--dim); font-size: 20px; line-height: 1; display: grid; place-items: center; transition: color 0.2s, border-color 0.2s; }
.mail-pop__x:hover { color: #fff; border-color: #fff; }
.mail-pop__title { font-weight: 300; font-stretch: 115%; font-size: 30px; letter-spacing: -0.04em; margin-bottom: 1.2rem; }
.mail-pop__form { display: grid; gap: 0.9rem; }
.mail-pop__form label { display: grid; gap: 0.4rem; }
.mail-pop__form label > span { font-size: 9px; color: var(--dim); }
.mail-pop__form input, .mail-pop__form textarea { background: rgba(255,255,255,0.04); border: 1px solid var(--rule); border-radius: 8px; padding: 0.7rem 0.8rem; color: #fff; font: 400 14px/1.4 var(--sans); resize: vertical; transition: border-color 0.2s; }
.mail-pop__form input:focus, .mail-pop__form textarea:focus { outline: none; border-color: #fff; }
.mail-pop__form ::placeholder { color: #4a4a4a; }
.mail-pop__foot { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; margin-top: 0.4rem; }
.mail-pop__status { flex: 1; min-width: 0; color: var(--dim); font-size: 10px; }
.mail-pop__status.ok { color: #fff; }
.mail-pop__status.err { text-transform: none; letter-spacing: 0.02em; color: #ff8f8f; }
.mail-pop__status a { text-decoration: underline; text-underline-offset: 3px; }
.mail-pop__send { background: #fff; color: #000; border-radius: 8px; padding: 0.75rem 1.1rem; font-weight: 600; transition: background-color 0.2s; }
.mail-pop__send:hover { background: #cfcfcf; }
.mail-pop__send:disabled { opacity: 0.5; cursor: wait; }

/* ------------------------------------------------------------ fallback */
/* No usable GPU (or one too slow to carry the shader): the hero keeps a still of the mark. */
html.no-gl #chrome { display: none; }
html.no-gl .hero__hint { display: none; }
@media (min-width: 861px) {
  html.no-gl .hero { background: url("metal-still.webp") no-repeat left 61.5vw top 19svh / 30.9vw auto; }
}

/* ------------------------------------------------------------ mobile */
@media (max-width: 860px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav__links { display: none; }
  .hero__meta { flex-direction: column; gap: 0.4rem; }
  .hero__name { font-size: clamp(3.6rem, 21vw, 7rem); }
  .hero__foot { flex-direction: column; align-items: flex-start; }
  .stats, .work__head, .work__list, .journey__head, .rows { max-width: none; }
  .work > .label { justify-content: flex-start; }
  .stats { grid-template-columns: 1fr 1fr; gap: 2rem 1.2rem; }
  .stat .det { display: none; }
  .impact, .work, .journey { padding-top: 46vh; }
  .gh__head { flex-direction: column; gap: 0.4rem; }
  .gh__grid { gap: 1.5px; }
  .gh__stat, .gh__total { margin-left: 0; width: 100%; }
  .proj__btn { grid-template-columns: 2.2rem 1fr; }
  .proj__tag { grid-column: 2; text-align: left; }
  .proj__inner { padding-left: 3.2rem; }
  .row { grid-template-columns: 1fr; }
  .row__note { grid-column: 1; }
  .contact__foot { grid-template-columns: 1fr 1fr; }
  .mail-pop__card { right: 0.75rem; left: 0.75rem; bottom: 0.75rem; width: auto; }
}
@media (max-width: 480px) {
  .contact__foot { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
