/* ————————————————————————————————
   Neshanth Anand — personal site
   Palette: cream #f5f3ed · red #ff1619 · black #000
   Type: Be Vietnam (400/700/800) · Libre Barcode 128
   Sizes/positions measured from the original at 1440px,
   expressed in vw so the layout scales like the original.
   ———————————————————————————————— */

@font-face {
  font-family: "Be Vietnam";
  src: url("/assets/fonts/BeVietnam-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Be Vietnam";
  src: url("/assets/fonts/BeVietnam-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Be Vietnam";
  src: url("/assets/fonts/BeVietnam-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Libre Barcode 128";
  src: url("/assets/fonts/LibreBarcode128.woff2") format("woff2");
  font-weight: 400;
  font-display: block;
}

:root {
  --cream: #f5f3ed;
  /* 1vw at the 1440 reference, frozen above 1440 so sizes go fixed like the original */
  --u: min(1vw, 14.4px);
  --red: #ff1619;
  --ink: #fff;
  --gray: #b8b6b0;
  /* 934px content column at 1440 */
  --measure: calc(var(--u) * 64.9);
  /* base text: 20px at 1440 */
  --fs-body: clamp(0.9375rem, 1.389vw, 1.25rem);
  /* small text: 15px at 1440 */
  --fs-small: clamp(0.75rem, 1.042vw, 0.9375rem);
  /* headings: 50px at 1440 */
  --fs-head: clamp(2rem, 3.472vw, 3.125rem);
  /* annotations: 12px at 1440 */
  --fs-tiny: clamp(0.6875rem, 0.833vw, 0.75rem);
  --line: rgba(255, 255, 255, 0.28);
  --note: rgba(255, 255, 255, 0.68);
  --canvas: #111;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: "Be Vietnam", "Inter", system-ui, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.2;
  letter-spacing: -0.04em;
  overflow-x: hidden;
}

::selection { background: var(--red); color: var(--cream); }

/* ——— video background (experiment: night1) ——— */

.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
html[data-bg="day2"] .bg-video { object-position: 50% 38%; }


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

a { color: inherit; }

section, footer, header.hero { padding-inline: max(1.25rem, calc(50vw - var(--measure) / 2)); }
@media (max-width: 900px) {
  section, footer, header.hero { padding-inline: calc(var(--u) * 5); }
  :root { --measure: calc(var(--u) * 90); }
}

.inner { max-width: var(--measure); margin-inline: auto; }

.mode-btn {
  position: fixed;
  top: calc(var(--u) * 2);
  right: calc(var(--u) * 2);
  z-index: 10;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.mode-btn:hover { color: var(--red); border-color: var(--red); transform: rotate(20deg); }
.mode-btn svg { width: 1.15rem; height: 1.15rem; display: block; }
.mode-btn .icon-moon { display: none; }
html[data-bg="day2"] .mode-btn .icon-sun { display: none; }
html[data-bg="day2"] .mode-btn .icon-moon { display: block; }

/* ——— letter-split animation machinery ———
   Effects measured from the Framer originals:
   drop: opacity 0, y -20px, spring(0.8s, bounce 0.1), 0.1s/char stagger
   spin: opacity 0.4, rotate 45°, spring(0.45s, bounce 0.25), 0.1s/char stagger
   blur: approximation of the heading blur-reveal */

[data-split] .word { display: inline-block; white-space: nowrap; }
[data-split] .ltr { display: inline-block; }

[data-effect="drop"] .ltr {
  transition:
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.js [data-effect="drop"]:not(.in) .ltr {
  opacity: 0;
  transform: translateY(-20px);
}

[data-effect="spin"] .ltr {
  transition:
    transform 0.45s cubic-bezier(0.34, 1.3, 0.4, 1),
    opacity 0.45s cubic-bezier(0.34, 1.3, 0.4, 1);
}
.js [data-effect="spin"]:not(.in) .ltr {
  opacity: 0.4;
  transform: rotate(45deg);
}

[data-reveal] {
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.js [data-reveal]:not(.in) {
  opacity: 0;
  transform: translateY(18px);
}

[data-effect="blur"] .ltr {
  transition: opacity 0.5s ease-out, filter 0.5s ease-out;
}
.js [data-effect="blur"]:not(.in) .ltr {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(10px);
}

/* ——— giant type ——— */

.giant {
  font-weight: 800;
  color: var(--red);
  font-size: calc(var(--u) * 28);
  line-height: 0.755;
  letter-spacing: -0.09em;
  white-space: nowrap;
}

/* ——— hero ——— */

.hero { padding-top: calc(var(--u) * 3.3); }

.hero-name {
  position: relative;
  width: fit-content;
  margin-inline: auto;
  text-align: center;
  font-size: calc(var(--u) * 28);
}
.hero-line { display: block; font-size: inherit; }
.hero-line--back { position: relative; z-index: 1; }
.hero-line--front { position: relative; z-index: 2; }

.hero-portrait {
  position: absolute;
  left: 50%;
  bottom: -0.087em;
  transform: translateX(-50%);
  height: 1.19em;
  width: auto;
  z-index: 3;
  pointer-events: none;
  font-size: calc(var(--u) * 28); /* keep em-based sizing in sync with the letters */
}
.js .hero-portrait { opacity: 0; animation: hero-fade 0.4s ease 0.5s forwards; }

.hero-label {
  position: absolute;
  z-index: 4;
  font-size: var(--fs-head);
  font-weight: 800;
  letter-spacing: -0.09em;
  color: var(--ink);
  line-height: 1.2;
}
.hero-label--web { top: 29.4%; left: 14%; }
.hero-label--designer { top: 29.4%; right: 8%; }
.js .hero-label { opacity: 0; animation: hero-fade 0.4s ease 0.75s forwards; }

@keyframes hero-fade { to { opacity: 1; } }

.carousel {
  position: relative;
  display: block;
  height: 1.2em;
  width: max-content;
  min-width: 1px;
}
.carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transform: translateY(0.3em);
  /* incoming word waits for the outgoing one to clear */
  transition: opacity 0.4s ease 0.3s, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
  white-space: nowrap;
}
.hero-label--designer .carousel-item { left: auto; right: 0; }
.carousel-item.is-active { opacity: 1; transform: none; }
.carousel-item.is-prev { opacity: 0; transform: none; transition: opacity 0.22s ease; }

/* ——— editorial grid (about / hedwig / experience) ——— */

.ed {
  max-width: var(--measure);
  margin-inline: auto;
  border-top: 1px solid var(--line);
}
.ed-row {
  display: grid;
  grid-template-columns: 24.5% 49% 26.5%;
  border-bottom: 1px solid var(--line);
}
.ed-cell {
  padding: calc(var(--u) * 1.7) calc(var(--u) * 2) calc(var(--u) * 3) 0;
  min-width: 0;
}
.ed-cell + .ed-cell {
  border-left: 1px solid var(--line);
  padding-left: calc(var(--u) * 2);
}
.ed-cell p + p { margin-top: 1.2em; }

.ed-note {
  font-size: var(--fs-tiny);
  letter-spacing: 0;
  line-height: 1.5;
  color: var(--note);
}
.ed-note a { text-decoration: none; color: inherit; }
.ed-note a:hover { color: var(--red); }
.ed-note p + p { margin-top: 0.5em; }

.statement {
  font-size: clamp(1.375rem, 2.64vw, 2.375rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.03em;
  text-align: justify;
}
.ed-main-wide { grid-column: 2 / 4; }

.micro-label {
  font-size: var(--fs-tiny);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.5;
}
.hl { color: var(--red); font-weight: 700; }

.sq {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--ink);
  margin-right: 0.9em;
  vertical-align: 0.05em;
}

.sq--red { background: var(--red); }
.micro-label--red { color: var(--red); }
.micro-label + .micro-label { margin-top: 1em; }

.ed-sig { display: flex; align-items: flex-end; justify-content: flex-end; }
.signature {
  width: clamp(6.5rem, 9.7vw, 8.75rem);
  filter: invert(1);
}

/* ——— about ——— */

.about { padding-top: calc(var(--u) * 10.4); }

/* ——— section headings ——— */

.section-head {
  max-width: var(--measure);
  margin-inline: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}
.hedwig .section-head { padding-top: calc(var(--u) * 8); }
.experience .section-head { padding-top: calc(var(--u) * 7.7); }

.section-title {
  font-size: var(--fs-head);
  font-weight: 800;
  color: var(--red);
  letter-spacing: -0.09em;
  line-height: 1.2;
}
.arrow-link {
  max-width: var(--measure);
  margin: calc(var(--u) * 0.55) auto 0;
  font-size: var(--fs-body);
  letter-spacing: normal;
}
.arrow-link a { text-decoration: none; }
.arrow-link a:hover { color: var(--red); }

/* ——— hedwig (currently building) ——— */

.hedwig .ed { margin-top: calc(var(--u) * 3); }

.hedwig-word {
  font-weight: 800;
  color: var(--red);
  font-size: calc(var(--u) * 9.7);
  line-height: 1;
  letter-spacing: -0.06em;
  margin-top: calc(var(--u) * -0.8);
}

/* ——— experience ——— */

.experience .ed { margin-top: calc(var(--u) * 3); }

.ed-row--exp { grid-template-columns: 27% 28% 45%; }
.ed-row--exp h3 {
  font-size: inherit;
  font-weight: 700;
}
.ed-row--headings .ed-cell {
  padding-top: calc(var(--u) * 1.1);
  padding-bottom: calc(var(--u) * 1.1);
}
.ed-what p {
  font-size: var(--fs-small);
  line-height: 1.45;
}

/* ——— footer ——— */

.footer { padding-top: calc(var(--u) * 11.7); padding-bottom: calc(var(--u) * 5.5); }

.footer-top {
  max-width: var(--measure);
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}
.footer-label {
  font-weight: 800;
  font-size: var(--fs-body);
  letter-spacing: normal;
  margin-bottom: calc(var(--u) * 2.8);
}
.footer-follow { text-align: right; }

.ghost-link {
  display: block;
  text-decoration: none;
  font-size: var(--fs-body);
  letter-spacing: normal;
  line-height: 1.2;
}
.ghost-link .ghost {
  display: block;
  color: var(--gray);
  transition: color 0.35s ease;
}
.ghost-link > span { transition: color 0.3s ease; }
.ghost-link:hover > span,
.ghost-link:focus-visible > span { color: var(--red); }

.gh-link { display: inline-block; margin-top: calc(var(--u) * 1); }
.gh-link svg {
  width: clamp(1.25rem, 1.8vw, 1.625rem);
  display: block;
  fill: var(--ink);
  transition: fill 0.3s ease;
}
.gh-link:hover svg,
.gh-link:focus-visible svg { fill: var(--red); }

.footer-bottom {
  max-width: var(--measure);
  margin-inline: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: calc(var(--u) * 0.5);
}
.footer-name { line-height: 0.72; margin-left: calc(var(--u) * -1.8); pointer-events: none; }
.footer-copy {
  font-weight: 800;
  font-size: clamp(1.25rem, 2.778vw, 2.5rem);
  letter-spacing: -0.09em;
  line-height: 1.2;
  margin-bottom: calc(var(--u) * -3.6);
  white-space: nowrap;
}

/* ——— responsive ——— */

@media (max-width: 760px) {
  body { line-height: 1.35; }
  .hero-label--web { left: 0; }
  .hero-label--designer { right: 0; }
  .ed-row,
  .ed-row--exp { grid-template-columns: 1fr; }
  .ed-cell + .ed-cell { border-left: none; padding-left: 0; }
  .ed-cell { padding-bottom: 1.25rem; }
  .ed-cell:empty { display: none; }
  .ed-main-wide { grid-column: auto; }
  .ed-row--headings .ed-cell:not(:first-child) { display: none; }
  .statement { text-align: left; }
  .ed-sig { justify-content: flex-start; padding-top: 0; }
  .hedwig-word { font-size: 4rem; }
  .footer-top { flex-direction: column; gap: 1.5rem; }
  .footer-follow { text-align: left; }
  .footer-label { margin-bottom: 0.75rem; }
  .hedwig .section-head,
  .experience .section-head { padding-top: 4.5rem; }
  .about { padding-top: 4rem; }
  .ed-row--exp { margin-bottom: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-video { display: none; }
  [data-split] .ltr { transition: none; }
  .js [data-effect="drop"]:not(.in) .ltr,
  .js [data-effect="spin"]:not(.in) .ltr,
  .js [data-effect="blur"]:not(.in) .ltr {
    opacity: 1;
    transform: none;
    filter: none;
  }
  .js .hero-portrait,
  .js .hero-label { opacity: 1; animation: none; }
  [data-reveal] { transition: none; }
  .js [data-reveal]:not(.in) { opacity: 1; transform: none; }
  .carousel-item { transition: none; }
}
