/* ---------------------------------------------------------
   Siddharth Swami — portfolio
   Plain CSS, no framework. Dark-first, light override.
--------------------------------------------------------- */

:root {
  --bg: #0a0a0c;
  --bg-elevated: #131316;
  --bg-soft: #16171b;
  --border: #26262b;
  --text: #ece9e3;
  --text-muted: #a3a097;
  --text-dim: #716e67;
  --accent: #e3b04b;
  --accent-contrast: #16130a;
  --accent-soft: rgba(227, 176, 75, 0.12);
  --shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1080px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f5f0;
    --bg-elevated: #ffffff;
    --bg-soft: #efece3;
    --border: #e1ddd0;
    --text: #1b1a17;
    --text-muted: #58554b;
    --text-dim: #85816f;
    --accent: #9c6f0e;
    --accent-contrast: #ffffff;
    --accent-soft: rgba(156, 111, 14, 0.12);
    --shadow: 0 10px 30px -16px rgba(20, 18, 10, 0.18);
  }
}

:root[data-theme="light"] {
  --bg: #f7f5f0;
  --bg-elevated: #ffffff;
  --bg-soft: #efece3;
  --border: #e1ddd0;
  --text: #1b1a17;
  --text-muted: #58554b;
  --text-dim: #85816f;
  --accent: #9c6f0e;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(156, 111, 14, 0.12);
  --shadow: 0 10px 30px -16px rgba(20, 18, 10, 0.18);
}

:root[data-theme="dark"] {
  --bg: #0a0a0c;
  --bg-elevated: #131316;
  --bg-soft: #16171b;
  --border: #26262b;
  --text: #ece9e3;
  --text-muted: #a3a097;
  --text-dim: #716e67;
  --accent: #e3b04b;
  --accent-contrast: #16130a;
  --accent-soft: rgba(227, 176, 75, 0.12);
  --shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--accent-contrast); }

img { max-width: 100%; display: block; }

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

h1, h2, h3 { font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; margin: 0; }

p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 100;
  transition: top 0.15s var(--ease);
}
.skip-link:focus { top: 1rem; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  margin: 0 0 0.9rem;
}
.eyebrow__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex-shrink: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--mono); font-size: 0.95rem; }
.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  font-size: 0.75rem;
}
.brand__dot { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a {
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color 0.15s var(--ease);
}
.nav a:hover { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 3rem;
  align-items: center;
  padding-block: clamp(3rem, 8vw, 6rem);
}

.hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  font-weight: 600;
  margin-bottom: 0.9rem;
}

.hero__lede {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  max-width: 46ch;
  margin-bottom: 1.8rem;
}

.hero__cta { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 2.6rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.3rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.btn--primary { background: var(--accent); color: var(--accent-contrast); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 85%, white 15%); }
.btn--primary:active { background: color-mix(in srgb, var(--accent) 88%, black 12%); }
.btn--ghost { border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--ghost:active { background: var(--bg-soft); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; max-width: 46rem; }
.stats__item dt { font-family: var(--mono); font-size: clamp(1.3rem, 2.4vw, 1.7rem); color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.stats__item dd { margin: 0.25rem 0 0; font-size: 0.82rem; color: var(--text-dim); line-height: 1.35; }

.hero__aside { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; }
.avatar-frame {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 1px solid var(--border);
  padding: 8px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}
.avatar-img { border-radius: 50%; width: 100%; height: 100%; object-fit: cover; }

.hero__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; max-width: 280px; }
.hero__tags li {
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.section--soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 2.6rem; max-width: 50ch; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* About */
.about__grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; align-items: start; }
.about__text { color: var(--text-muted); font-size: 1.02rem; max-width: 60ch; }
.facts { border-top: 1px solid var(--border); }
.facts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.facts__label { color: var(--text-dim); font-family: var(--mono); font-size: 0.78rem; }

/* Timeline */
.timeline { position: relative; display: flex; flex-direction: column; gap: 2.4rem; }
.timeline__item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  position: relative;
  padding-left: 1.6rem;
  border-left: 1px solid var(--border);
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.4rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg-soft);
}
.timeline__when { display: flex; flex-direction: column; gap: 0.25rem; }
.timeline__dates { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); font-weight: 500; font-variant-numeric: tabular-nums; }
.timeline__place { font-size: 0.85rem; color: var(--text-dim); }
.timeline__body h3 { font-size: 1.15rem; margin-bottom: 0.7rem; }
.timeline__tag {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 0.3rem;
}
.timeline__body ul { display: flex; flex-direction: column; gap: 0.55rem; }
.timeline__body li { color: var(--text-muted); font-size: 0.95rem; padding-left: 1.1rem; position: relative; }
.timeline__body li::before { content: "—"; position: absolute; left: 0; color: var(--text-dim); }
.timeline__body strong { color: var(--text); }

.education { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.education__title { font-family: var(--mono); font-size: 0.82rem; color: var(--text-dim); margin-bottom: 1rem; }
.education__list { display: flex; flex-direction: column; gap: 0.6rem; }
.education__list li { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.92rem; }
.education__meta { color: var(--text-dim); font-size: 0.85rem; }

/* Grids / cards */
.grid { display: grid; gap: 1.4rem; }
.grid--projects { grid-template-columns: repeat(3, 1fr); }
.grid--skills { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.15s var(--ease);
}
.card:hover { border-color: var(--accent); }
.card__title { font-size: 1.08rem; }
.card__meta { font-family: var(--mono); font-size: 0.74rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.card p:not(.card__meta) { color: var(--text-muted); font-size: 0.92rem; flex-grow: 1; }
.card__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.card__tags li { font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 0.2rem 0.55rem; }
.card__link { color: var(--accent); font-size: 0.88rem; font-weight: 500; margin-top: 0.2rem; }
.card__link:hover { text-decoration: underline; }

.skill-group {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.skill-group h3 { font-size: 0.92rem; margin-bottom: 0.9rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tags li {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--accent-soft);
  border-radius: var(--radius-xs);
  padding: 0.3rem 0.55rem;
}

/* Contact */
.contact__lede { color: var(--text-muted); max-width: 55ch; margin-bottom: 2.2rem; font-size: 1.02rem; }
.contact__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.contact__item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-size: 0.94rem;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
  color: var(--text-muted);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.contact__item svg { color: var(--accent); flex-shrink: 0; }
.contact__item:hover { border-color: var(--accent); color: var(--text); }
.contact__item--btn { background: var(--bg-elevated); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding-block: 1.8rem; }
.site-footer__row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero__aside { order: -1; }
  .about__grid { grid-template-columns: 1fr; }
  .grid--projects { grid-template-columns: repeat(2, 1fr); }
  .grid--skills { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav {
    position: absolute;
    top: 100%;
    left: 1rem;
    right: 1rem;
    margin-top: 0.6rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    box-shadow: var(--shadow);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.15s var(--ease), opacity 0.15s var(--ease);
  }
  .nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 0.75rem 0.6rem; width: 100%; border-radius: 6px; }
  .nav a:hover { background: var(--bg-soft); }
  .nav-toggle { display: inline-grid; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .timeline__item { grid-template-columns: 1fr; gap: 0.6rem; }
  .grid--projects { grid-template-columns: 1fr; }
  .grid--skills { grid-template-columns: 1fr; }
  .contact__grid { grid-template-columns: 1fr; }
  .site-footer__row { flex-direction: column; }
}
