/* ================================================================
   Akshay Kondala — base.css
   Shared design system for landing / engineering / creative.
   Tokens · fonts · reset · grain · cursor · nav · buttons · reveal ·
   contact · footer · responsive.
   ================================================================ */

/* ---------- Fonts (self-hosted, variable, latin subset) ---------- */
@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/syne-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
  --bg:      #080808;
  --bg2:     #0d0d0d;
  --card:    #101010;
  --card2:   #141414;
  --text:    #f0f0f0;
  --mid:     #909090;
  --muted:   #5c5c5c;
  --border:  rgba(255,255,255,0.06);
  --border2: rgba(255,255,255,0.11);

  --red:       #e8192c;
  --red-rgb:   232,25,44;
  --amber:     #f0a03c;
  --amber-rgb: 240,160,60;

  /* mode accent — engineering by default */
  --accent:     var(--red);
  --accent-rgb: var(--red-rgb);
  --accent-ink: #ffffff;          /* text on top of solid accent */
  --other:      var(--amber);     /* the *other* mode's colour */
  --other-rgb:  var(--amber-rgb);

  --font-h: 'Syne', 'Helvetica Neue', Arial, sans-serif;
  --font-b: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-m: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io:  cubic-bezier(0.65, 0, 0.35, 1);
  --gutter:   10vw;
  --nav-h:    68px;
}

[data-mode="creative"] {
  --accent:     var(--amber);
  --accent-rgb: var(--amber-rgb);
  --accent-ink: #140c02;
  --other:      var(--red);
  --other-rgb:  var(--red-rgb);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }

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

.mono { font-family: var(--font-m); font-variant-numeric: tabular-nums; }
.r  { color: var(--red); }
.a  { color: var(--amber); }
.ac { color: var(--accent); }

.skip {
  position: fixed; top: -100px; left: 1rem; z-index: 10000;
  background: var(--accent); color: var(--accent-ink);
  padding: .6rem 1rem; border-radius: 3px; font-size: .8rem; font-weight: 600;
}
.skip:focus { top: 1rem; }

/* Page enter / leave (only when JS is present) */
.js body { animation: page-in .55s var(--ease-out) both; }
body.is-leaving { animation: page-out .32s var(--ease-io) both; pointer-events: none; }
@keyframes page-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes page-out { from { opacity: 1; } to { opacity: 0; } }

/* ---------- Grain (static; compositor-animated on creative) ---------- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

/* ---------- Custom cursor (fine pointers only) ---------- */
.cursor-dot, .cursor-ring { display: none; }

@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  body a, body button, body [data-hover] { cursor: none; }

  .cursor-dot, .cursor-ring {
    display: block;
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    border-radius: 50%;
    will-change: transform;
  }
  .cursor-dot {
    width: 7px; height: 7px;
    background: var(--accent);
    z-index: 9999;
    transform: translate3d(-100px,-100px,0);
    transition: width .2s, height .2s, background .3s;
  }
  .cursor-ring {
    width: 34px; height: 34px;
    border: 1px solid rgba(var(--accent-rgb), 0.5);
    z-index: 9998;
    transform: translate3d(-100px,-100px,0);
    transition: width .35s var(--ease-out), height .35s var(--ease-out), border-color .3s, opacity .3s;
  }
  body.is-hovering .cursor-ring { width: 58px; height: 58px; border-color: var(--accent); }
  body.is-hovering .cursor-dot  { width: 11px; height: 11px; }
  body.is-pressing .cursor-ring { width: 26px; height: 26px; }
  body.cursor-hidden .cursor-dot, body.cursor-hidden .cursor-ring { opacity: 0; }
}

/* ---------- Nav (sub-pages) ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 8000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 5vw;
  border-bottom: 1px solid transparent;
  transition: background .35s, border-color .35s, transform .45s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(8,8,8,0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.nav.is-hidden { transform: translateY(-110%); }

.nav-logo {
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  white-space: nowrap;
}
.nav-logo small {
  font-family: var(--font-m);
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
}
.nav-logo:hover small { color: var(--text); }

.mode-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--border2);
  border-radius: 999px;
  background: rgba(8,8,8,0.6);
}
.mode-opt {
  font-family: var(--font-m);
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .42rem .9rem;
  border-radius: 999px;
  color: var(--muted);
  transition: color .2s, background .25s, box-shadow .25s;
  white-space: nowrap;
}
.mode-opt[data-mode="engineering"]:hover { color: var(--red); }
.mode-opt[data-mode="creative"]:hover    { color: var(--amber); }
.mode-opt.is-active[data-mode="engineering"] { background: var(--red);   color: #fff;    box-shadow: 0 0 18px rgba(var(--red-rgb), .35); }
.mode-opt.is-active[data-mode="creative"]    { background: var(--amber); color: #140c02; box-shadow: 0 0 18px rgba(var(--amber-rgb), .35); }

.nav-links { display: flex; gap: 2.1rem; }
.nav-links a {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.is-current { color: var(--text); }

.nav-ext { display: flex; gap: .6rem; align-items: center; }
.nav-ext-link {
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: .32rem .7rem;
  white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.nav-ext-link:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), .5); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.9rem;
  border-radius: 3px;
  font-family: var(--font-b);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1;
  transition: transform .25s var(--ease-out), box-shadow .25s, background .2s, color .2s, border-color .2s;
}
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(var(--accent-rgb), .35); }
.btn-ghost { border: 1px solid var(--border2); color: var(--mid); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }
.btn-other { border: 1px solid rgba(var(--other-rgb), .5); color: var(--other); }
.btn-other:hover { background: var(--other); color: #0b0b0b; transform: translateY(-3px); }

/* ---------- Layout + section furniture ---------- */
.wrap { padding-inline: var(--gutter); }
section[id] { scroll-margin-top: calc(var(--nav-h) - 6px); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 7.5rem var(--gutter) 3rem;
}
.section-label {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-label i {
  font-style: normal;
  font-family: var(--font-m);
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .1em;
}
.section-label::after {
  content: '';
  display: block;
  width: 50px; height: 1px;
  background: var(--accent);
  opacity: .45;
}
.section-note {
  font-family: var(--font-m);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.cv { content-visibility: auto; contain-intrinsic-size: auto 900px; }

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .75s var(--ease-out), transform .85s var(--ease-out);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translateX(-18px); }
[data-reveal="right"] { transform: translateX(18px); }
[data-reveal="scale"] { transform: scale(.96); }
[data-reveal="fade"]  { transform: none; }
[data-reveal].in { opacity: 1; transform: none; will-change: auto; }

/* ---------- Mode cross-link band ---------- */
.mode-cta {
  margin: 8rem var(--gutter) 0;
  padding: 3.2rem 3rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  background: linear-gradient(120deg, var(--card) 0%, rgba(var(--other-rgb), .05) 100%);
}
.mode-cta::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--other));
}
.mode-cta-eyebrow {
  font-family: var(--font-m);
  font-size: .62rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .6rem;
}
.mode-cta-title {
  font-family: var(--font-h);
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.mode-cta-title em { font-style: normal; color: var(--other); }
.mode-cta-sub { color: var(--mid); font-size: .9rem; margin-top: .5rem; max-width: 46ch; }

/* ---------- Contact + footer ---------- */
.contact-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 9rem var(--gutter) 4.5rem;
  margin-top: 6rem;
  border-top: 1px solid var(--border);
  min-height: 70vh;
  position: relative;
}
.contact-section::before {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 34%; height: 220px;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), .13) 0%, transparent 70%);
  pointer-events: none;
}
.contact-eyebrow {
  font-size: .66rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.contact-heading {
  font-family: var(--font-h);
  font-size: clamp(3.2rem, 9vw, 8.5rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  margin-bottom: 2rem;
}
.contact-email {
  display: inline-block;
  font-size: 1.05rem;
  color: var(--mid);
  border-bottom: 1px solid var(--border2);
  padding-bottom: .25rem;
  margin-bottom: 3rem;
  transition: color .2s, border-color .2s;
}
.contact-email:hover { color: var(--accent); border-color: var(--accent); }
.contact-links { display: flex; gap: 2.4rem; flex-wrap: wrap; justify-content: center; }
.contact-links a {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .2s;
}
.contact-links a:hover { color: var(--accent); }

.site-footer {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 5rem;
  font-size: .66rem;
  color: var(--muted);
  letter-spacing: .06em;
  font-family: var(--font-m);
}
.site-footer a:hover { color: var(--text); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  :root { --gutter: 7vw; }
  .nav-ext { display: none; }
}

@media (max-width: 900px) {
  .nav { padding: 0 5vw; gap: 1rem; }
  .nav-links { display: none; }
  .mode-cta { flex-direction: column; align-items: flex-start; padding: 2.4rem 1.8rem; }
  .contact-heading { font-size: clamp(3rem, 14vw, 5rem); }
}

@media (max-width: 560px) {
  :root { --gutter: 6vw; --nav-h: 60px; }
  .nav-logo small { display: none; }
  .mode-opt { padding: .4rem .7rem; font-size: .58rem; }
  .section-head { padding: 5.5rem var(--gutter) 2.2rem; flex-direction: column; align-items: flex-start; gap: .8rem; }
  .section-note { white-space: normal; }
  .contact-section { padding: 6rem var(--gutter) 3.5rem; min-height: 60vh; }
  .contact-email { font-size: .9rem; word-break: break-all; }
  .contact-links { gap: 1.4rem; }
  .site-footer { gap: 1rem; flex-direction: column; align-items: center; }
  .mode-cta { margin-top: 5rem; }
}
