/* ============================================================
   Aryan Raj — personal site
   Typography: Inter (self-hosted), the face Kaggle's UI uses.
   Layout language: hairline borders, flat surfaces, one accent.
   ============================================================ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-latin-roman.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, 'Nirmala UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --accent: #008abc;
  --accent-hover: #007591;
  --accent-soft: rgba(0, 138, 188, 0.08);

  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --border: #e3e6e8;
  --border-strong: #d0d5d9;
  --text: #16171b;
  --text-2: #5c636b;
  --text-3: #8b929a;

  --ok: #12784a;
  --warn: #9a5b00;

  --radius: 6px;
  --radius-sm: 4px;
  --maxw: 1080px;
  --head-h: 56px;
}

[data-theme='dark'] {
  --accent: #29b6e3;
  --accent-hover: #4cc6ee;
  --accent-soft: rgba(41, 182, 227, 0.12);

  --bg: #16171b;
  --bg-alt: #1b1d22;
  --surface: #1e2026;
  --surface-2: #23262c;
  --border: #2c2f36;
  --border-strong: #3a3e47;
  --text: #e7e9ec;
  --text-2: #a4abb4;
  --text-3: #79808a;

  --ok: #4cc38a;
  --warn: #d9a441;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 16px); }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.65;
  font-feature-settings: 'cv05' 1, 'cv08' 1, 'ss01' 1;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- header ---------- */

.site-head {
  position: sticky; top: 0; z-index: 50;
  height: var(--head-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.head-inner { height: var(--head-h); display: flex; align-items: center; gap: 24px; }

.brand {
  font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text); white-space: nowrap;
}
.brand:hover { color: var(--text); text-decoration: none; }
.brand-dim { color: var(--text-3); font-weight: 400; }

.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a {
  font-size: 0.8125rem; font-weight: 500; color: var(--text-2);
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.is-active { color: var(--text); border-bottom-color: var(--accent); }

.head-actions { display: flex; gap: 4px; margin-left: auto; }
.nav + .head-actions { margin-left: 0; }

.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.i-moon { display: none; }
[data-theme='dark'] .i-sun { display: none; }
[data-theme='dark'] .i-moon { display: block; }
.nav-toggle { display: none; }

/* ---------- hero ---------- */

.hero { padding: 72px 0 64px; border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; }

.avail {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.75rem; font-weight: 500; color: var(--text-2);
  margin: 0 0 18px;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent);
  flex: none;
}

h1 {
  font-size: clamp(2rem, 4.4vw, 2.75rem); line-height: 1.14;
  font-weight: 600; letter-spacing: -0.028em; margin: 0 0 18px;
}
h1 .dim { color: var(--text-3); font-weight: 400; }

.lede { font-size: 1.0625rem; line-height: 1.6; color: var(--text-2); max-width: 60ch; margin: 0 0 26px; }
.lede.narrow { max-width: 52ch; }

code {
  font-family: var(--mono); font-size: 0.8125em;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 0.05em 0.35em; border-radius: 3px; color: var(--text);
}

.cta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; }

.btn {
  display: inline-flex; align-items: center; height: 36px; padding: 0 15px;
  font-family: inherit; font-size: 0.8125rem; font-weight: 500;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); color: var(--text); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; }
.stats > div { border-top: 1px solid var(--border); padding-top: 10px; }
.stats dt {
  font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 2px;
}
.stats dd { margin: 0; font-size: 0.8125rem; font-weight: 500; color: var(--text); }

.identity { position: sticky; top: calc(var(--head-h) + 24px); }
.identity img { width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); }

.id-list { margin: 16px 0 0; font-size: 0.8125rem; }
.id-list > div {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 8px 0; border-top: 1px solid var(--border);
}
.id-list > div:last-child { border-bottom: 1px solid var(--border); }
.id-list dt { color: var(--text-3); font-weight: 400; }
.id-list dd { margin: 0; text-align: right; color: var(--text); overflow-wrap: anywhere; }
.id-list a { color: var(--text); }
.id-list a:hover { color: var(--accent); }

/* ---------- sections ---------- */

.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

.h2 {
  font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em;
  margin: 0 0 28px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.h3 { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 10px; }

.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 48px; align-items: start; }

.prose p { color: var(--text-2); max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); font-weight: 500; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.panel .h3 { margin-bottom: 14px; }

.rules li {
  position: relative; padding-left: 16px; margin-bottom: 10px;
  font-size: 0.8125rem; line-height: 1.55; color: var(--text-2);
}
.rules li:last-child { margin-bottom: 0; }
.rules li::before {
  content: ''; position: absolute; left: 0; top: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.rules strong { color: var(--text); font-weight: 500; }

/* ---------- projects ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.chip {
  font-family: inherit; font-size: 0.75rem; font-weight: 500; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 5px 12px; cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip.is-active { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  transition: border-color 0.14s ease, transform 0.14s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.card[hidden] { display: none; }

.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-top .h3 { margin: 0; }
.card-top .h3 span[lang] { font-weight: 500; }

.kind {
  font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-3); margin: 6px 0 10px;
}
.card > p:not(.kind) { font-size: 0.8125rem; line-height: 1.6; color: var(--text-2); margin: 0 0 12px; }

.tag {
  flex: none; font-size: 0.625rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 3px; border: 1px solid;
}
.tag-live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 32%, transparent); background: color-mix(in srgb, var(--ok) 9%, transparent); }
.tag-review { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 32%, transparent); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.tag-wip { color: var(--text-3); border-color: var(--border-strong); background: var(--surface-2); }

.meta { margin: 0 0 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.meta li {
  position: relative; padding-left: 14px; font-size: 0.75rem; line-height: 1.5;
  color: var(--text-3); margin-bottom: 4px;
}
.meta li:last-child { margin-bottom: 0; }
.meta li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 1px; background: var(--border-strong); }
.meta code { font-size: 0.9em; padding: 0 3px; }

.card-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.card-links a { font-size: 0.75rem; font-weight: 500; }

.empty { font-size: 0.8125rem; color: var(--text-3); margin: 8px 0 0; }
.more { margin: 24px 0 0; font-size: 0.8125rem; }

/* ---------- experience ---------- */

.timeline { margin: 0 0 44px; padding: 0; }
.timeline > li {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 28px;
  padding: 24px 0; border-top: 1px solid var(--border);
}
.timeline > li:first-child { border-top: 0; padding-top: 0; }
.timeline > li:last-child { padding-bottom: 0; }

.when { font-size: 0.75rem; font-weight: 500; color: var(--text-3); padding-top: 2px; }
.role .h3 { margin-bottom: 2px; }
.org { font-size: 0.8125rem; color: var(--accent); margin: 0 0 12px; font-weight: 500; }

.bullets li {
  position: relative; padding-left: 16px; font-size: 0.8125rem; line-height: 1.6;
  color: var(--text-2); margin-bottom: 6px;
}
.bullets li:last-child { margin-bottom: 0; }
.bullets li::before {
  content: ''; position: absolute; left: 0; top: 9px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong);
}

.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.plain li {
  font-size: 0.8125rem; color: var(--text-2); padding: 8px 0; border-top: 1px solid var(--border);
}
.plain li:first-child { border-top: 0; padding-top: 0; }
.plain li:last-child { padding-bottom: 0; }
.plain strong { display: block; color: var(--text); font-weight: 500; }
.plain li > span { display: block; font-size: 0.75rem; color: var(--text-3); }

/* ---------- skills ---------- */

.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px 40px; }
.skill-group .h3 { padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font-size: 0.75rem; color: var(--text-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px 9px;
}

/* ---------- contact + footer ---------- */

.contact-meta { display: flex; flex-wrap: wrap; gap: 20px; font-size: 0.8125rem; color: var(--text-2); }

.site-foot { border-top: 1px solid var(--border); padding: 22px 0; }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-foot p { margin: 0; font-size: 0.75rem; color: var(--text-3); }
.to-top { font-size: 0.75rem; font-weight: 500; }

/* ---------- reveal ---------- */

.reveal { opacity: 0; transform: translateY(8px); transition: opacity 0.4s ease, transform 0.4s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .identity { position: static; display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
  .id-list { margin-top: 0; }
  .split { grid-template-columns: 1fr; gap: 28px; }
  .timeline > li { grid-template-columns: 1fr; gap: 10px; }
  .when { padding-top: 0; }
}

@media (max-width: 720px) {
  .nav-toggle { display: grid; }
  .nav {
    position: absolute; top: var(--head-h); left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 6px 24px 14px; display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 10px 0; border-bottom: 0; font-size: 0.875rem; }
  .head-inner { justify-content: space-between; }
  .section { padding: 52px 0; }
  .hero { padding: 40px 0 44px; }
  .stats { grid-template-columns: 1fr; gap: 12px; }
  .identity { display: contents; }
  .identity img { order: -1; width: 100%; max-width: 264px; }
  .id-list { order: 1; margin-top: 10px; }
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-head, .site-foot, .filters, .cta-row, .theme-toggle { display: none !important; }
  .section { padding: 18px 0; }
  body { font-size: 11pt; }
  .card, .panel { break-inside: avoid; border-color: #ccc; }
}
