/* BuildWithNik — ring portfolio. Tokens first, then hero, then sections. */
:root {
  --bg: #f4f3f1;
  --fg: #121212;
  --mute: #5e5e5b;
  --line: rgba(18, 18, 18, .16);
  --green: #12c23a;
  --pad: clamp(20px, 2.8vw, 40px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --display: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'DM Mono', ui-monospace, Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.4 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font: 400 12px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--fg); color: #fff; padding: 12px 16px; border-radius: 6px; transition: top .2s; }
.skip:focus { top: 12px; }

/* ---------- preloader ---------- */
.pre { position: fixed; inset: 0; z-index: 120; background: var(--bg); display: flex; flex-direction: column; justify-content: space-between; padding: 28px var(--pad) 8px; transition: transform .95s var(--ease-io); }
.pre__id { display: flex; flex-direction: column; font: 500 15px/1.25 var(--display); letter-spacing: -.01em; }
.pre__id h3 { font: inherit; margin: 0; }
.pre__id h3:not(:first-child) { color: var(--mute); }
.pre__count { font: 500 clamp(140px, 26vw, 400px)/.78 var(--display); letter-spacing: -.07em; display: flex; align-items: flex-start; font-variant-numeric: tabular-nums; transition: transform .95s var(--ease-io); }
.pre__count i { font-style: normal; font-size: .28em; letter-spacing: 0; margin: .12em 0 0 .1em; }
.pre.done { transform: translateY(-100%); }
.pre.done .pre__count { transform: translateY(40%); }
.pre.gone { display: none; }

/* ---------- header ---------- */
.top { position: fixed; z-index: 70; left: 0; right: 0; top: 0; height: 128px; padding: 0 var(--pad); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; transition: height .45s var(--ease), background-color .45s, backdrop-filter .45s; }
.top.compact { height: 72px; background: rgba(244, 243, 241, .78); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.top__name { font: 500 20px/1 var(--display); letter-spacing: -.02em; justify-self: start; padding: 12px 0; }
.status { justify-self: center; font: 500 17px/1 var(--display); letter-spacing: -.015em; white-space: nowrap; }
.status__win { width: clamp(150px, 15vw, 210px); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); }
.status__track { display: flex; width: max-content; animation: marq 22s linear infinite; }
.status__track span { flex: none; }
.status em { font-style: normal; color: var(--green); }
.status .dot { font-weight: 400; margin: 0 .15em; }
.status__static { display: none; }
@keyframes marq { to { transform: translateX(-25%); } }
.burger { justify-self: end; width: 60px; height: 60px; border-radius: 50%; background: #858582; display: grid; place-content: center; gap: 7px; transition: background-color .3s, transform .45s var(--ease), width .45s var(--ease), height .45s var(--ease); }
.burger i { display: block; width: 28px; height: 2px; background: #fff; transition: transform .45s var(--ease); }
.top.compact .burger { width: 48px; height: 48px; gap: 6px; }
.burger:hover { background: #121212; transform: scale(1.06); }
.burger[aria-expanded="true"] { background: #121212; }
.burger[aria-expanded="true"] i:first-child { transform: translateY(4.5px) rotate(20deg); }
.burger[aria-expanded="true"] i:last-child { transform: translateY(-4.5px) rotate(-20deg); }
.burger:focus-visible { outline-offset: 4px; }

/* ---------- menu ---------- */
.menu { position: fixed; inset: 0; z-index: 60; background: var(--bg); padding: 130px var(--pad) 32px; display: flex; flex-direction: column; justify-content: space-between; clip-path: inset(0 0 100% 0); transition: clip-path .7s var(--ease-io); }
.menu.is-open { clip-path: inset(0); }
.menu ul { display: grid; }
.menu li { overflow: hidden; border-top: 1px solid var(--line); }
.menu li:last-child { border-bottom: 1px solid var(--line); }
.menu a { display: flex; align-items: baseline; gap: 20px; font: 500 clamp(56px, 11vw, 168px)/1.02 var(--display); letter-spacing: -.05em; transform: translateY(105%); transition: transform .8s var(--ease), padding .4s var(--ease); padding: .05em 0; }
.menu.is-open a { transform: none; }
.menu.is-open li:nth-child(2) a { transition-delay: .06s; } .menu.is-open li:nth-child(3) a { transition-delay: .12s; } .menu.is-open li:nth-child(4) a { transition-delay: .18s; }
.menu a span { font: 400 12px/1 var(--mono); letter-spacing: .04em; color: var(--mute); }
.menu a:hover { padding-left: 24px; }
.menu__foot { display: flex; flex-wrap: wrap; gap: 8px 32px; font: 400 14px/1.4 var(--body); color: var(--mute); padding-top: 24px; }
.menu__foot a { color: var(--fg); padding: 10px 0; }

/* ---------- hero ---------- */
.hero { position: relative; height: 100svh; min-height: 620px; overflow: hidden; background: var(--bg); }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; will-change: transform; outline-offset: -6px; -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); -webkit-tap-highlight-color: transparent; }
.hero canvas.drag { cursor: grabbing; }
.hero canvas.hot { cursor: pointer; }
.hint { position: absolute; left: 0; right: 0; bottom: 78px; display: flex; justify-content: center; align-items: center; gap: 14px; font: 400 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); pointer-events: none; opacity: 0; transition: opacity .8s .6s; }
.is-ready .hint { opacity: 1; }
.hint__line { width: 48px; height: 1px; background: currentColor; opacity: .5; }
.foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; padding: 0 var(--pad) 14px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font: 400 13px/1 var(--body); letter-spacing: -.005em; }
.foot__l, .foot__r { display: flex; align-items: center; gap: 4px 18px; }
.foot a, .foot button { min-height: 44px; display: inline-flex; align-items: center; padding: 0 2px; }
.foot__clock { display: inline-flex; gap: 8px; margin-right: 56px; font-variant-numeric: tabular-nums; }
.snd { font: 400 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; margin-right: 18px; color: var(--mute); }
.snd[aria-pressed="true"] { color: var(--fg); }
.snd::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; border: 1px solid currentColor; margin-right: 8px; }
.snd[aria-pressed="true"]::before { background: var(--green); border-color: var(--green); }
.foot a:hover, .foot button:hover { text-decoration: underline; text-underline-offset: 3px; }
.tag { position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none; display: flex; flex-direction: column; gap: 4px; background: var(--fg); color: #fff; padding: 10px 14px 11px; border-radius: 6px; opacity: 0; transition: opacity .25s; white-space: nowrap; }
.tag.on { opacity: 1; }
.tag b { font: 500 15px/1 var(--display); letter-spacing: -.01em; }
.tag span { font: 400 11px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; opacity: .7; }
.no-webgl .hero { display: grid; place-items: center; }
.hero__fallback { display: none; }
.no-webgl .hero__fallback { display: flex; gap: 12px; overflow-x: auto; padding: 0 var(--pad); max-width: 100%; }
.hero__fallback button { flex: none; width: 160px; }
.hero__fallback img { width: 160px; height: 133px; object-fit: cover; border-radius: 4px; }

/* ---------- sections ---------- */
.sec { padding: clamp(72px, 11vw, 168px) var(--pad); position: relative; }
.sec__head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: clamp(32px, 5vw, 72px); }
.sec__head h2 { font: 500 clamp(52px, 9vw, 144px)/.9 var(--display); letter-spacing: -.055em; }
.sec__head .mono { color: var(--mute); text-align: right; }
.rv { }
.js .rv { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .rv.in { opacity: 1; transform: none; }

/* index */
.index { padding-top: clamp(96px, 14vw, 200px); }
.list { border-bottom: 1px solid var(--line); }
.row { width: 100%; display: grid; grid-template-columns: 56px minmax(0, 1.5fr) minmax(0, 1fr) 64px 28px; align-items: center; gap: 16px; padding: clamp(14px, 1.6vw, 24px) 0; border-top: 1px solid var(--line); text-align: left; transition: opacity .35s; min-height: 44px; }
.row__n { font: 400 12px/1 var(--mono); letter-spacing: .04em; color: var(--mute); }
.row__t { font: 500 clamp(26px, 4.6vw, 72px)/1 var(--display); letter-spacing: -.04em; transition: transform .55s var(--ease); }
.row__c { font: 400 14px/1.3 var(--body); color: var(--mute); }
.row__y { font: 400 12px/1 var(--mono); letter-spacing: .04em; text-align: right; }
.row__a { font-size: 20px; text-align: right; transform: translateX(-8px); opacity: 0; transition: transform .4s var(--ease), opacity .3s; }
.row__th { display: none; }
@media (hover: hover) {
  .list:hover .row { opacity: .28; }
  .list .row:hover, .list .row:focus-visible { opacity: 1; }
  .row:hover .row__t, .row:focus-visible .row__t { transform: translateX(18px); }
  .row:hover .row__a, .row:focus-visible .row__a { transform: none; opacity: 1; }
}
.peek { position: fixed; left: 0; top: 0; z-index: 20; width: 320px; height: 267px; pointer-events: none; opacity: 0; transform: scale(.8); transition: opacity .3s, scale .45s var(--ease); scale: .85; border-radius: 4px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .35); }
.peek.on { opacity: 1; scale: 1; }
.peek img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: none) { .peek { display: none; } }

/* about */
.about__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: start; }
.about__lead { grid-column: 1 / span 8; font: 500 clamp(26px, 3.6vw, 56px)/1.1 var(--display); letter-spacing: -.03em; }
.about__lead .w { opacity: var(--o, .16); transition: opacity .25s linear; }
.about__fig { grid-column: 10 / span 3; }
.about__fig img { width: 100%; aspect-ratio: 9 / 11; object-fit: cover; border-radius: 4px; background: #e4e3df; }
.about__fig figcaption { margin-top: 12px; color: var(--mute); }
.cols { margin-top: clamp(64px, 9vw, 130px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; border-top: 1px solid var(--line); padding-top: 28px; }
.cols h3 { color: var(--mute); margin-bottom: 18px; font-weight: 400; }
.cols li { font: 500 clamp(18px, 1.6vw, 24px)/1.25 var(--display); letter-spacing: -.02em; padding: 3px 0; }

/* archives */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: clamp(48px, 7vw, 100px); }
.stats b { display: block; font: 500 clamp(72px, 13vw, 220px)/.85 var(--display); letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.stats span { display: block; margin-top: 14px; color: var(--mute); font: 400 14px/1.3 var(--body); }
.exp li { display: grid; grid-template-columns: 1fr 2fr 1.4fr; gap: 16px; align-items: baseline; padding: 22px 0; border-top: 1px solid var(--line); }
.exp li:last-child { border-bottom: 1px solid var(--line); }
.exp .y { font: 400 12px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.exp .r { font: 500 clamp(20px, 2.4vw, 36px)/1.1 var(--display); letter-spacing: -.03em; }
.exp .p { color: var(--mute); }

/* contact */
.contact { background: #121212; color: var(--bg); min-height: 92svh; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.contact :focus-visible { outline-color: #fff; }
.contact > .mono { color: rgba(244, 243, 241, .66); }
.contact h2 { font: 500 clamp(54px, 10vw, 168px)/.88 var(--display); letter-spacing: -.055em; max-width: 11ch; }
.contact__row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; }
.mail { font: 500 clamp(22px, 4.6vw, 76px)/1.1 var(--display); letter-spacing: -.04em; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat; padding-bottom: 4px; transition: background-size .5s var(--ease); word-break: break-word; }
.mail:hover { background-size: 0 2px; background-position: 100% 100%; }
.copy { min-height: 48px; padding: 0 22px; border: 1px solid rgba(244, 243, 241, .4); border-radius: 999px; font: 400 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; transition: background-color .3s, color .3s; }
.copy:hover { background: var(--bg); color: var(--fg); }
.contact__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; border-top: 1px solid rgba(244, 243, 241, .2); padding-top: 12px; }
.contact__foot ul { display: flex; flex-wrap: wrap; gap: 0 24px; }
.contact__foot a { display: inline-flex; align-items: center; min-height: 44px; }
.contact__foot a:hover { text-decoration: underline; text-underline-offset: 4px; }
.contact__foot p { color: rgba(244, 243, 241, .66); }

/* project view */
.view { position: fixed; inset: 0; z-index: 90; background: var(--bg); overflow-y: auto; padding: 104px var(--pad) 40px; opacity: 0; transition: opacity .45s var(--ease); overscroll-behavior: contain; }
.view.is-open { opacity: 1; }
.view__close { position: fixed; z-index: 3; top: 24px; right: var(--pad); min-height: 52px; padding: 0 24px; border-radius: 999px; background: var(--fg); color: #fff; display: inline-flex; align-items: center; gap: 12px; font: 500 15px/1 var(--display); transition: transform .3s var(--ease); }
.view__close:hover { transform: scale(1.05); }
.view__close kbd { font: 400 11px/1 var(--mono); opacity: .6; border: 1px solid rgba(255, 255, 255, .4); border-radius: 4px; padding: 3px 5px; }
.view__inner { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(24px, 4vw, 64px); align-items: end; min-height: calc(100svh - 150px); }
.view__media { overflow: hidden; border-radius: 4px; background: #e4e3df; align-self: center; will-change: transform; transform-origin: 50% 50%; }
.view__media img { width: 100%; height: auto; max-height: calc(100svh - 150px); aspect-ratio: 6 / 5; object-fit: cover; }
.view__info { display: flex; flex-direction: column; gap: 22px; padding-bottom: 8px; }
.view__count { color: var(--mute); }
.view__info h2 { font: 500 clamp(40px, 5.4vw, 92px)/.92 var(--display); letter-spacing: -.05em; }
.view__lead { font: 400 clamp(16px, 1.3vw, 19px)/1.5 var(--body); max-width: 40ch; color: #2a2a28; }
.view__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.view__meta dt { color: var(--mute); margin-bottom: 6px; }
.view__meta dd { font: 500 17px/1.2 var(--display); letter-spacing: -.01em; }
.view__nav { display: flex; gap: 12px; }
.view__nav button { min-height: 48px; padding: 0 22px; border: 1px solid var(--line); border-radius: 999px; font: 500 15px/1 var(--display); transition: background-color .3s, color .3s; }
.view__nav button:hover { background: var(--fg); color: #fff; }
.view__info > * { opacity: 0; transform: translateY(18px); }
.view.is-open .view__info > * { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(.25s + var(--i, 0) * 70ms); }

.toast { position: fixed; z-index: 150; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--fg); color: #fff; padding: 12px 18px; border-radius: 999px; font: 400 12px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .about__lead { grid-column: 1 / -1; }
  .about__fig { grid-column: 1 / span 7; margin-top: 24px; }
  .view__inner { grid-template-columns: 1fr; align-items: start; min-height: 0; }
  .view__media img { max-height: 52svh; }
}
@media (max-width: 767px) {
  .top { height: 76px; grid-template-columns: 1fr auto; }
  .top.compact { height: 64px; }
  .status { display: none; }
  .top__name { font-size: 19px; }
  .burger, .top.compact .burger { width: 48px; height: 48px; gap: 6px; }
  .burger i { width: 24px; }
  .hero { min-height: 560px; }
  .hint { bottom: 92px; }
  .foot { flex-wrap: wrap; row-gap: 0; padding-bottom: 6px; }
  .foot__l { width: 100%; justify-content: space-between; }
  .foot__clock { margin-right: 0; }
  .foot__copy, .foot__l a { display: none; }
  .foot__r { width: 100%; justify-content: space-between; border-top: 1px solid var(--line); }
  .foot__r .snd { margin-right: 0; }
  .sec__head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .sec__head .mono { text-align: left; }
  .row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px 12px; }
  .row__c, .row__a { display: none; }
  .row__c { grid-column: 2; }
  .row__y { grid-column: 3; grid-row: 1; }
  .row__t { font-size: clamp(26px, 8vw, 40px); }
  .about__fig { grid-column: 1 / -1; }
  .cols, .stats { grid-template-columns: 1fr; }
  .stats { gap: 36px; }
  .exp li { grid-template-columns: 1fr; gap: 6px; }
  .view { padding-top: 92px; }
  .view__close { top: 14px; min-height: 48px; padding: 0 18px; }
  .view__close kbd { display: none; }
  .menu { padding-top: 104px; }
}
/* active status: the live site's marquee window stays narrow on tablets */
@media (max-width: 1000px) and (min-width: 768px) { .status__win { width: 150px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .status__win { -webkit-mask-image: none; mask-image: none; width: auto; }
  .status__track { display: none; }
  .status__static { display: inline; }
  .js .rv { opacity: 1; transform: none; }
  .about__lead .w { --o: 1 !important; }
  .view__info > * { opacity: 1; transform: none; }
}
