/* =========================================================
   Gautam Siddharth Kashyap · portfolio
   Two themes: "day" (golden hour) and "night".
   ========================================================= */

:root {
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: var(--font-display);
  --radius: 18px;
  --dock-h: 58px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

html[data-theme="day"] {
  --sky-top: #f2a97f; --sky-mid: #f8cfa6; --sky-hor: #fde7c8;
  --sea-top: #6f9aa6; --sea-bot: #2a4c5d;
  --mount-far: #c49aa6; --mount-near: #9c7c8f;
  --land: #46604f; --land2: #557260; --city: #3a4652; --ledge: #2f3f36;
  --orb: #fff4d8; --glow: rgba(255, 236, 190, .85); --glow-out: rgba(255, 236, 190, 0);
  --cloud: rgba(255, 255, 255, .55); --stars: 0; --windows: 0; --moon-cut: 0;
  --route: rgba(255, 255, 255, .9); --plane: #ffffff; --shimmer: rgba(255, 255, 255, .45);
  --bg: #fbf6ef; --bg-alt: #f5ece0; --ink: #2b1a1e; --muted: #4b2f33; --line: #e6dccf;
  --card: #ffffff; --accent: #c8572a; --accent-ink: #ffffff; --accent-soft: #fbe3d4;
  --glass: rgba(255, 252, 247, .72); --glass-line: rgba(255, 255, 255, .7); --shadow: 0 10px 30px rgba(60, 40, 20, .12);
  --hero-ink: #23252a; --hero-muted: #3e434b;
  color-scheme: light;
}

html[data-theme="night"] {
  --sky-top: #0b1230; --sky-mid: #1d2857; --sky-hor: #5a4775;
  --sea-top: #23345a; --sea-bot: #0a1124;
  --mount-far: #3b3563; --mount-near: #2b2850;
  --land: #172429; --land2: #1d2e33; --city: #0c151b; --ledge: #0e171a;
  --orb: #f3f1ff; --glow: rgba(200, 205, 255, .45); --glow-out: rgba(200, 205, 255, 0);
  --cloud: rgba(170, 180, 230, .12); --stars: 1; --windows: 1; --moon-cut: 1;
  --route: rgba(255, 214, 150, .85); --plane: #ffd696; --shimmer: rgba(200, 210, 255, .25);
  --bg: #0e1220; --bg-alt: #131829; --ink: #f1f2f8; --muted: #c9cede; --line: #252c42;
  --card: #161b2c; --accent: #f2a65a; --accent-ink: #1b1306; --accent-soft: #2c2416;
  --glass: rgba(18, 22, 38, .7); --glass-line: rgba(255, 255, 255, .1); --shadow: 0 10px 30px rgba(0, 0, 0, .4);
  --hero-ink: #f4f2ff; --hero-muted: #cdd0e6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17.5px/1.65 var(--font-body);
  text-rendering: optimizeLegibility;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; font-weight: 600; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------------------------------------------------------- HERO */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; color: var(--hero-ink); }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene * { transition: fill .8s var(--ease), stop-color .8s var(--ease), opacity .8s var(--ease), stroke .8s var(--ease); }
.scene [data-depth] { transition: transform .4s ease-out, fill .8s var(--ease); will-change: transform; }

.sky-top { stop-color: var(--sky-top); } .sky-mid { stop-color: var(--sky-mid); } .sky-hor { stop-color: var(--sky-hor); }
.sea-top { stop-color: var(--sea-top); } .sea-bot { stop-color: var(--sea-bot); }
.glow-in { stop-color: var(--glow); } .glow-out { stop-color: var(--glow-out); }
.stars circle { fill: #fff; opacity: var(--stars); animation: twinkle 4s ease-in-out infinite; }
.stars circle:nth-child(3n) { animation-delay: 1.3s; } .stars circle:nth-child(3n+1) { animation-delay: 2.6s; }
@keyframes twinkle { 50% { opacity: calc(var(--stars) * .35); } }
.orb { fill: var(--orb); }
.moon-cut { fill: var(--sky-mid); opacity: var(--moon-cut); }
.clouds ellipse { fill: var(--cloud); }
.mount-far { fill: var(--mount-far); } .mount-near { fill: var(--mount-near); }
.land { fill: var(--land); } .land2 { fill: var(--land2); } .ledge { fill: var(--ledge); }
.city, .city rect, .city path { fill: var(--city); }
.city .bridge { fill: none; stroke: var(--city); }
.windows rect { fill: #ffd27a; opacity: var(--windows); }
.shimmer path { stroke: var(--shimmer); stroke-width: 2; stroke-linecap: round; }
.route { stroke: var(--route); stroke-width: 2.5; stroke-dasharray: 2 10; stroke-linecap: round; animation: dash 30s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -600; } }
.plane path { fill: var(--plane); }
.person .skin { fill: #b07a55; } .person .hair { fill: #1b1b1f; }
.person .shirt { fill: #d86a3a; } .person .pants { fill: #2b3550; }
.person .laptop { fill: #c9ced8; }
.screen-glow { opacity: calc(.15 + var(--windows) * .85); }
.lantern .post { fill: var(--city); } .lantern .bulb { fill: #ffd27a; }
.bulb-glow { opacity: var(--windows); }

/* pins (SVG) */
.pin { cursor: pointer; outline: none; }
.pin .pin-ring { fill: var(--accent); opacity: .25; transform-box: fill-box; transform-origin: center; animation: pulse 2.4s ease-out infinite; }
.pin .pin-dot { fill: var(--accent); stroke: #fff; stroke-width: 3; }
.pin .pin-label rect { fill: var(--glass); stroke: var(--glass-line); }
.pin .pin-label text { fill: var(--hero-ink); font: 600 15px var(--font-body); }
.pin .pin-label .pin-year { fill: var(--muted); font: 500 12px var(--font-mono); }
.pin:hover .pin-dot, .pin:focus-visible .pin-dot, .pin.is-active .pin-dot { fill: var(--hero-ink); }
.pin:focus-visible .pin-label rect, .pin.is-active .pin-label rect { stroke: var(--accent); stroke-width: 2; }
.pin.is-star .pin-dot { fill: #f6c445; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .45; } 100% { transform: scale(2.2); opacity: 0; } }

.hero-copy { position: absolute; left: clamp(20px, 5vw, 72px); top: clamp(64px, 9vh, 104px); max-width: min(620px, 88vw); z-index: 2; }
.eyebrow { font: 500 14px var(--font-mono); margin: 0 0 14px; color: var(--hero-muted); letter-spacing: .02em; }
.wave { display: inline-block; animation: wave 2.6s ease-in-out 1s 2; transform-origin: 70% 70%; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-8deg); } }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 4rem); font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
.hero h1 em { font-style: italic; font-weight: 600; color: var(--accent); }
.lede { margin: 14px 0 0; font-weight: 600; text-shadow: 0 0 12px var(--sky-mid), 0 0 2px var(--sky-mid); font-size: clamp(1rem, 1.4vw, 1.15rem); color: var(--hero-muted); max-width: 46ch; }

.hero-tools { position: absolute; top: 20px; right: clamp(16px, 3vw, 40px); display: flex; gap: 10px; z-index: 3; flex-wrap: wrap; justify-content: flex-end; }
.pill, .chip-link {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-line); color: var(--hero-ink);
  font: 500 14px var(--font-body); cursor: pointer; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  text-decoration: none; box-shadow: var(--shadow); transition: transform .2s var(--ease);
}
.pill:hover, .chip-link:hover { transform: translateY(-1px); }
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.theme-icon { width: 16px; height: 16px; border-radius: 50%; background: var(--hero-ink); box-shadow: inset -5px -3px 0 0 var(--glass); }
html[data-theme="night"] .theme-icon { background: #f6c445; box-shadow: 0 0 0 3px rgba(246, 196, 69, .25); }

.pin-card {
  position: absolute; left: 50%; margin-left: max(-190px, calc(-50vw + 16px)); bottom: calc(var(--dock-h) + 28px); z-index: 4;
  width: min(380px, calc(100vw - 32px)); padding: 18px 20px 16px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--glass-line); color: var(--hero-ink);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow);
  animation: rise .35s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.pin-card-when { font: 500 12px var(--font-mono); color: var(--accent); margin: 0 0 4px; text-transform: uppercase; letter-spacing: .06em; }
.pin-card-title { font-size: 1.3rem; margin-bottom: 6px; }
.pin-card-body { margin: 0; font-size: 1rem; color: var(--hero-muted); }
.pin-card-close { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: var(--hero-muted); font-size: 22px; cursor: pointer; line-height: 1; }
.pin-card-nav { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.pin-card-step { font: 500 12px var(--font-mono); color: var(--muted); margin-right: auto; }
.pin-card-nav button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--glass-line); background: var(--card); color: var(--ink); cursor: pointer; }

.scroll-cue {
  position: absolute; left: 50%; bottom: calc(var(--dock-h) + 40px); transform: translateX(-50%); z-index: 2;
  font: 500 12px var(--font-mono); color: var(--hero-ink); text-decoration: none; padding: 8px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(8px);
}
.pin-card:not([hidden]) ~ .scroll-cue { opacity: 0; pointer-events: none; }
.scroll-cue::after { content: " ↓"; display: inline-block; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(3px); } }

/* ---------------------------------------------------------- DOCK */
.dock {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 50;
  display: flex; gap: 2px; align-items: center; height: var(--dock-h); padding: 6px;
  border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: var(--shadow); max-width: calc(100vw - 20px); overflow-x: auto; scrollbar-width: none;
}
.dock::-webkit-scrollbar { display: none; }
.dock a {
  display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 16px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font: 500 14px var(--font-body); white-space: nowrap; opacity: .72;
  transition: background-color .25s, opacity .25s;
}
.dock a:hover { opacity: 1; }
.dock a.active { background: var(--card); opacity: 1; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.dock-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: none; }
.dock a.active .dock-dot { display: inline-block; }
.dock .dock-cv { background: var(--ink); color: var(--bg); opacity: 1; margin-left: 4px; }
.dock .dock-cv:hover { background: var(--accent); color: var(--accent-ink); }

/* ---------------------------------------------------------- SECTIONS */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section.alt { background: var(--bg-alt); transition: background-color .6s var(--ease); }
.wrap { width: min(1100px, calc(100% - 40px)); margin: 0 auto; }
.kicker { font: 500 13px var(--font-mono); color: var(--accent); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 10px; }
.section h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); font-weight: 700; letter-spacing: -.02em; max-width: 22ch; text-wrap: balance; }
.section-lede { font-size: 1.15rem; color: var(--muted); max-width: 68ch; margin: 18px 0 0; }
.muted { color: var(--muted); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 48px 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 103px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 88px 1fr; gap: 32px; margin-bottom: 28px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 97px; top: 10px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.tl-year { font: 600 1.05rem var(--font-display); color: var(--ink); padding-top: 2px; white-space: nowrap; }
.tl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: 0 1px 0 rgba(0, 0, 0, .02); }
.tl-card h3 { font-size: 1.2rem; margin-bottom: 6px; }
.tl-card p { margin: 0; color: var(--muted); font-size: 1.02rem; }
.timeline li:first-child .tl-card { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(135deg, var(--accent-soft), var(--card) 60%); }

/* experience */
.jobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 40px; }
.job { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.job-when { font: 500 12px var(--font-mono); color: var(--accent); margin: 0 0 6px; }
.job h3 { font-size: 1.12rem; }
.job-org { margin: 2px 0 10px; font-weight: 600; color: var(--ink); font-size: 1rem; }
.job p:last-child { margin: 0; font-size: 1.02rem; color: var(--muted); }

/* recognition */
.two-col { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; margin-top: 40px; }
.col-title { font-size: 1.3rem; margin-bottom: 14px; }
.awards { list-style: none; margin: 0; padding: 0; }
.awards li { display: flex; gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 1.05rem; }
.awards li p { margin: 0; flex: 1; }
.awards li strong { color: var(--ink); font-weight: 700; }
.awards li span { font: 500 12px var(--font-mono); color: var(--muted); white-space: nowrap; }
.awards li.star strong::before { content: "★ "; color: #e0a92a; }
.big-number { margin: 0 0 10px; color: var(--muted); font-size: 1.1rem; }
.big-number span { font: 700 3rem/1 var(--font-display); color: var(--accent); margin-right: 8px; vertical-align: -6px; }
.sub { font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .95rem; color: var(--ink); padding: 5px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.plain { margin: 0; color: var(--muted); font-size: .95rem; }

/* about */
.about { display: grid; grid-template-columns: 160px 1fr; gap: 40px; align-items: start; }
.avatar {
  display: block; width: 160px; height: 160px; border-radius: 40px; object-fit: cover; object-position: 50% 20%;
  background: var(--accent-soft); border: 4px solid var(--card);
  box-shadow: var(--shadow); transform: rotate(-4deg);
}
.about p { color: var(--muted); max-width: 64ch; font-size: 1.12rem; }
.contact { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 500; font-size: .94rem; transition: transform .2s var(--ease), border-color .2s; }
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.footer { padding: 40px 20px calc(var(--dock-h) + 50px); text-align: center; color: var(--muted); font-size: .85rem; }


/* education extras */
.tl-org { margin: 0 0 8px !important; font-weight: 600; color: var(--ink) !important; font-size: 1rem; }

/* research interests */
.interests { display: flex; flex-wrap: wrap; gap: 12px; margin: 36px 0 8px; }
.interest { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font: 600 1.02rem var(--font-display); }
.interest span { font-size: 1.2rem; }
.scholar-card { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; margin-top: 40px; padding: 26px 28px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), var(--card) 70%); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.scholar-card h3 { font-size: 1.4rem; margin-bottom: 4px; }
.scholar-card p { margin: 0; color: var(--muted); max-width: 52ch; font-size: 1.05rem; }

/* plain lists (memberships, certification, reviewer conferences) */
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 1.05rem; }
.plain-list li strong { color: var(--accent); font-weight: 600; }
.plain-list.dated li { display: flex; gap: 16px; align-items: baseline; }
.plain-list.dated li span { flex: 1; color: var(--ink); }
.plain-list.dated time { font: 500 12px var(--font-mono); color: var(--muted); white-space: nowrap; }
#honours .awards { margin-top: 32px; max-width: 860px; }
#reviewer .big-number { margin-top: 24px; }

.section h2 em, .about h2 em { font-style: italic; font-weight: 600; color: var(--accent); }
.kicker, .eyebrow, .job-when, .pin-card-when, .sub { font-style: italic; letter-spacing: .03em; }
.kicker, .pin-card-when, .sub { text-transform: none; font-size: 15px; }
.tl-card h3, .job h3, .col-title, .theme h3 { font-weight: 700; }

/* ---------------------------------------------------------- RESPONSIVE */
@media (max-width: 820px) {
  .two-col, .about { grid-template-columns: 1fr; }
  .avatar { width: 110px; height: 110px; font-size: 1.9rem; border-radius: 30px; }
  .timeline::before { left: 8px; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; padding-left: 32px; }
  .timeline li::before { left: 2px; }
  .hero-tools .chip-link { display: none; }
  .pin .pin-label { display: none; }
  .pin.is-active .pin-label { display: block; }
  .dock a { padding: 0 12px; font-size: 13px; }
}
@media (max-width: 820px) and (orientation: portrait) {
  .pin-card { top: 46%; bottom: auto; }
}

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