/* ============================================================
   Aman Malhotra · portfolio
   Instrument-panel aesthetic: ink + phosphor amber + signal cyan
   ============================================================ */

:root {
  --ink:        #0B0E14;
  --ink-2:      #0E121B;
  --panel:      #11161F;
  --panel-2:    #141A25;
  --line:       #1E2532;
  --line-2:     #2A3342;
  --text:       #E7EBF3;
  --muted:      #8B95A7;
  --muted-2:    #5C6678;
  --amber:      #FFB454;   /* phosphor / signature (fills) */
  --amber-deep: #E2934A;
  --cyan:       #5BE0D0;   /* live signal (fills) */

  /* accent colors used as TEXT (need enough contrast on the page bg) */
  --amber-text: #FFB454;
  --cyan-text:  #5BE0D0;

  /* themed surfaces */
  --grid-line:  rgba(255,255,255,.012);
  --topbar-bg:  rgba(11,14,20,.72);
  --card-grad:  linear-gradient(180deg, var(--panel), var(--ink-2));

  --display: 'Space Grotesk', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;
  --body:    'Inter', system-ui, sans-serif;

  --maxw: 1180px;
  --pad:  clamp(20px, 5vw, 64px);
}

/* ---------- light theme ---------- */
:root[data-theme="light"] {
  --ink:        #E7E9ED;   /* softer than pure white to cut glare */
  --ink-2:      #DDE1E7;
  --panel:      #F4F6F8;   /* cards sit slightly lighter than the page */
  --panel-2:    #E9ECF1;
  --line:       #CFD5DD;
  --line-2:     #B7BFCB;
  --text:       #0E151D;   /* near-black for strong contrast */
  --muted:      #444E5C;
  --muted-2:    #707B8A;
  --amber-deep: #A85B00;

  --amber-text: #8A5000;
  --cyan-text:  #0A6F7C;

  --grid-line:  rgba(20,27,36,.04);
  --topbar-bg:  rgba(231,233,237,.85);
  --card-grad:  linear-gradient(180deg, var(--panel), var(--panel-2));
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* faint instrument grid */
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  transition: background-color .3s ease, color .3s ease;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--amber); color: #0B0E14; }

/* ---------- light-theme component overrides ---------- */
/* the scope reads as a real instrument screen: keep it dark in both themes */
:root[data-theme="light"] .scope__frame {
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255,180,84,.06), transparent 60%),
    #0E121B;
  border-color: #2A3342;
  box-shadow: 0 24px 60px -38px rgba(20,27,36,.45), inset 0 0 0 1px rgba(255,255,255,.03);
}
:root[data-theme="light"] .scope__head { color: #5C6678; }
:root[data-theme="light"] .scope__axis span { color: #5C6678; }
:root[data-theme="light"] .section--metrics {
  background:
    radial-gradient(80% 140% at 50% 0%, rgba(255,180,84,.05), transparent 55%),
    var(--ink-2);
}
:root[data-theme="light"] .marquee { background: var(--panel-2); }
:root[data-theme="light"] .chips li { background: var(--ink); }

/* ---------- theme toggle button ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}
.theme-toggle:hover { color: var(--amber-text); border-color: var(--amber); }
.theme-toggle svg { width: 16px; height: 16px; display: block; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ---------- shared bits ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .22em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .6em;
}

/* hero tagline spans the full hero width as one line on desktop */
.hero__eyebrow {
  grid-column: 1 / -1;
  margin-bottom: 6px;
}
@media (min-width: 901px) {
  .hero__eyebrow {
    white-space: nowrap;
    font-size: min(0.72rem, 1vw);
    letter-spacing: 0.12em;
  }
}
.eyebrow--center { justify-content: center; }
.eyebrow__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(255,180,84,.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,180,84,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(255,180,84,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,180,84,0); }
}

.hl { color: var(--amber-text); }
.hl--cyan { color: var(--cyan-text); }

.btn {
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: .04em;
  padding: .85em 1.4em;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.btn--solid {
  background: var(--amber);
  color: #0B0E14;
  font-weight: 700;
}
.btn--solid:hover { transform: translateY(-2px); background: #ffc070; }
.btn--ghost {
  border: 1px solid var(--line-2);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--amber); color: var(--amber-text); }
.btn--big { font-size: 1rem; padding: 1.1em 1.8em; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--pad);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.mark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .02em;
}
.mark__sig { color: var(--amber-text); }
.mark__cursor { color: var(--cyan-text); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 30px); }
.nav a {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
  transition: color .18s ease;
}
.nav a:hover { color: var(--text); }
.nav__cta {
  color: var(--amber-text) !important;
  border: 1px solid var(--line-2);
  padding: .5em .9em;
  border-radius: 2px;
  transition: border-color .18s ease;
}
.nav__cta:hover { border-color: var(--amber); }
@media (max-width: 720px) {
  .nav a:not(.nav__cta) { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 9vh, 110px) var(--pad) clamp(40px, 7vh, 80px);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  column-gap: clamp(32px, 5vw, 72px);
  row-gap: 10px;
  align-items: center;
}
.hero__copy { align-self: start; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
}

.hero__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(3.6rem, 11vw, 7.4rem);
  line-height: .92;
  letter-spacing: -.03em;
  margin: 4px 0 26px;
}
.hero__thesis {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  line-height: 1.4;
  letter-spacing: -.01em;
  max-width: 34ch;
}
.hero__sub {
  color: var(--muted);
  margin: 20px 0 26px;
  max-width: 46ch;
}
.hero__stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  margin: 0 0 32px;
}
.hero__stats li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  padding-left: 16px;
}
.hero__stats li::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 2px;
  background: var(--amber);
  border-radius: 2px;
}
.hero__stat-num {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.7rem;
  letter-spacing: -.02em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.hero__stat-lbl {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.hero__links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 30px;
}
.hero__links a {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
  position: relative;
  transition: color .18s ease;
}
.hero__links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--amber);
  transition: width .25s ease;
}
.hero__links a:hover { color: var(--text); }
.hero__links a:hover::after { width: 100%; }

/* social icon links */
.socials { gap: 16px; align-items: center; }
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--muted);
  transition: color .18s ease, border-color .18s ease, transform .18s ease, background .18s ease;
}
.social-link svg { width: 17px; height: 17px; display: block; }
.social-link::after { display: none; }
.social-link:hover {
  color: var(--amber-text);
  border-color: var(--amber);
  transform: translateY(-2px);
}

/* ---------- the signature: signal scope ---------- */
.scope { width: 100%; }
.scope__frame {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255,180,84,.05), transparent 60%),
    var(--ink-2);
  padding: 14px;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,.9), inset 0 0 0 1px rgba(255,255,255,.02);
}
.scope__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .18em;
  color: var(--muted-2);
  margin-bottom: 10px;
}
.scope__label { color: var(--amber); }
.scope__lat { color: var(--cyan); }
#waveform {
  display: block;
  width: 100%;
  height: 300px;
  border-radius: 3px;
}
.scope__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding: 0 2px;
  overflow: hidden;
}
.scope__axis span {
  font-family: var(--mono);
  font-size: .58rem;
  letter-spacing: .08em;
  color: var(--muted-2);
  position: relative;
  padding-top: 10px;
}
.scope__axis span::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 1px; height: 5px;
  background: var(--line-2);
  transform: translateX(-50%);
}
.scope__axis span.is-on { color: var(--cyan); }
.scope__axis span.is-on::before { background: var(--cyan); }

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 16px 0;
  background: var(--ink-2);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 22px;
  animation: scroll 38s linear infinite;
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--text);
}
.marquee__track i { color: var(--amber-text); font-style: normal; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(64px, 12vh, 130px) var(--pad);
}
.section__head { margin-bottom: clamp(36px, 6vh, 64px); }
.section__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -.025em;
  line-height: 1.04;
  margin-top: 16px;
}

/* ---------- expertise panels ---------- */
.panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 860px) { .panels { grid-template-columns: 1fr; } }

.panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card-grad);
  padding: 28px 26px 30px;
  position: relative;
  overflow: hidden;
  transition: border-color .25s ease, transform .25s ease;
}
.panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--amber), transparent 70%);
  opacity: 0;
  transition: opacity .25s ease;
}
.panel:hover { border-color: var(--line-2); transform: translateY(-4px); }
.panel:hover::before { opacity: 1; }
.panel__idx {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .2em;
  color: var(--amber-text);
}
.panel__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: -.01em;
  margin: 16px 0 12px;
}
.panel__body { color: var(--muted); font-size: .94rem; }
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}
.tags li {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .03em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: .35em .6em;
  border-radius: 2px;
}

/* ---------- timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 8px; }

.entry {
  display: grid;
  grid-template-columns: 32px 240px 1fr;
  gap: 0 26px;
  padding: 34px 0;
  border-top: 1px solid var(--line);
}
.entry:last-child { border-bottom: 1px solid var(--line); }

.entry__spine { position: relative; display: flex; justify-content: center; }
.entry__spine::before {
  content: '';
  position: absolute;
  top: 6px; bottom: -40px; left: 50%;
  width: 1px;
  background: linear-gradient(var(--line-2), transparent);
  transform: translateX(-50%);
}
.entry:last-child .entry__spine::before { display: none; }
.entry__node {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--amber);
  margin-top: 4px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 14px rgba(255,180,84,.5);
}

.entry__when {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .04em;
  color: var(--muted);
}
.entry__role {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -.02em;
  margin: 8px 0 2px;
}
.entry__org {
  font-family: var(--mono);
  color: var(--amber-text);
  font-size: .9rem;
}
.entry__org a {
  position: relative;
  transition: color .18s ease;
}
.entry__org a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -3px;
  width: 0; height: 1px;
  background: var(--amber);
  transition: width .25s ease;
}
.entry__org a:hover { color: var(--amber-text); }
.entry__org a:hover::after { width: 100%; }
.entry__tag {
  color: var(--muted-2);
  font-size: .82rem;
  margin-top: 8px;
}

.bullets { list-style: none; display: flex; flex-direction: column; gap: 13px; }
.bullets li {
  position: relative;
  padding-left: 24px;
  color: var(--muted);
  font-size: .95rem;
}
.bullets li::before {
  content: '▸';
  position: absolute;
  left: 0; top: 0;
  color: var(--amber-deep);
  font-size: .8rem;
}
.bullets strong { color: var(--text); font-weight: 600; }

@media (max-width: 820px) {
  .entry {
    grid-template-columns: 22px 1fr;
    column-gap: 18px;
  }
  .entry__spine { grid-row: 1 / span 2; }
  .entry__meta { grid-column: 2; margin-bottom: 18px; }
  .entry__body { grid-column: 2; }
  .entry__spine::before { top: 6px; bottom: -40px; }
  .entry__role { font-size: 1.3rem; }
}

/* ---------- phones ---------- */
@media (max-width: 600px) {
  /* the live scope is the desktop hero's signature; on phones it only adds height */
  .scope { display: none; }
}
@media (max-width: 560px) {
  .hero { padding-top: clamp(36px, 7vh, 64px); }
  .hero__title { font-size: clamp(3rem, 16vw, 4.4rem); }
  .hero__actions { width: 100%; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
  #waveform { height: 200px; }
  .scope__frame { padding: 12px; }
  .scope__axis span { font-size: .5rem; letter-spacing: .02em; padding-top: 8px; }
  .section { padding-top: clamp(48px, 8vh, 80px); padding-bottom: clamp(48px, 8vh, 80px); }
  .panel { padding: 24px 20px 26px; }
  .stackgroup { padding: 20px 18px; }
  .metric { padding: 26px 20px; }
}

/* ---------- metrics ---------- */
.section--metrics {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(80% 140% at 50% 0%, rgba(255,180,84,.04), transparent 55%),
    var(--ink-2);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (max-width: 760px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .metrics { grid-template-columns: 1fr; } }
.metric {
  background: var(--ink);
  padding: 34px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.metric__val {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--amber-text);
  font-variant-numeric: tabular-nums;
}
.metric__val--text { color: var(--cyan-text); }
.metric__label {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .04em;
  color: var(--muted);
}

/* ---------- stack grid ---------- */
.stackgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 860px) { .stackgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stackgrid { grid-template-columns: 1fr; } }
.stackgroup {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  padding: 22px 22px 24px;
  transition: border-color .25s ease;
}
.stackgroup:hover { border-color: var(--line-2); }
.stackgroup__name {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.05rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.stackgroup__name::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--amber);
  border-radius: 1px;
}
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--muted);
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: .4em .7em;
  border-radius: 2px;
  transition: color .18s ease, border-color .18s ease;
}
.chips li:hover { color: var(--amber-text); border-color: var(--amber-deep); }

/* ---------- contact ---------- */
.contact { text-align: center; }
.contact .eyebrow { margin-bottom: 24px; }
.contact__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  letter-spacing: -.03em;
  line-height: 1;
  margin-bottom: 38px;
}
.contact__links { justify-content: center; }

/* ---------- footer ---------- */
.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px var(--pad) 50px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted-2);
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* keyboard focus */
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
