/* ============================================================
   Rohit Mehta — Portfolio (v3 · "Quattro-inspired" layout)
   EB Garamond (display) + Figtree (body/labels) · typography from v2
   Dark default w/ light mode toggle · tangerine accent
   Same IA as v1/v2, Quattro-inspired structure, v2 typography.
   ============================================================ */

:root {
  --bg: #0E0E0F;
  --panel: #17171A;
  --panel-2: #1D1D20;
  --ink: #F4F4F2;
  --muted: #9C9C98;
  --faint: #6E6E6B;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.20);
  --accent: #FF6A1F;
  --accent-strong: #FF7A33;
  --chip-bg: #FFFFFF;
  --chip-border: rgba(0, 0, 0, 0.08);

  --display: "EB Garamond", Georgia, serif;
  --sans: "Figtree", -apple-system, "Helvetica Neue", sans-serif;
  --mono: "Figtree", -apple-system, "Helvetica Neue", sans-serif;

  --col: 1080px;
  --pad: clamp(1.25rem, 4.5vw, 3.5rem);
}

html[data-theme="light"] {
  --bg: #F0F0EE;
  --panel: #E3E3E0;
  --panel-2: #D6D6D2;
  --ink: #131311;
  --muted: #63635C;
  --faint: #9B9A93;
  --line: rgba(0, 0, 0, 0.10);
  --line-strong: rgba(0, 0, 0, 0.18);
  --accent: #E8590C;
  --accent-strong: #FF6A1F;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.25s ease, color 0.25s ease;
}

::selection { background: var(--accent); color: #0E0E0F; }

a { color: inherit; text-decoration: none; }

/* ============ Labels ============ */

.label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.label-muted { color: var(--faint); }

/* ============ Nav ============ */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: var(--col);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem var(--pad);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.wordmark {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.nav nav { display: flex; align-items: center; gap: 1.6rem; }

.nav nav a:not(.theme-toggle) {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav nav a:not(.theme-toggle):hover { color: var(--ink); }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle svg { width: 15px; height: 15px; display: block; }

html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: none; }

/* ============ Hero ============ */

.hero {
  max-width: var(--col);
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 5.5rem) var(--pad) 3rem;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  55% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent); }
}

.status-text {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.1rem, 5.4vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 18em;
}

.hero-title .accent { color: var(--accent); }
.hero-title .soft { color: var(--muted); font-weight: 500; }

.hero-meta {
  margin-top: 2.75rem;
  border-top: 1px solid var(--line);
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0.1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.meta-row span:first-child {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.meta-row span:last-child { color: var(--ink); }

/* ============ Work ============ */

.work { max-width: var(--col); margin: 0 auto; padding: 1rem var(--pad) 4rem; }

.work-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 1.5rem;
}

.cos { list-style: none; border-top: 1px solid var(--line); }

.co {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  padding: 1.75rem 0.25rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease;
}

.co:nth-child(even) { background: color-mix(in srgb, var(--panel) 55%, transparent); }

.co-logo {
  width: 80px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 10px;
}

.co-logo img { width: 100%; height: 100%; object-fit: contain; padding: 0 0.5rem; }

.co-name {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.4vw, 1.65rem);
  letter-spacing: -0.01em;
}

.co-year {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--faint);
}

.co-tags { display: flex; gap: 0.5rem; margin-top: 0.65rem; flex-wrap: wrap; }

.co-tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 0.25rem 0.7rem;
}

.co-focus { font-size: 0.9rem; color: var(--muted); margin-top: 0.6rem; }

.co-studies {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.15rem;
}

.co-study { font-size: 0.94rem; color: var(--ink); transition: color 0.18s ease; }

.co-study::before {
  content: "→";
  margin-right: 0.4rem;
  color: var(--accent);
  transition: margin-right 0.18s ease;
}

.co-study:hover { color: var(--accent); }
.co-study:hover::before { margin-right: 0.55rem; }

.co-demo, .co-demo::before { color: var(--accent); }

.co-soon { font-size: 0.9rem; color: var(--faint); }

/* -- legacy company-index cards (flipp.html / ola.html sub-index) -- */

.flipp-index { margin-top: 2rem; display: flex; flex-direction: column; gap: 1rem; }

.fi-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.75rem;
  align-items: center;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  transition: border-color 0.25s ease, transform 0.2s ease;
}

.fi-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.fi-thumb {
  aspect-ratio: 16/10;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.fi-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.fi-no {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.fi-body h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.4rem;
  margin-top: 0.3rem;
}

.fi-desc { margin-top: 0.5rem; color: var(--muted); font-size: 0.94rem; max-width: 46ch; }

.fi-tag {
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  text-transform: uppercase;
}

.fi-arrow { color: var(--accent); margin-left: 0.4rem; opacity: 0; transition: opacity 0.2s ease, margin-left 0.2s ease; }
.fi-card:hover .fi-arrow { opacity: 1; margin-left: 0.7rem; }

/* ============ About ============ */

.about { max-width: var(--col); margin: 0 auto; padding: 4rem var(--pad); border-top: 1px solid var(--line); }

.about-lead {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.35;
  max-width: 26em;
}

.about-lead .accent, .about-lead em { color: var(--accent); font-style: normal; }

.about-body { margin-top: 1.5rem; max-width: 46em; color: var(--muted); }

.cv { list-style: none; margin-top: 3rem; border-top: 1px solid var(--line); }

.cv li {
  display: grid;
  grid-template-columns: 1.3fr 1fr 8em;
  gap: 1rem;
  align-items: baseline;
  padding: 1rem 0.1rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.cv li:hover { background: color-mix(in srgb, var(--panel) 70%, transparent); padding-left: 0.6rem; }

.cv-role { font-weight: 600; font-size: 0.94rem; }
.cv-org { font-family: var(--display); font-weight: 500; font-size: 1.15rem; color: var(--accent); }
.cv-year { font-family: var(--mono); font-size: 0.76rem; color: var(--faint); text-align: right; }

/* ============ Footer ============ */

.foot {
  max-width: var(--col);
  margin: 0 auto;
  padding: 5rem var(--pad) 2.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.foot-kicker {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.foot-title {
  display: inline-block;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  letter-spacing: -0.02em;
  margin-top: 1.1rem;
  transition: color 0.2s ease;
}

.foot-title em, .foot-title .accent { font-style: normal; color: var(--accent); }
.foot-title:hover { color: var(--accent); }
.foot-title:hover em, .foot-title:hover .accent { color: var(--ink); }

.foot-links {
  margin-top: 2.25rem;
  display: flex;
  justify-content: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  font-size: 0.94rem;
  color: var(--muted);
}

.foot-links a { border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; transition: color 0.2s, border-color 0.2s; }
.foot-links a:hover { color: var(--accent); border-color: var(--accent); }

.foot-colophon { margin-top: 3.5rem; font-family: var(--mono); font-size: 0.7rem; color: var(--faint); }

/* ============ Responsive ============ */

@media (max-width: 720px) {
  .co { grid-template-columns: 1fr; gap: 0.9rem; }
  .co-logo { width: 68px; }
  .fi-card { grid-template-columns: 1fr; }
  .cv li { grid-template-columns: 1fr auto; }
  .cv-org { grid-column: 1; }
  .cv-year { grid-row: 1; grid-column: 2; }
  .nav nav { gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .status-dot { animation: none; }
}
