/* ==========================================================================
   HKS — Harsh Kishor Singh, portfolio
   Tokens → base → layout primitives → sections → responsive
   ========================================================================== */

:root {
  /* Colour */
  --bg:        #08080A;
  --bg-2:      #0B0B0E;
  --card:      #0E0E11;
  --ink:       #F2F0EC;
  --ink-rgb:   242, 240, 236;
  --bg-rgb:    8, 8, 10;
  --accent:    #FF9F1C;   /* also set at runtime by main.js CONFIG.accentColor */

  /* Type */
  --sans:  'Familjen Grotesk', system-ui, -apple-system, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Rhythm */
  --gutter: clamp(20px, 4vw, 64px);
  --radius: 20px;

  /* Rules & washes */
  --line-soft:   rgba(var(--ink-rgb), .1);
  --line-medium: rgba(var(--ink-rgb), .14);
  --line-strong: rgba(var(--ink-rgb), .22);
  --glass:       rgba(var(--bg-rgb), .62);
}

/* ── Base ─────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto; /* Lenis owns smooth scrolling */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
dd { margin-inline-start: 0; }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }

img { display: block; }

::selection { background: var(--accent); color: var(--bg); }
::-webkit-scrollbar { width: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 400;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  color: var(--bg);
}

/* ── Motion keyframes ─────────────────────────────────────────────────── */

@keyframes hksMarquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
@keyframes hksGrain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-6%, 4%); }
  40%  { transform: translate(3%, -7%); }
  60%  { transform: translate(-4%, -3%); }
  80%  { transform: translate(5%, 5%); }
  100% { transform: translate(0, 0); }
}
@keyframes hksPulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: .35; transform: scale(.8); }
}

/* ── Utilities ────────────────────────────────────────────────────────── */

.accent { color: var(--accent); }

.serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}

.section-label,
.eyebrow,
.tag,
.btn,
.project__id,
.project__year {
  font-family: var(--mono);
}

/* ── Shell ────────────────────────────────────────────────────────────── */

.page {
  position: relative;
  background: var(--bg);
  min-height: 100vh;
}

/* ── Preloader ────────────────────────────────────────────────────────── */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: var(--gutter);
}
.no-js .preloader { display: none; }

.preloader__mask { overflow: hidden; }

.preloader__name {
  font-size: clamp(44px, 9vw, 140px);
  font-weight: 700;
  letter-spacing: -.05em;
  line-height: .9;
}

.preloader__meta {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}
.preloader__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .4);
}
.preloader__num {
  font-family: var(--mono);
  font-size: clamp(28px, 4vw, 54px);
  font-weight: 300;
  line-height: .9;
}

/* ── Film grain + custom cursor ───────────────────────────────────────── */

.grain {
  position: fixed;
  inset: -40%;
  z-index: 160;
  pointer-events: none;
  opacity: .055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
  animation: hksGrain 1.4s steps(4) infinite;
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  pointer-events: none;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 999px;
  background: var(--ink);
  mix-blend-mode: difference;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cursor__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bg);
  opacity: 0;
  white-space: nowrap;
  mix-blend-mode: normal;
}

/* ── Navigation ───────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px var(--gutter);
}

.nav__mark {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2em;
  padding: 9px 13px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav__links {
  position: relative;
  display: flex;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(var(--ink-rgb), .05);
  border: 1px solid rgba(var(--ink-rgb), .09);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav__pill {
  position: absolute;
  top: 5px;
  left: 5px;
  height: calc(100% - 10px);
  width: 0;
  border-radius: 999px;
  background: var(--ink);
  opacity: 0;
}
.nav__link {
  position: relative;
  z-index: 1;
  padding: 8px clamp(12px, 1.4vw, 20px);
  font-size: 14px;
  font-weight: 500;
  color: rgba(var(--ink-rgb), .62);
}

.nav__status {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .45);
}
.nav__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  animation: hksPulse 2.4s ease-in-out infinite;
}
.nav__clock { color: rgba(var(--ink-rgb), .28); }

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 130px var(--gutter) clamp(28px, 4vw, 56px);
  overflow: hidden;
}

.hero__reveal {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
}
.hero__canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, rgba(var(--bg-rgb), 0) 30%, rgba(var(--bg-rgb), .55) 100%);
}

.hero__inner {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(24px, 3.4vw, 44px);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .42);
}
.eyebrow__rule {
  width: 34px;
  height: 1px;
  background: rgba(var(--ink-rgb), .3);
}

.hero__title {
  font-size: clamp(30px, 4.9vw, 88px);
  line-height: 1.04;
  font-weight: 400;
  letter-spacing: -.035em;
  max-width: 22em;
  text-wrap: pretty;
}
.line-mask {
  display: block;
  overflow: hidden;
  padding-bottom: .06em;
}
.line { display: block; }
.line--serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.01em;
}
.line--muted  { color: rgba(var(--ink-rgb), .5); }
.line--strong { font-weight: 600; }
.hero__name {
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
}

.hero__hint {
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .35);
}
.hero__hint-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(var(--ink-rgb), .5);
  border-radius: 999px;
}

.hero__foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(36px, 6vw, 90px);
}
.hero__scroll {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .55);
}
.hero__scroll-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(var(--ink-rgb), .2);
  border-radius: 999px;
}
.hero__meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .3);
  text-align: right;
  max-width: 22ch;
  line-height: 1.7;
}

/* ── Marquee ──────────────────────────────────────────────────────────── */

.marquee {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 16px 0;
  overflow: hidden;
  background: var(--bg);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: hksMarquee 34s linear infinite;
}
.marquee__group {
  display: flex;
  align-items: center;
  gap: 42px;
  padding-right: 42px;
  font-family: var(--mono);
  font-size: clamp(11px, 1.1vw, 14px);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .55);
  white-space: nowrap;
}
.marquee__star { color: var(--accent); }

/* ── Work ─────────────────────────────────────────────────────────────── */

.work {
  position: relative;
  z-index: 2;
  background: var(--bg);
  padding: clamp(70px, 9vw, 140px) var(--gutter) clamp(50px, 6vw, 90px);
}

.work__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
}
.section-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .42);
}

.project { padding-top: clamp(28px, 4vw, 54px); }
.project + .project { padding-top: clamp(48px, 7vw, 110px); }

.project__head {
  border-top: 1px solid var(--line-medium);
  padding-top: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.project__id-title {
  display: flex;
  align-items: baseline;
  gap: clamp(12px, 1.6vw, 26px);
}
.project__id {
  font-size: 12px;
  letter-spacing: .14em;
  color: rgba(var(--ink-rgb), .35);
}
.project__title {
  font-size: clamp(30px, 4.6vw, 74px);
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1;
}
.project__year {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .6);
  border: 1px solid rgba(var(--ink-rgb), .18);
  border-radius: 999px;
  padding: 7px 15px;
  white-space: nowrap;
}
.project__desc {
  margin-top: 12px;
  font-size: clamp(15px, 1.4vw, 20px);
  color: rgba(var(--ink-rgb), .55);
  max-width: 46ch;
}
.project__desc--wide { max-width: 52ch; }

/* Project card */

.card {
  display: block;
  position: relative;
  margin-top: clamp(22px, 2.6vw, 38px);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(var(--ink-rgb), .08);
}
.card__clip { overflow: hidden; }
.card__clip--16x9  { aspect-ratio: 16 / 9; }
.card__clip--16x10 { aspect-ratio: 16 / 10; }
.card__clip--16x8  { aspect-ratio: 16 / 8; }

.card__img {
  width: 100%;
  object-fit: cover;
}
.card__clip--16x9  .card__img { height: 118%; transform: translateY(-6%); }
.card__clip--16x10 .card__img { height: 116%; transform: translateY(-5%); }
.card__clip--16x8  .card__img { height: 120%; transform: translateY(-7%); }

.card__tags {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--glass);
  border: 1px solid rgba(var(--ink-rgb), .16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 7px 12px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.card__cta {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: var(--glass);
  border: 1px solid rgba(var(--ink-rgb), .16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
}

/* Two-up project layout (Tana Bana) */

.project__grid {
  display: grid;
  grid-template-columns: 1.55fr .95fr;
  gap: clamp(14px, 1.6vw, 24px);
  align-items: stretch;
  margin-top: clamp(22px, 2.6vw, 38px);
}
.project__grid .card { margin-top: 0; }

.note {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  padding: clamp(18px, 2vw, 28px);
  background: linear-gradient(180deg, rgba(var(--ink-rgb), .04), rgba(var(--ink-rgb), 0));
}
.note__quote {
  font-family: var(--serif);
  font-size: clamp(20px, 2.1vw, 30px);
  line-height: 1.25;
  letter-spacing: -.01em;
  color: rgba(var(--ink-rgb), .9);
}
.note__meta {
  display: grid;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.note__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}
.note__row dt { color: rgba(var(--ink-rgb), .4); }
.note__row dd { color: rgba(var(--ink-rgb), .75); text-align: right; }
.note__row dd.accent { color: var(--accent); }

/* ── About ────────────────────────────────────────────────────────────── */

.about {
  position: relative;
  z-index: 2;
  background: var(--bg-2);
  border-top: 1px solid var(--line-soft);
  padding: clamp(70px, 9vw, 140px) var(--gutter);
}
.about__title {
  font-size: clamp(38px, 7vw, 110px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: .95;
  margin-bottom: clamp(34px, 4.4vw, 64px);
}
.about__grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.about__lede {
  font-size: clamp(19px, 2.1vw, 32px);
  line-height: 1.35;
  letter-spacing: -.02em;
  text-wrap: pretty;
}

.facts {
  display: grid;
  gap: 0;
  margin-top: clamp(34px, 4vw, 58px);
}
.fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(var(--ink-rgb), .12);
  padding: 16px 0;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.fact:last-child { border-bottom: 1px solid rgba(var(--ink-rgb), .12); }
.fact dt { color: rgba(var(--ink-rgb), .4); }
.fact dd { white-space: nowrap; }

.about__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(26px, 3vw, 40px);
}

.btn {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 13px 24px;
  white-space: nowrap;
  transition: background-color .35s ease, color .35s ease, border-color .35s ease;
}
.btn:hover,
.btn:focus-visible {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.portrait {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-soft);
}
.portrait__frame {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg);
}
.portrait__img {
  width: 100%;
  height: 112%;
  object-fit: cover;
  object-position: 52% 28%;
  transform: translateY(-4%);
  filter: grayscale(1) contrast(1.12) brightness(.82);
}
.portrait__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--bg-rgb), .1) 0%, rgba(var(--bg-rgb), .75) 100%);
  mix-blend-mode: multiply;
}
.portrait__caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .8);
}

/* ── Contact ──────────────────────────────────────────────────────────── */

.contact {
  position: relative;
  z-index: 2;
  background: var(--bg);
  border-top: 1px solid var(--line-soft);
  padding: clamp(80px, 11vw, 170px) var(--gutter) clamp(50px, 6vw, 80px);
  text-align: center;
  overflow: hidden;
}
.contact__eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .4);
  margin-bottom: clamp(26px, 3.4vw, 48px);
}
.contact__title {
  font-family: var(--mono);
  font-size: clamp(26px, 6.2vw, 96px);
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.05;
  text-transform: uppercase;
}
.contact__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(10px, 1.2vw, 16px);
  margin-top: clamp(36px, 4.6vw, 70px);
}
.btn--wide {
  min-width: clamp(160px, 18vw, 240px);
  letter-spacing: .18em;
  padding: 17px 28px;
}

.email { overflow: hidden; }
.email__window {
  display: block;
  position: relative;
  height: 1.1em;
  overflow: hidden;
}
.email__swap {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.email__line {
  height: 1.1em;
  line-height: 1.1em;
  white-space: nowrap;
}
.email__line--addr {
  letter-spacing: .06em;
  text-transform: none;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.site-footer {
  position: relative;
  z-index: 2;
  background: var(--bg);
  border-top: 1px solid var(--line-soft);
  padding: 24px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .32);
}
.site-footer a { color: rgba(var(--ink-rgb), .32); }
.site-footer a:hover { color: var(--accent); }

/* ── Responsive & preference queries ──────────────────────────────────── */

@media (max-width: 900px) {
  .hide-sm { display: none !important; }
  .stack   { grid-template-columns: 1fr !important; }
}

@media (hover: none) {
  .pointer-only { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  [data-anim],
  .line {
    opacity: 1 !important;
    transform: none !important;
  }
  .marquee__track,
  .grain,
  .nav__dot {
    animation: none;
  }
  .btn { transition: none; }
}
