/* ==========================================================
   Tokens — monochrome editorial, two small accents
   ========================================================== */
:root {
  --ink: #0A0A0A;
  --paper: #F2F0EA;
  --muted-dark: #8F8C85;   /* on ink: ~6.3:1 */
  --muted-light: #5E5B55;  /* on paper: ~6.2:1 */
  --rule-dark: #262626;
  --sun: #F2B53A;          /* the lit-up words */
  --stem: #5BBF5A;         /* the green stem */

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter Tight", system-ui, -apple-system, sans-serif;

  --gutter: clamp(16px, 3vw, 40px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* house style: every bit of text on the site is lowercase */
  text-transform: lowercase;
}
a { color: inherit; text-decoration: none; }
em { font-style: italic; }
img, svg { display: block; }

.label {
  margin: 0;
  font-size: 13px;
  color: var(--muted-light);
}
.label--light { color: var(--muted-dark); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ==========================================================
   Cursor
   ========================================================== */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 100;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), opacity .3s;
  opacity: 0;
}
.cursor.is-on { opacity: 1; }
.cursor.is-on.is-hidden { opacity: 0; }
/* over links the dot becomes a thin ring, so it never inverts what's underneath */
.cursor.is-big {
  width: 64px; height: 64px; margin: -32px 0 0 -32px;
  background: transparent;
  border: 1.5px solid #fff;
}
@media (pointer: coarse) { .cursor { display: none; } }

/* ==========================================================
   Nav — poster corner labels
   ========================================================== */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: var(--gutter);
  padding: 20px var(--gutter);
  color: #fff;
  mix-blend-mode: difference;
  font-size: 13px;
  line-height: 1.3;
}
.nav p { margin: 0; }
.nav__links { display: flex; gap: 18px; grid-column: -2; }
.nav__links a { position: relative; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
@media (max-width: 860px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav__col { display: none; }
}

/* ==========================================================
   Hero
   ========================================================== */
.hero {
  position: relative;
  height: 100vh; height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: var(--ink);
}
.hero__portrait {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.35) brightness(.8);
}
.hero__rings {
  position: absolute; inset: -6%;
  width: 112%; height: 112%;
}
/* rings dissolve into the paper colour of the next section */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14%;
  z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(242,240,234,0) 0%, rgba(242,240,234,.55) 45%, var(--paper) 100%);
}
.hero__title, .hero__foot { z-index: 2; }
.hero__rings circle { fill: none; stroke: var(--paper); }
.hero__grain {
  position: absolute; inset: 0; pointer-events: none;
  opacity: .14; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero__title {
  position: absolute;
  left: var(--gutter); bottom: calc(var(--gutter) + 28px);
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(5.5rem, 21vw, 22rem);
  line-height: .8;
  letter-spacing: -.035em;
  color: #fff;
  mix-blend-mode: difference;
  text-transform: none; /* the one exception to the all-lowercase rule */
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero__title .line > span {
  display: inline-block;
  transform: translateY(105%);
  animation: rise 1.3s var(--ease) forwards;
}
.hero__title .line:nth-child(2) > span { animation-delay: .12s; padding-left: .5em; }
@keyframes rise { to { transform: none; } }

.hero__foot {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 18px;
  display: flex; justify-content: space-between; gap: 16px;
  margin: 0; font-size: 13px; color: #fff; mix-blend-mode: difference;
}
.hero__foot > span:last-child { text-align: right; }
/* phones: role on top, location under it; drop the scroll hint */
@media (max-width: 700px) {
  .hero__foot { flex-direction: column; gap: 4px; }
  .hero__foot > span:last-child { text-align: left; }
  .hero__scroll { display: none; }
  .hero__title { bottom: calc(var(--gutter) + 64px); }  /* clear the two-line foot */
}

/* ==========================================================
   Type wall
   ========================================================== */
.wall {
  background: var(--paper);
  color: var(--ink);
  padding: clamp(64px, 10vw, 140px) 0 clamp(40px, 6vw, 80px);
}
.wall > .label { padding: 0 var(--gutter); margin-bottom: 24px; }
.wall__rows { display: flex; flex-direction: column; }
.wall__row {
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: clamp(3.6rem, 12.5vw, 13rem);
  line-height: .98;
  /* extra room below for descenders (g, p, y), pulled back so row spacing stays tight */
  padding-bottom: .2em;
  margin-bottom: -.2em;
  letter-spacing: -.025em;
  transition: background .5s var(--ease), color .5s var(--ease);
}
.wall__row:hover { background: var(--ink); color: var(--paper); }
.wall__track { display: inline-block; will-change: transform; }
.wall__track > span { padding-right: .32em; }

/* ==========================================================
   About — shaped text bloom
   ========================================================== */
.about {
  position: relative;
  padding: clamp(72px, 10vw, 140px) var(--gutter) clamp(72px, 9vw, 120px);
  background: var(--ink);
}
/* facts: one quiet strip under the flower, hairline above */
.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px clamp(36px, 6vw, 88px);
  max-width: 1100px;
  margin: clamp(64px, 8vw, 110px) auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--rule-dark);
  text-align: center;
}
.fact dt { font-size: 12px; color: var(--muted-dark); margin-bottom: 6px; }
.fact dd { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.2; white-space: nowrap; }
.cv-link { color: var(--sun); transition: color .3s; }
.cv-link:hover { color: var(--stem); }

.bloom {
  position: relative;
  margin: 48px auto 0;
  width: 100%;
  max-width: 620px;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(15px, 1.75vw, 22px);
  line-height: 1.2;
  color: var(--paper);
}
.bloom__line { display: block; }
/* reveal uses `translate`; the scatter physics owns `transform` */
.bloom__word {
  display: inline-block;
  margin: 0 .14em;
  opacity: .12;
  translate: 0 .3em;
  transition: opacity .7s var(--ease), translate .7s var(--ease), color .3s;
  will-change: transform;
}
.bloom.is-in .bloom__word { opacity: 1; translate: 0 0; }
.bloom__word--sun { color: var(--sun); font-style: italic; }
.bloom__word:hover { color: var(--sun); }
.bloom__stem {
  display: flex; flex-direction: column; align-items: center;
  margin-top: .4em;
  font-family: var(--sans);
  font-size: .8em;
  line-height: 1.05;
  color: var(--stem);
}
.bloom__stem span {
  display: inline-block;
  will-change: transform;
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.bloom.is-in .bloom__stem span { opacity: 1; }

/* ==========================================================
   Work index
   ========================================================== */
.work {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  padding: clamp(72px, 10vw, 140px) var(--gutter);
}
.work__head { display: flex; justify-content: space-between; margin-bottom: 28px; }
.work__list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--ink); }
.project {
  display: grid;
  grid-template-columns: 40px 56px 1fr auto 64px;
  align-items: baseline;
  gap: var(--gutter);
  padding: 18px 0 14px;
  border-top: 1px solid var(--ink);
  transition: opacity .4s var(--ease);
}
.project__num, .project__meta, .project__year { font-size: 13px; }
.project__logo {
  width: 56px; height: 56px;
  align-self: center;
  transition: transform .6s var(--ease);
}
.project:hover .project__logo { transform: rotate(-8deg) scale(1.08); }
/* phones: the row crossing the middle of the screen gets the hover look */
.work__list.has-active .project { opacity: .28; }
.work__list.has-active .project.is-active { opacity: 1; }
.project.is-active .project__logo { transform: rotate(-8deg) scale(1.12); }
.project.is-active .project__title { transform: translateX(.18em); }
.project:not([href]) { cursor: default; }
.project__meta { color: var(--muted-light); }
.project__year { text-align: right; }
.project__title {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7.5vw, 7rem);
  line-height: .95;
  letter-spacing: -.025em;
  transition: transform .6s var(--ease);
}
.work__list:hover .project { opacity: .28; }
.work__list .project:hover,
.work__list .project:focus-visible { opacity: 1; }
.project:hover .project__title { transform: translateX(.18em); }
.project:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
@media (max-width: 700px) {
  .project { grid-template-columns: 44px 1fr; row-gap: 6px; }
  .project__num { display: none; }
  .project__logo { width: 44px; height: 44px; }
  .project__meta { grid-column: 2; }
  .project__year { display: none; }
}

.preview {
  position: fixed; top: 0; left: 0; z-index: 40;
  width: 280px; height: 350px;
  margin: -175px 0 0 0;
  pointer-events: none;
  overflow: hidden;
  transform: scale(0);
  transition: transform .45s var(--ease);
}
.preview.is-on { transform: scale(1); }
.preview svg { width: 100%; height: 100%; }
.preview__rings circle { stroke: var(--tone, var(--sun)); stroke-width: 22; }
.preview__logo {
  position: absolute; left: 50%; top: 50%;
  width: 128px; height: 128px;
  margin: -64px 0 0 -64px;
  object-fit: contain;
}
.preview__logo.is-wordmark {
  width: 200px; height: 84px; margin: -42px 0 0 -100px;
  padding: 10px 16px;
  background: #0A0A0A; border-radius: 18px;
}
.preview__label {
  position: absolute; left: 14px; bottom: 12px;
  font-size: 12px; color: #fff;
}
@media (pointer: coarse) { .preview { display: none; } }

/* ==========================================================
   Contact
   ========================================================== */
.contact {
  padding: clamp(80px, 12vw, 160px) var(--gutter) clamp(64px, 8vw, 110px);
  background: var(--ink);
}
.contact__title {
  margin: 32px 0 48px;
  font-family: var(--serif);
  font-weight: 400;
  --title-size: clamp(3.2rem, 10vw, 10.5rem);
  font-size: var(--title-size);
  line-height: .9;
  letter-spacing: -.03em;
}
.contact__title em { color: var(--sun); }

/* english / malayalam swap: both sit in the same grid cell and crossfade line by line */
.contact__title { display: grid; cursor: default; }
.contact__en, .contact__ml { grid-area: 1 / 1; align-self: start; }
.contact__title .l {
  display: block;
  width: fit-content;   /* each line's hover area hugs its words */
  transition: opacity .55s var(--ease), translate .55s var(--ease), filter .55s var(--ease);
}
.contact__title .l:nth-child(2) { transition-delay: .06s; }
.contact__title .l:nth-child(3) { transition-delay: .12s; }
@font-face {
  font-family: "FML Aswathi";
  src: url("assets/fonts/fml-tt-aswathi-bold.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
.contact__ml {
  font-family: "FML Aswathi";
  /* same size as the english; on narrow phones it shrinks just enough that the
     longest malayalam line still fits on one line */
  font-size: min(var(--title-size), calc((100vw - 2 * var(--gutter)) / 8.2));
  white-space: nowrap;
  /* line pitch and tracking always taken from the english size, so lines stay aligned */
  line-height: calc(var(--title-size) * .9);
  letter-spacing: calc(var(--title-size) * -.03);
  /* legacy font: the exact Latin letters pick the glyphs, so never change their case */
  text-transform: none;
}
.contact__ml em { font-style: normal; }
.contact__ml .l { opacity: 0; translate: 0 .35em; filter: blur(6px); }
/* only hovering the english words themselves flips it (the malayalam layer ignores the pointer) */
.contact__ml { pointer-events: none; }
.contact__title:has(.contact__en .l:hover) .contact__en .l,
.contact__title.is-ml .contact__en .l { opacity: 0; translate: 0 -.25em; filter: blur(6px); }
.contact__title:has(.contact__en .l:hover) .contact__ml .l,
.contact__title.is-ml .contact__ml .l { opacity: 1; translate: 0 0; filter: none; }
.contact__mail {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 3.2rem);
  border-bottom: 1px solid currentColor;
  transition: color .3s;
}
.contact__mail:hover { color: var(--stem); }
.contact__mail em { color: var(--sun); }
/* ==========================================================
   DVD-bounce social doodles — drift inside the contact section
   ========================================================== */
.contact { position: relative; overflow: hidden; }
/* the arena: the empty right side of the section, clear of the heading and email */
.bounce {
  position: absolute; top: 0; bottom: 0; right: 0; left: 48%;
  pointer-events: none; z-index: 3;
}
/* JS sets `left` to just past the text; when there's no room beside it (phones)
   the arena becomes a band under the email instead */
.contact.is-stacked { padding-bottom: 220px; }
.contact.is-stacked .bounce { top: auto; left: 0 !important; height: 200px; bottom: 10px; }
.bounce ul { list-style: none; margin: 0; padding: 0; }
.bounce li { position: absolute; top: 0; left: 0; will-change: transform; }
.bounce a {
  pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  width: 84px; height: 84px;
  color: var(--paper);
  transition: color .45s var(--ease), scale .4s var(--ease);
}
.bounce a:hover { scale: 1.15; }
.bounce a:focus-visible { outline: 2px dashed var(--sun); outline-offset: 2px; border-radius: 50%; }
.doodle {
  width: 64px; height: 64px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#scribble);
}
.bounce a:hover .doodle { filter: url(#scribble-boil); }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 18px var(--gutter);
  border-top: 1px solid var(--rule-dark);
  font-size: 12px;
  color: var(--muted-dark);
}
.footer a:hover { color: var(--paper); }

/* Scroll reveals */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ==========================================================
   Reduced motion
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .reveal, .bloom__word, .bloom__stem span { opacity: 1; transform: none; translate: none; }
}
