/* Self-hosted (OFL) so the page makes no third-party requests. */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 300 600; font-display: swap; src: url(/assets/fonts/cormorant-garamond.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 300 400; font-display: swap; src: url(/assets/fonts/cormorant-garamond-italic.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 300 500; font-display: swap; src: url(/assets/fonts/dm-sans.woff2) format('woff2'); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: oklch(97.5% 0.006 215);
  --bg2: oklch(93% 0.009 215);
  --text: oklch(14% 0.014 220);
  --text-muted: oklch(46% 0.01 220);
  --accent: oklch(62% 0.16 210);
  --accent-light: oklch(93% 0.04 210);
  --rule: oklch(84% 0.009 215);
  --sidebar-w: 268px;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
}
html, body { min-height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
* { transition: color 0.3s, background-color 0.3s, border-color 0.3s; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; text-align: left; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; color: var(--accent); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── Shared ── */
.label { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: 8px; }
.rule { border: none; border-top: 1px solid var(--rule); margin: 40px 0; }
.display { font-family: var(--font-serif); font-size: 3rem; font-weight: 300; line-height: 1.1; margin-bottom: 12px; }
.lead { color: var(--text-muted); font-weight: 300; max-width: 460px; line-height: 1.75; }
.body { font-size: 1.05rem; font-weight: 300; line-height: 1.85; color: var(--text-muted); max-width: 560px; }
.muted-note { font-size: 0.72rem; color: var(--text-muted); font-weight: 300; margin-top: 10px; opacity: 0.5; font-style: italic; }
.serif { font-family: var(--font-serif); }

/* ── Sidebar ── */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 268px; border-right: 1px solid var(--rule); display: flex; flex-direction: column; padding: 44px 36px; z-index: 20; background: var(--bg); }
.brand { padding: 0; margin-bottom: 44px; }
.brand img { width: 48px; height: 48px; object-fit: contain; display: block; margin-bottom: 14px; }
.brand-name { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.brand-url { font-size: 0.72rem; color: var(--text-muted); font-weight: 300; margin-top: 3px; letter-spacing: 0.04em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: block; width: 100%; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 300; color: var(--text-muted); padding: 7px 0; }
.nav button:hover { color: var(--text); }
.nav button.active { font-weight: 500; color: var(--accent); }
.side-foot { margin-top: auto; }
.socials { display: flex; gap: 14px; margin-bottom: 16px; }
.socials a { color: var(--text-muted); display: block; }
.socials a:hover { color: var(--accent); }
.copy { font-size: 0.72rem; color: var(--text-muted); font-weight: 300; }

/* ── Page ── */
.page-main { margin-left: var(--sidebar-w); min-height: 100vh; padding: 72px 80px 80px 68px; max-width: calc(var(--sidebar-w) + 800px); }
.page { display: none; }
.page.active { display: block; animation: fadeUp 0.4s ease; }

/* ── Home ── */
.home-h1 { font-family: var(--font-serif); font-size: clamp(2.6rem, 4.2vw, 3.8rem); font-weight: 300; line-height: 1.07; letter-spacing: -0.01em; margin-bottom: 28px; }
.grid-2col { display: grid; grid-template-columns: repeat(2, 1fr); }
.tiles { gap: 2px; }
.tile { border: 1px solid var(--rule); padding: 26px 24px; transition: background 0.2s, border-color 0.2s; }
.tile:hover { background: var(--accent-light); border-color: var(--accent); }
.tile-title { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; margin-bottom: 6px; }
.tile-desc { font-size: 0.82rem; color: var(--text-muted); font-weight: 300; }

/* ── About: sport sections ── */
.sport { margin-bottom: 48px; }
.sport h2 { font-family: var(--font-serif); font-size: 2rem; font-weight: 300; margin-bottom: 12px; }
.sport p { font-size: 0.92rem; color: var(--text-muted); font-weight: 300; max-width: 520px; line-height: 1.8; margin-bottom: 28px; }
.big-num { font-family: var(--font-serif); font-size: 2.4rem; font-weight: 600; }
.big-num small { font-size: 1rem; font-weight: 300; color: var(--text-muted); }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 12px; }
.bar-head span:last-child, .bar-foot { font-size: 0.78rem; color: var(--text-muted); font-weight: 300; }
.bar { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar-foot { margin-top: 8px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-bottom: 3px; }
.stat { background: var(--bg2); padding: 16px 18px; }
.stat-label, .seg-k { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; opacity: 0.6; margin-bottom: 2px; }
.stat-val { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.stat-val small { font-size: 0.85rem; font-weight: 300; color: var(--text-muted); }
.months { background: var(--bg2); padding: 18px 18px 12px; }
.months-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 90px; }
.months-bars div { background: var(--accent); opacity: 0.75; border-radius: 2px 2px 0 0; min-height: 2px; }
.months-bars div:hover { opacity: 1; }
.months-axis { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; margin-top: 6px; font-size: 0.62rem; color: var(--text-muted); text-align: center; text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Segments ── */
.segs { gap: 3px; }
.seg { display: flex; flex-direction: column; background: var(--bg2); padding: 22px 20px 18px; border-bottom: 2px solid transparent; transition: background 0.2s, border-color 0.2s; }
.seg:hover { background: var(--accent-light); border-bottom-color: var(--accent); }
.seg-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.seg-name { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; line-height: 1.2; margin-bottom: 3px; }
.seg-loc { font-size: 0.7rem; color: var(--text-muted); font-weight: 300; letter-spacing: 0.04em; }
.seg-pr { text-align: right; flex-shrink: 0; margin-left: 12px; }
.seg-pr div:first-child { font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: 2px; }
.seg-pr div:last-child { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; letter-spacing: -0.02em; }
.seg-inner { display: flex; gap: 16px; align-items: center; }
.seg-inner svg { flex-shrink: 0; display: block; }
.seg-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; flex: 1; }
.seg-v { font-size: 0.88rem; font-family: var(--font-serif); }
.seg-elev { margin-top: 14px; border-top: 1px solid var(--rule); padding-top: 10px; }
.seg-elev .seg-k { opacity: 0.5; margin-bottom: 4px; font-weight: 400; }
.seg-elev svg { display: block; }

/* ── Projects ── */
.project { border-top: 1px solid var(--rule); padding-top: 36px; margin-bottom: 8px; }
.project-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 4px; flex-wrap: wrap; }
.project-head h2 { font-family: var(--font-serif); font-size: 2.1rem; font-weight: 600; }
.wip { font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; background: var(--accent); color: white; padding: 3px 9px; border-radius: 2px; font-weight: 500; }
.year { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); font-weight: 300; }
.tagline { font-family: var(--font-serif); font-style: italic; font-size: 1.05rem; color: var(--text-muted); margin-bottom: 14px; font-weight: 300; }
.desc { font-size: 0.9rem; color: var(--text-muted); font-weight: 300; max-width: 560px; line-height: 1.8; margin-bottom: 26px; }
.feat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 560px; margin-bottom: 24px; }
.feat { background: var(--bg2); padding: 15px 18px; border-radius: 2px; }
.feat div:first-child { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: 5px; }
.feat div:last-child { font-size: 0.82rem; color: var(--text-muted); font-weight: 300; line-height: 1.6; }
.links { display: flex; gap: 20px; flex-wrap: wrap; }
.arrow-link { font-size: 0.8rem; color: var(--accent); font-weight: 500; letter-spacing: 0.06em; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.arrow-link:hover { border-bottom-color: var(--accent); }

/* ── Blog / chess ── */
.tabs { display: flex; margin-bottom: 44px; border-bottom: 1px solid var(--rule); }
.tabs span { padding: 10px 20px 10px 0; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 300; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs span.on { font-weight: 500; color: var(--accent); border-bottom-color: var(--accent); }
.tabs span.off { opacity: 0.4; }
.tabs small { font-size: 0.65rem; opacity: 0.6; }
.game { border-top: 1px solid var(--rule); }
.game-head { width: 100%; padding: 26px 0; display: flex; align-items: center; gap: 20px; }
.game-num { font-family: var(--font-serif); font-size: 0.85rem; color: var(--text-muted); font-style: italic; min-width: 24px; }
.game-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 3px; flex-wrap: wrap; }
.game-title span:first-child { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 600; }
.game-title b { font-weight: 300; }
.result { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; }
.result.win { color: var(--accent); }
.game-sub { font-size: 0.82rem; color: var(--text-muted); font-weight: 300; }
.plus { font-size: 1.1rem; color: var(--text-muted); transition: transform 0.25s ease; line-height: 1; margin-left: auto; }
.game.open .plus { transform: rotate(45deg); }
.game-body { display: none; padding-bottom: 36px; animation: fadeUp 0.25s ease; }
.game.open .game-body { display: block; }
.game-elo { font-size: 0.78rem; color: var(--text-muted); font-weight: 300; margin-bottom: 6px; }
.game-note { font-size: 0.88rem; color: var(--text-muted); font-style: italic; font-weight: 300; line-height: 1.75; margin-bottom: 20px; max-width: 500px; }
.chess-wrap { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.board { display: grid; grid-template-columns: 16px repeat(8, 26px); grid-template-rows: repeat(8, 26px) 16px; }
.board .coord { display: flex; align-items: center; justify-content: center; font-size: 0.6rem; color: var(--text-muted); }
.board .file { align-items: flex-start; padding-top: 3px; }
.sq { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; user-select: none; position: relative; background: var(--bg2); }
.sq.l { background: var(--bg); }
.sq.hl { background: var(--accent-light); }
.sq.to { border: 1px solid var(--accent); }
.sq.to::before { content: ""; position: absolute; inset: 0; background: var(--accent); opacity: 0.15; }
.sq span { position: relative; color: var(--accent); }
.sq span.w { color: var(--text); text-shadow: 0 0 1px rgba(0,0,0,0.3); }
.chess-ctrl { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 4px; }
.chess-ctrl button { color: var(--text-muted); font-size: 0.72rem; padding: 4px 6px; font-weight: 300; }
.chess-ctrl button:disabled { color: var(--rule); cursor: default; }
.chess-ctrl span { font-size: 0.7rem; color: var(--text-muted); font-weight: 300; min-width: 50px; text-align: center; }
.chess-hint { font-size: 0.68rem; color: var(--text-muted); text-align: center; margin-top: 4px; opacity: 0.5; }
.chess-movelist { flex: 1; min-width: 160px; max-width: 240px; max-height: 224px; overflow-y: auto; }
.moves { display: grid; grid-template-columns: auto 1fr 1fr; gap: 1px 4px; font-size: 0.75rem; font-family: monospace; }
.moves .n { color: var(--text-muted); opacity: 0.45; text-align: right; padding: 2px 4px; }
.moves button { padding: 2px 5px; border-radius: 2px; color: var(--text-muted); font-weight: 300; font-family: monospace; }
.moves button.on { background: var(--accent-light); color: var(--accent); font-weight: 500; }
.final { margin-top: 10px; font-size: 0.7rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0.04em; }

/* ── Contact ── */
.contact-list { display: flex; flex-direction: column; gap: 3px; }
.contact { display: flex; align-items: center; gap: 22px; padding: 26px 22px; background: var(--bg2); border-left: 2px solid transparent; transition: background 0.2s, border-color 0.2s; }
.contact:hover { background: var(--accent-light); border-left-color: var(--accent); }
.contact svg { color: var(--accent); }
.contact-name { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 600; margin-bottom: 3px; }
.contact-sub { font-size: 0.82rem; color: var(--text-muted); font-weight: 300; }

/* ── Mobile ── */
#mob-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.38); z-index: 18; }
#mob-overlay.visible { display: block; }
#hamburger { display: none; position: fixed; top: 14px; right: 14px; z-index: 22; background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; width: 40px; height: 40px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; }
#hamburger span { display: block; width: 18px; height: 1.5px; background: var(--text); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
#hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
#hamburger.open span:nth-child(2) { opacity: 0; }
#hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  #hamburger { display: flex; top: 8px; }
  /* Bar behind the menu button so scrolled text doesn't run under it. */
  body::before { content: "Shivang Arya"; position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 17; padding-left: 22px; line-height: 56px; font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; background: var(--bg); border-bottom: 1px solid var(--rule); }
  .sidebar { transform: translateX(-268px); transition: transform 0.3s cubic-bezier(.4,0,.2,1); }
  .sidebar.mob-open { transform: none; box-shadow: 4px 0 32px rgba(0,0,0,0.12); }
  .page-main { padding: 88px 22px 64px; max-width: 100%; }
  .grid-2col, .feat-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .chess-wrap { flex-direction: column; }
  .chess-movelist { max-height: 180px; }
  .home-h1 { font-size: clamp(2.2rem, 9vw, 3rem); }
}
