/* =========================================================================
   Navaacharan — main.css
   Hand-written, token-driven. Editorial / Anthropic-style.
   Light-led ivory pages with dramatic near-black sections.
   ========================================================================= */

/* ------------------------------------------------------------------ Tokens */
:root {
  --ivory:      #F7F4EE;   /* page background            */
  --ivory-2:    #EFEAE0;   /* alternate section bg       */
  --ink:        #1B1813;   /* primary text on light      */
  --ink-soft:   #5C564C;   /* muted text on light        */
  --black:      #16130F;   /* dark sections (warm)       */
  --black-2:    #211C16;   /* dark cards / elevated      */
  --cream:      #F3EFE7;   /* text on dark               */
  --cream-soft: #b7afa1;   /* muted text on dark         */
  --clay:       #1B1813;   /* accent — black/ink (no orange) */
  --clay-deep:  #000000;   /* accent hover               */
  --line:       rgba(27, 24, 19, .14);   /* hairline on light */
  --line-dark:  rgba(243, 239, 231, .14);/* hairline on dark  */

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --maxw: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 6px;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ------------------------------------------------------------------ Reset  */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

/* ------------------------------------------------------------ Typography   */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 460;
  font-optical-sizing: auto;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

.display {
  font-size: clamp(2.6rem, 6.4vw, 5.1rem);
  font-weight: 420;
}
.h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
.h3 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); }

.eyebrow {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--clay);
  margin: 0 0 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--clay);
  display: inline-block;
}

.lead {
  font-size: clamp(1.1rem, 1.6vw, 1.32rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 34ch;
}
.muted { color: var(--ink-soft); }
em.ital { font-style: italic; }

/* serif italic flourish used inside headlines */
.serif-i { font-style: italic; font-weight: 380; }

/* --------------------------------------------------------------- Layout    */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(4.5rem, 9vw, 8rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }

.section--dark {
  background: var(--black);
  color: var(--cream);
}
.section--dark .lead,
.section--dark .muted { color: var(--cream-soft); }
.section--alt { background: var(--ivory-2); }

.divider { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* generic two-column intro: heading left, copy right */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
@media (min-width: 880px) {
  .split { grid-template-columns: 1.05fr .95fr; }
  .split--center { align-items: center; }
}

/* ---------------------------------------------------------------- Buttons  */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .95rem;
  font-weight: 500;
  padding: .82em 1.5em;
  border-radius: 100px;
  border: 1px solid transparent;
  transition: background .25s var(--ease), color .25s var(--ease),
              border-color .25s var(--ease), transform .25s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn .arw { transition: transform .25s var(--ease); }
.btn:hover .arw { transform: translateX(3px); }

.btn--primary { background: var(--clay); color: #fff; }
.btn--primary:hover { background: var(--clay-deep); }

.btn--dark { background: var(--ink); color: var(--ivory); }
.btn--dark:hover { background: #000; }

.btn--ghost { border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); background: transparent; }

.section--dark .btn--ghost { border-color: var(--line-dark); color: var(--cream); }
.section--dark .btn--ghost:hover { border-color: var(--cream); }

.btn--light { background: var(--ivory); color: var(--ink); }
.btn--light:hover { background: #fff; }

/* text link with growing underline */
.tlink {
  position: relative;
  font-weight: 500;
  color: var(--clay);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.tlink::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.tlink:hover::after { transform: scaleX(1); }
.tlink .arw { transition: transform .25s var(--ease); }
.tlink:hover .arw { transform: translateX(3px); }

/* ----------------------------------------------------------------- Header  */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background .35s var(--ease), border-color .35s var(--ease),
              backdrop-filter .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 1.05rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color .35s var(--ease);
}
.brand .dot { color: var(--clay); }
.brand__logo { display: block; height: 24px; width: auto; }
.site-footer .brand__logo { height: 30px; }
@media (max-width: 860px) { .brand__logo { height: 22px; } }

.nav { display: flex; align-items: center; gap: 2rem; }
.nav__links { display: flex; gap: 1.9rem; }
.nav__links a {
  font-size: .94rem;
  font-weight: 450;
  color: var(--ink);
  opacity: .82;
  position: relative;
  transition: opacity .25s var(--ease), color .35s var(--ease);
}
.nav__links a:hover { opacity: 1; }
.nav__links a.is-active { opacity: 1; }
.nav__links a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1.5px; background: var(--clay);
}

/* scrolled state -> solid ivory, dark text */
.site-header.is-solid {
  background: rgba(247, 244, 238, .86);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom-color: var(--line);
}
.site-header.is-solid .brand,
.site-header.is-solid .nav__links a,
.site-header.is-solid .nav__toggle { color: var(--ink); }

/* mobile toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: 0; padding: 6px;
  color: var(--ink);
}
.nav__toggle span {
  width: 24px; height: 2px; background: currentColor;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
  transform-origin: center;
}

@media (max-width: 860px) {
  .nav__links, .nav .btn { display: none; }
  .nav__toggle { display: flex; position: relative; z-index: 1001; }

  /* full-screen, solid, slide-in overlay */
  .nav__panel {
    position: fixed; inset: 0;
    width: 100%; height: 100vh; height: 100dvh;
    background: var(--ivory);
    color: var(--ink);
    z-index: 1000;
    display: flex; flex-direction: column;
    padding: 1.05rem var(--gutter) calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform .4s var(--ease), opacity .4s var(--ease), visibility .4s var(--ease);
  }
  body.nav-open .nav__panel { transform: none; opacity: 1; visibility: visible; }
  body.nav-open { overflow: hidden; }

  /* top row: logo left, close right (mirrors the header bar) */
  .nav__panel-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: clamp(1.75rem, 7vh, 3.5rem);
  }
  .nav__close {
    background: none; border: 0; color: var(--ink);
    font-size: 2.2rem; line-height: 1; padding: .2rem .4rem; margin-right: -.4rem;
  }

  /* link list, top-aligned */
  .nav__panel-links { display: flex; flex-direction: column; }
  .nav__panel-links a {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 7vw, 1.9rem);
    font-weight: 420;
    padding: .9rem 0;
    border-bottom: 1px solid var(--line);
  }
  .nav__panel-links a:first-child { border-top: 1px solid var(--line); }
  .nav__panel-links a.is-active { color: var(--clay); }

  /* CTA pinned toward the bottom */
  .nav__panel-cta { margin-top: auto; align-self: flex-start; display: inline-flex; }
  .nav__panel-cta:not(:only-child) { margin-top: clamp(2rem, 6vh, 3.5rem); }

  /* hide the hamburger while open — the panel has its own × close button */
  body.nav-open .nav__toggle { opacity: 0; pointer-events: none; }
}
@media (min-width: 861px) { .nav__panel, .nav__close { display: none; } }

/* ------------------------------------------------------------------- Hero  */
.hero {
  background: var(--ivory);
  color: var(--ink);
  padding-top: clamp(8rem, 16vh, 11rem);
  padding-bottom: clamp(4.5rem, 9vw, 7rem);
  position: relative;
  overflow: hidden;
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 70% 20%, #000, transparent 70%);
  mask-image: radial-gradient(circle at 70% 20%, #000, transparent 70%);
  opacity: .5;
  pointer-events: none;
}
.hero__inner { position: relative; }
.hero .display { max-width: 16ch; }
.hero .lead { max-width: 46ch; margin-top: 1.6rem; color: var(--ink-soft); }
.hero__cta { margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: .9rem; }

/* staggered headline reveal — pure CSS, auto-plays under .js (no JS dependency) */
.reveal-line { display: block; overflow: hidden; }
.reveal-line > span { display: block; }
.js .reveal-line > span { animation: nv-rise .9s var(--ease) both; }
.js .reveal-line:nth-child(2) > span { animation-delay: .08s; }
.js .reveal-line:nth-child(3) > span { animation-delay: .16s; }
@keyframes nv-rise { from { transform: translateY(105%); } to { transform: translateY(0); } }

/* metrics row beneath hero */
.hero__metrics {
  position: relative;
  margin-top: clamp(3rem, 7vw, 5rem);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}
.metric .n {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.5vw, 2.7rem);
  font-weight: 440;
  display: block;
}
.metric .l { font-size: .9rem; color: var(--ink-soft); }
@media (max-width: 600px) {
  .hero__metrics { grid-template-columns: 1fr; gap: 1.1rem; }
}

/* ----------------------------------------------------------- Section heads */
.sec-head { max-width: 52ch; margin-bottom: clamp(2.2rem, 5vw, 3.5rem); }
.sec-head .h2 { margin-bottom: 1rem; }

/* ----------------------------------------------------------------- Cards   */
.grid {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 2.6vw, 2.1rem);
  transition: transform .35s var(--ease), border-color .35s var(--ease),
              box-shadow .35s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(27,24,19,.3);
  box-shadow: 0 18px 40px -28px rgba(27,24,19,.5);
}
.section--alt .card { background: #fff; }
.section--dark .card {
  background: var(--black-2);
  border-color: var(--line-dark);
}
.section--dark .card:hover { border-color: rgba(243,239,231,.32); box-shadow: none; }

.card .idx {
  font-family: var(--font-display);
  font-size: .95rem;
  color: var(--clay);
  margin-bottom: 1.1rem;
}
.card h3 { margin-bottom: .65rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: .98rem; }
.section--dark .card p { color: var(--cream-soft); }

.card--link { display: flex; flex-direction: column; }
.card--link .tlink { margin-top: 1.4rem; }

/* numbered approach steps */
.steps { counter-reset: step; display: grid; gap: 0; }
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.2rem, 3vw, 2.5rem);
  padding: clamp(1.6rem, 3vw, 2.2rem) 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.step:last-child { border-bottom: 1px solid var(--line); }
.section--dark .step { border-color: var(--line-dark); }
.step .num {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: var(--clay);
  min-width: 2.5ch;
}
.step h3 { margin-bottom: .5rem; }
.step p { margin: 0; max-width: 60ch; }

/* HTTP pillar list */
.pillars { display: grid; gap: 0; }
.pillar {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.pillar > p { min-width: 0; }
.pillar:last-child { border-bottom: 1px solid var(--line); }
.section--dark .pillar { border-color: var(--line-dark); }
.pillar h3 { font-size: clamp(1.3rem, 2.1vw, 1.65rem); white-space: nowrap; }
.pillar p { margin: 0; }

/* stack heading above text on narrow screens */
@media (max-width: 640px) {
  .pillar { grid-template-columns: 1fr; gap: .4rem; }
  .pillar h3 { white-space: normal; }
}

/* timeline */
.timeline { display: grid; gap: 0; }
.tl-item {
  display: grid;
  grid-template-columns: clamp(5rem, 16%, 8rem) 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  padding: 1.7rem 0;
  border-top: 1px solid var(--line);
}
.tl-item:last-child { border-bottom: 1px solid var(--line); }
.tl-year {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--clay);
}
.tl-item h3 { margin-bottom: .45rem; font-size: 1.25rem; }
.tl-item p { margin: 0; max-width: 60ch; }

/* tech stack columns */
.stack { display: grid; gap: clamp(1.2rem, 3vw, 2rem); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stack__col h4 {
  font-family: var(--font-body);
  font-size: .78rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--line);
}
.section--dark .stack__col h4 { color: var(--cream-soft); border-color: var(--line-dark); }
.stack__col ul { display: flex; flex-direction: column; gap: .55rem; }
.stack__col li { font-size: .98rem; }

/* big quote / statement */
.statement {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: 22ch;
}
.statement .serif-i { color: var(--clay); }

/* mission / vision two-up */
.mv { display: grid; gap: clamp(1rem, 2vw, 1.5rem); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ------------------------------------------------------------- CTA band    */
.cta-band { text-align: center; }
.cta-band .display { max-width: 18ch; margin-inline: auto; }
.cta-band .lead { margin: 1.4rem auto 2.2rem; text-align: center; max-width: 48ch; }
.cta-band__btns { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------------------- Contact     */
.contact-grid {
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: 1fr;
}
@media (min-width: 880px) { .contact-grid { grid-template-columns: .85fr 1.15fr; } }

.contact-detail { padding: 1.3rem 0; border-top: 1px solid var(--line); }
.contact-detail:first-of-type { border-top: 0; }
.contact-detail .k {
  font-size: .78rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: .4rem;
}
.contact-detail .v { font-size: 1.15rem; }
.contact-detail a:hover { color: var(--clay); }

/* form */
.form { display: grid; gap: 1.1rem; }
.form .row { display: grid; gap: 1.1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }
.field label {
  display: block; font-size: .82rem; font-weight: 500;
  margin-bottom: .45rem; color: var(--ink-soft);
}
.field input, .field textarea {
  width: 100%;
  font-family: inherit; font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .8rem .95rem;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(27,24,19,.12);
}
.field textarea { resize: vertical; min-height: 140px; }
.form__note { font-size: .85rem; color: var(--ink-soft); }
.form__status { font-size: .95rem; padding: .2rem 0; min-height: 1.4em; }
.form__status.alert-success { color: #2e7d51; }
.form__status.alert-danger  { color: #b0392a; }

/* ------------------------------------------------------------- Page hero (inner pages) */
.page-hero {
  background: var(--ivory);
  color: var(--ink);
  padding-top: clamp(8rem, 16vh, 11rem);
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
}
.page-hero .display { max-width: 18ch; }
.page-hero .lead { margin-top: 1.4rem; color: var(--ink-soft); }

/* ----------------------------------------------------------------- Footer  */
.site-footer { background: var(--ivory); color: var(--ink); border-top: 1px solid var(--line); }
.site-footer__top {
  display: grid; gap: clamp(2rem, 5vw, 3rem);
  grid-template-columns: 1fr;
  padding-block: clamp(3.5rem, 7vw, 5rem);
}
@media (min-width: 720px) {
  .site-footer__top { grid-template-columns: 1.6fr 1fr 1fr; }
}
.site-footer .brand { color: var(--ink); display: inline-block; margin-bottom: 1.1rem; }
.site-footer p { color: var(--ink-soft); max-width: 38ch; margin: 0; }
.footer-col h4 {
  font-family: var(--font-body);
  font-size: .78rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 1.1rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: .7rem; }
.footer-col a { color: var(--ink); opacity: .82; transition: opacity .2s, color .2s; }
.footer-col a:hover { opacity: 1; color: var(--ink); }
.site-footer__bottom {
  border-top: 1px solid var(--line);
  padding-block: 1.6rem;
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between; align-items: center;
  font-size: .85rem; color: var(--ink-soft);
}
.site-footer__bottom a { color: var(--ink-soft); }
.site-footer__bottom a:hover { color: var(--ink); }
.site-footer__bottom .legal { display: flex; gap: 1.4rem; }

/* ------------------------------------------------------------- Reveal anim */
/* Hidden initial state only applies when JS is active (.js); without JS, content shows. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }
[data-reveal][data-reveal-delay="1"] { transition-delay: .08s; }
[data-reveal][data-reveal-delay="2"] { transition-delay: .16s; }
[data-reveal][data-reveal-delay="3"] { transition-delay: .24s; }
[data-reveal][data-reveal-delay="4"] { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal], .reveal-line > span, .btn, .card, .tlink::after { transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .reveal-line > span, .js .reveal-line > span { animation: none !important; transform: none; }
}

/* ------------------------------------------------------------- Utilities   */
.mt-sm { margin-top: 1rem; }
.mt-md { margin-top: 2rem; }
.center { text-align: center; }
.flow > * + * { margin-top: 1.1rem; }
