/* ---------------------------------------------------------
   Sanjeevani Saikia — portfolio
   1. Tokens          5. Experience / skills / education
   2. Reset & base    6. Writing index
   3. Rail (nav)      7. Podcast
   4. Hero            8. AI video
                      9. Content ops · footer · responsive
--------------------------------------------------------- */

/* ---------------------------------------------------------
   1. Design tokens
--------------------------------------------------------- */
:root {
  --ink: #171512;
  --ink-soft: #3a352c;
  --paper: #E7E9E2;
  --paper-raise: #f2f3ee;
  --accent: #b5701f;
  --accent-strong: #94570f;
  --pine: #204b3b;
  --signal: #a13327;
  --line: #cac6b7;
  --muted: #6b6659;

  --bg: var(--paper);
  --bg-raise: var(--paper-raise);
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --border: var(--line);
  --text-muted: var(--muted);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --rail-w: 15rem;
  --bar-h: 3.5rem;              /* mobile nav bar height */
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 46rem;
  --measure: 38rem;             /* comfortable reading measure */
  --shell: 66rem;               /* content column width */
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #efece2;
    --ink-soft: #cbc6b6;
    --paper: #17150f;
    --paper-raise: #1e1c15;
    --accent: #e0a03f;
    --accent-strong: #f0b658;
    --pine: #6fae95;
    --signal: #d97a68;
    --line: #38352a;
    --muted: #948d78;

    --bg: var(--paper);
    --bg-raise: var(--paper-raise);
    --fg: var(--ink);
    --fg-soft: var(--ink-soft);
    --border: var(--line);
    --text-muted: var(--muted);
  }
}

/* ---------------------------------------------------------
   2. Reset / base
--------------------------------------------------------- */
* { box-sizing: border-box; }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
ul, ol { list-style-position: outside; }

p { text-wrap: pretty; }

h1, h2, h3 { text-wrap: balance; }

.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus {
  left: 1rem; top: 1rem; z-index: 100;
  background: var(--accent); color: var(--paper);
  padding: 0.5rem 1rem; border-radius: 4px;
}

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

/* faint paper grain, purely decorative */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 20;
  opacity: 0.035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { .grain { opacity: 0.06; mix-blend-mode: overlay; } }

/* ---------------------------------------------------------
   3. Rail (sidebar nav)
--------------------------------------------------------- */
.rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail-w);
  padding: 2.5rem 1.75rem;
  display: flex;
  z-index: 10;
  background: var(--bg);
  border-right: 1px solid var(--border);
}

.rail-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.rail-inner::-webkit-scrollbar { display: none; }

.rail-mark {
  flex: none;
  display: block;
  width: 3.25rem; height: 3.25rem;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: border-color 0.15s ease;
}
.rail-mark:hover { border-color: var(--accent); }

.rail-mark img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
  filter: saturate(0.92);
  transition: filter 0.2s ease;
}
.rail-mark:hover img { filter: saturate(1.05); }

.rail-nav {
  margin-top: clamp(1.5rem, 4vh, 3rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 1.4vh, 0.85rem);
}

.rail-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--text-muted);
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  transition: color 0.15s ease;
}

.rail-nav a:hover,
.rail-nav a:focus-visible,
.rail-nav a.is-active { color: var(--accent); }

.rail-nav a.is-active .n { color: var(--accent); }

.rail-nav .n {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--border);
  transition: color 0.15s ease;
}

.rail-stats {
  margin: auto 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 2rem;
}

.rail-stats div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border-bottom: 1px dotted var(--border);
  padding-bottom: 0.35rem;
}

.rail-stats dt { color: var(--text-muted); margin: 0; font-weight: 400; }
.rail-stats dd { margin: 0; color: var(--accent); font-variant-numeric: tabular-nums; }

.rail-foot {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.rail-foot a {
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--fg-soft);
  transition: color 0.15s ease;
}
.rail-foot a:hover { color: var(--accent); }

/* ---------------------------------------------------------
   Main / section scaffolding
--------------------------------------------------------- */
main {
  margin-left: var(--rail-w);
  position: relative;
  z-index: 2;
}

.section {
  padding: clamp(3.5rem, 8vw, 6rem) var(--gutter) 3rem;
  max-width: var(--shell);
  border-top: 1px solid var(--border);
  scroll-margin-top: 1rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin: 0 0 1.75rem;
}
.section-label .n { color: var(--text-muted); }

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 1.08;
  margin: 0;
}

.section-body { max-width: var(--max); }

.section-body p {
  margin: 0 0 1.1rem;
  color: var(--fg-soft);
  max-width: var(--measure);
}
.section-body p:last-child { margin-bottom: 0; }
.section-body strong { color: var(--fg); font-weight: 600; }
.section-body em { color: var(--pine); font-style: normal; font-weight: 600; }

/* shared small-caps label for sub-blocks (Core skills, Education) */
.block-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

/* ---------------------------------------------------------
   4. Hero
--------------------------------------------------------- */
.hero {
  padding: clamp(3.5rem, 9vw, 7rem) var(--gutter) 4rem;
  max-width: var(--shell);
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  max-width: 34rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 6.4rem);
  line-height: 0.98;
  margin: 0 0 2rem;
  letter-spacing: -0.01em;
}

.hero-dot { color: var(--accent); }

.hero-dek {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  max-width: var(--measure);
  color: var(--fg-soft);
  margin: 0 0 2.5rem;
}
.hero-dek strong { color: var(--fg); font-weight: 600; }
.hero-dek em { color: var(--pine); font-style: normal; font-weight: 600; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--accent); color: var(--paper); }
.btn-primary:hover { background: var(--accent-strong); }

.btn-ghost { border-color: var(--border); color: var(--fg); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.telemetry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 1.5rem 1.25rem;
  margin: 0;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.telemetry-item { display: flex; flex-direction: column; gap: 0.3rem; }

.telemetry-item dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.telemetry-item dt {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-muted);
  max-width: 11rem;
}

/* ---------------------------------------------------------
   5. Experience — timeline, skills, education
--------------------------------------------------------- */
.timeline {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 3rem);
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}
.timeline-item:first-child { border-top: none; padding-top: 0; }

.timeline-when {
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 0.25rem;
}
.timeline-live { color: var(--pine); font-weight: 500; }

.timeline-body h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.35rem;
}

.timeline-org {
  font-size: 0.9rem;
  color: var(--accent);
  margin: 0 0 1rem;
}

.timeline-body ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--fg-soft);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.timeline-body li { max-width: 42rem; }
.timeline-body li::marker { color: var(--border); }
.timeline-body strong { color: var(--fg); font-weight: 600; }

.timeline-item--muted .timeline-org { color: var(--text-muted); }

.skills {
  margin-top: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.skills-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.75rem 2rem;
}

.skill-group-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

.skill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--fg-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.edu {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.edu p { margin: 0; color: var(--fg-soft); }
.edu strong { color: var(--fg); }

/* ---------------------------------------------------------
   6. Writing — index list
--------------------------------------------------------- */
.index-list {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
}

.index-list li {
  border-top: 1px solid var(--border);
  padding: 1.3rem 0;
}
.index-list li:last-child { border-bottom: 1px solid var(--border); }

.index-list a {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 0.5rem 1rem;
  text-decoration: none;
  color: var(--fg);
}

.index-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.index-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.08rem;
  line-height: 1.35;
  transition: color 0.15s ease;
}
.index-list a:hover .index-title,
.index-list a:focus-visible .index-title { color: var(--accent); }

.index-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--pine);
  white-space: nowrap;
}

.index-go {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.index-list a:hover .index-go,
.index-list a:focus-visible .index-go { opacity: 1; transform: translateX(0); }

.index-dek {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 40rem;
}

.see-all {
  display: inline-block;
  margin-top: 2rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.see-all:hover { color: var(--accent-strong); }

/* ---------------------------------------------------------
   7. Podcast — guest grid
--------------------------------------------------------- */
.guest-list {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1px;
}

.guest-list li { display: flex; }

.guest-list a {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
  padding: 1.4rem;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--border);
  text-decoration: none;
  color: var(--fg);
  transition: background 0.15s ease;
}
.guest-list a:hover,
.guest-list a:focus-visible { background: var(--bg-raise); }

.guest-ep {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.guest-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  transition: color 0.15s ease;
}
.guest-list a:hover .guest-name,
.guest-list a:focus-visible .guest-name { color: var(--accent); }

.guest-role { font-size: 0.82rem; color: var(--pine); }

.guest-topic {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ---------------------------------------------------------
   8. AI video
--------------------------------------------------------- */
.video-list {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
}

.video-card { display: flex; }

.video-card a {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-decoration: none;
  color: var(--fg);
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--border);
  transition: background 0.15s ease;
}
.video-card a:hover,
.video-card a:focus-visible { background: var(--bg-raise); }

.video-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.6rem 1.4rem;
  height: 100%;
}

.video-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pine);
}

.video-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0;
  color: var(--fg);
  line-height: 1.3;
  transition: color 0.15s ease;
}
.video-card a:hover .video-title,
.video-card a:focus-visible .video-title { color: var(--accent); }

.video-dek {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  flex: 1;
}

.video-go {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.5rem;
}

.video-tools-note {
  margin: 1.5rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tools-label {
  color: var(--accent);
  font-weight: 500;
  margin-right: 0.4rem;
}

/* ---------------------------------------------------------
   9. Content ops · footer
--------------------------------------------------------- */
.craft-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  color: var(--fg-soft);
  max-width: 40rem;
}
.craft-list li::marker { color: var(--border); }
.craft-list strong { color: var(--fg); font-weight: 600; }

.footer { padding-bottom: 5rem; }

.footer-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  line-height: 1.1;
  margin: 0 0 2.5rem;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  margin-bottom: 2rem;
}

.footer-link {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2.4vw, 1rem);
  text-decoration: none;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
  overflow-wrap: anywhere;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.footer-link:hover { color: var(--accent-strong); border-color: var(--accent-strong); }

.footer-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ---------------------------------------------------------
   Responsive — rail becomes a top bar under 900px
--------------------------------------------------------- */
@media (max-width: 900px) {
  .rail {
    top: 0; left: 0; right: 0; bottom: auto;
    width: 100%;
    height: var(--bar-h);
    padding: 0 var(--gutter);
    border-right: none;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(10px);
  }

  .rail-inner {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    overflow: visible;
  }

  .rail-mark {
    width: 2.3rem; height: 2.3rem;
  }

  .rail-nav {
    margin: 0;
    flex-direction: row;
    gap: 1.15rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 0.75rem, #000 calc(100% - 1.25rem), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 0.75rem, #000 calc(100% - 1.25rem), transparent 100%);
    padding: 0 0.75rem;
    margin-inline-start: -0.75rem;
  }
  .rail-nav::-webkit-scrollbar { display: none; }

  .rail-nav a { white-space: nowrap; font-size: 0.86rem; }
  .rail-nav .n { display: none; }

  .rail-stats,
  .rail-foot { display: none; }

  main { margin-left: 0; padding-top: var(--bar-h); }

  .section,
  .hero { scroll-margin-top: var(--bar-h); }

  .section-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .timeline-item { grid-template-columns: 1fr; gap: 0.75rem; }
  .timeline-when { flex-direction: row; gap: 0.4rem; padding-top: 0; }
}

@media (max-width: 640px) {
  .index-list a {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "date go"
      "title title";
  }
  .index-date { grid-area: date; }
  .index-go { grid-area: go; opacity: 1; transform: none; }
  .index-title { grid-area: title; }
  .index-tag { display: none; }

  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }

  .telemetry { grid-template-columns: repeat(2, 1fr); }
  .telemetry-item dt { max-width: none; }

  .skills-columns { grid-template-columns: 1fr; }
  .footer-grid { gap: 1.25rem; }
}

/* ---------------------------------------------------------
   Print — clean one-column résumé
--------------------------------------------------------- */
@media print {
  .rail, .grain, .hero-actions, .skip-link, .see-all { display: none !important; }
  main { margin: 0; padding: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section, .hero { max-width: none; padding: 1rem 0; break-inside: avoid; }
  .section-grid { grid-template-columns: 1fr; }
  a { text-decoration: none; color: #000; }
  .guest-list, .video-list { background: none; border-color: #ccc; }
}
