/* ============================================================
   Bharath Mohan — minimal portfolio
   inspired by emilkowal.ski
   single column · type-only · light + dark
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #fbf3ee;
  --ink: #111111;
  --mute: #6b6b6b;
  --line: #ececec;
  --accent: #c2410c;
  --accent-soft: #b45309;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --theme-anim: 280ms var(--ease-out);

  /* type stack */
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Times New Roman", ui-serif, Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0e0e0e;
  --bg-soft: #1a1410;
  --ink: #ededed;
  --mute: #8a8a8a;
  --line: #232323;
  --accent: #f97316;
  --accent-soft: #fb923c;
}

* { box-sizing: border-box; }

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color var(--theme-anim), color var(--theme-anim);
}

::selection { background: var(--ink); color: var(--bg); }

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

/* ============================================================
   PAGE — narrow centered column
   ============================================================ */
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(64px, 12vw, 128px) 24px clamp(96px, 14vw, 160px);
}

/* ============================================================
   HEADER
   ============================================================ */
.head {
  margin-bottom: clamp(56px, 8vw, 80px);
}
.head h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.011em;
}
.head .name {
  display: inline;
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--accent);
  transition: color var(--theme-anim);
}
.head .name::after { content: " "; }
.head .role {
  display: inline;
  color: var(--mute);
  transition: color var(--theme-anim);
}

/* live time row */
.head .when {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--mute);
  letter-spacing: -0.003em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.head .when #liveTime {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-weight: 500;
}


/* ============================================================
   SECTIONS
   ============================================================ */
.sec { margin-bottom: clamp(40px, 6vw, 56px); }
.sec:last-child { margin-bottom: 0; }

.sec h2 {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  transition: color var(--theme-anim);
}

.sec p {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
}
.sec p:last-child { margin-bottom: 0; }

/* highlighted inline term */
.hl {
  color: var(--accent);
  font-weight: 500;
  transition: color var(--theme-anim);
}

/* inline external link inside paragraphs */
.ext {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
  transition: border-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
.ext:hover {
  border-bottom-color: var(--accent);
  color: var(--accent-soft);
}

/* ============================================================
   LISTS — projects & elsewhere
   ============================================================ */
.list { list-style: none; margin: 0; padding: 0; }
.list li { margin: 0; }
.list li + li { margin-top: 2px; }

.row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 6px;
  transition: background-color 180ms var(--ease-out), color var(--theme-anim);
}

@media (hover: hover) and (pointer: fine) {
  .row:hover { background-color: var(--bg-soft); }
  .row:hover .t { color: var(--accent); }
}

.row:active {
  transform: scale(0.997);
  transition: transform 100ms var(--ease-out), background-color 180ms var(--ease-out);
}

/* featured rows — more breathing room, slightly larger title, multi-line description */
.row.featured {
  align-items: flex-start;
  gap: 18px;
  padding: 14px 10px;
  flex-wrap: wrap;
}
.row.featured .t {
  font-size: 16px;
  flex: 0 0 auto;
  min-width: 110px;
}
.row.featured .d {
  font-size: 15px;
  line-height: 1.55;
  max-width: 46ch;
}

/* compact rows — tighter, single-line feel */
.list.compact .row { padding: 6px 10px; }
.list.compact .row .d { font-size: 14.5px; }

/* non-interactive row (e.g., education entries) */
.row.static { cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .row.static:hover { background-color: transparent; }
  .row.static:hover .t { color: var(--ink); }
}
.row.static:active { transform: none; }

.row .t {
  flex: 0 0 auto;
  font-weight: 500;
  color: var(--ink);
  font-size: 15.5px;
  letter-spacing: -0.005em;
  transition: color 180ms var(--ease-out);
}

.row .d {
  flex: 1 1 auto;
  color: var(--mute);
  font-size: 15.5px;
  line-height: 1.55;
}

@media (max-width: 520px) {
  .row { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* ============================================================
   STAGGER REVEAL
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 480ms var(--ease-out),
    transform 480ms var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal][data-shown] {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  z-index: 50;
  transition:
    background-color var(--theme-anim),
    border-color var(--theme-anim),
    color var(--theme-anim),
    transform 160ms var(--ease-out);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle .icon {
  width: 16px;
  height: 16px;
  position: absolute;
  transition:
    opacity 220ms var(--ease-out),
    transform 280ms var(--ease-out);
}

/* light mode → show moon (toggle to dark) */
[data-theme="light"] .theme-toggle .icon-sun  { opacity: 0; transform: rotate(-90deg) scale(0.6); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0)      scale(1);   }

/* dark mode → show sun (toggle to light) */
[data-theme="dark"]  .theme-toggle .icon-sun  { opacity: 1; transform: rotate(0)      scale(1);   }
[data-theme="dark"]  .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg)  scale(0.6); }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
