/* ============================================================
   Keeley Tan Trading — static site
   Recorded brand palette:
   Obsidian Black #0D0D0D · Off-White #F5F5F5
   Steel Blue #457B9D (primary accent) · Signal Red #E63946 (sparing, ~3%)
   Fonts: Montserrat (headlines) · Inter (body)
   ============================================================ */
:root {
  --bg: #0D0D0D;
  --bg-alt: #141414;
  --bg-card: #161719;
  --ink: #F5F5F5;
  --ink-soft: #A8AEB4;
  --line: #26292d;
  --accent: #457B9D;
  --accent-hi: #5d97bb;
  --accent-tint: rgba(69,123,157,.14);
  --red: #E63946;
  --maxw: 1080px;
  --radius: 10px;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Montserrat", var(--font-body);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-hi); text-decoration: none; }
a:hover { color: #7fb0cf; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.18; font-weight: 700; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section--alt { background: var(--bg-alt); }
.section--tight { padding: 56px 0; }
.center { text-align: center; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }
.center .lead { margin-left: auto; margin-right: auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; font-weight: 600; font-family: var(--font-head); color: var(--accent-hi); margin: 0 0 14px; }

.btn { display: inline-block; padding: 14px 26px; border-radius: var(--radius); font-weight: 600; font-size: .98rem; font-family: var(--font-head); border: 1px solid transparent; cursor: pointer; transition: transform .08s ease, background .15s ease, border-color .15s ease; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hi); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }
.center .btn-row { justify-content: center; }

/* ---- Layout: fixed left sidebar + offset main ---- */
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { color: var(--ink); }
.brand-name { font-size: 1.05rem; }

/* ---- Animated logo (sidebar = draw-on once; topbar = compact static) ---- */
.brand-logo { display:block; width:200px; aspect-ratio:1400 / 1103;
  background:url("../logo.png") center / contain no-repeat; }
.sidebar .brand { display:block; }
.sidebar .brand-logo {
  opacity:0; clip-path:polygon(0 0, 0 0, -22% 100%, -22% 100%);
  animation:kt-brand-draw 1.9s cubic-bezier(.22,.61,.36,1) .15s forwards; }
@keyframes kt-brand-draw {
  0%   { opacity:0; clip-path:polygon(0 0, 0 0, -22% 100%, -22% 100%); }
  8%   { opacity:1; }
  100% { opacity:1; clip-path:polygon(0 0, 138% 0, 116% 100%, 0 100%); } }
.topbar .brand-logo { width:auto; height:40px; }
@media (prefers-reduced-motion:reduce) {
  .sidebar .brand-logo { animation:none; clip-path:none; opacity:1; } }
.vh { position:absolute !important; width:1px; height:1px; padding:0;
  margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 264px;
  background: var(--bg-alt); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 26px 22px;
  overflow-y: auto; z-index: 60;
}
.sidebar-tag { font-size: .82rem; color: var(--ink-soft); line-height: 1.45; margin: 10px 0 26px; }
.side-group { margin-bottom: 22px; }
.side-group h4 { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .12em; font-size: .67rem; color: var(--ink-soft); margin: 0 0 9px; font-weight: 700; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { color: var(--ink-soft); font-size: .93rem; font-weight: 500; padding: 7px 10px; border-radius: 7px; line-height: 1.3; }
.side-nav a:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.side-nav a.is-active { color: var(--ink); background: var(--accent-tint); }
.side-nav a[aria-disabled="true"] { opacity: .5; cursor: default; }
.side-nav a[aria-disabled="true"]:hover { background: none; color: var(--ink-soft); }
.side-cta { margin-top: auto; padding-top: 20px; }
.side-cta .btn { display: block; text-align: center; }
.sidebar-foot { margin-top: 16px; font-size: .72rem; color: var(--ink-soft); line-height: 1.5; }

.site-main { margin-left: 264px; }

.topbar { display: none; }
.scrim { display: none; }
.nav-toggle { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--ink); }

.hero { padding: 96px 0 72px; }
.hero h1 { max-width: 16ch; }
.hero .lead { margin-top: 18px; margin-bottom: 30px; }
.hero-note { margin-top: 18px; font-size: .9rem; color: var(--ink-soft); display: flex; align-items: center; gap: 9px; }
.hero-note::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; box-shadow: 0 0 0 4px rgba(230,57,70,.16); }
.center .hero-note { justify-content: center; }

.track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--bg-card); padding: 34px 22px; text-align: center; }
.stat__num { font-family: var(--font-head); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; color: var(--accent-hi); letter-spacing: -.02em; }
.stat__label { font-size: .86rem; color: var(--ink-soft); margin-top: 6px; }
.track-caption { margin-top: 16px; font-size: .85rem; color: var(--ink-soft); text-align: center; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; align-items: start; }
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; }
.card h3 { color: var(--ink); }
.card__icon { width: 38px; height: 38px; border-radius: 9px; background: var(--accent-tint); color: var(--accent-hi); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; margin-bottom: 16px; }
.list-check { list-style: none; padding: 0; margin: 0; }
.list-check li { padding: 8px 0 8px 28px; position: relative; }
.list-check li::before { content: "\2713"; position: absolute; left: 0; top: 8px; color: var(--accent-hi); font-weight: 700; }

.quote { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.quote p { font-size: 1.02rem; }
.quote cite { display: block; margin-top: 14px; font-style: normal; font-weight: 600; font-size: .92rem; }
.quote cite span { color: var(--ink-soft); font-weight: 400; }

.cta-band { background: linear-gradient(135deg, #2f5970 0%, var(--accent) 100%); color: #fff; border-radius: var(--radius); padding: 56px 40px; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.86); max-width: 52ch; margin-left: auto; margin-right: auto; }
.cta-band .btn--primary { background: #fff; color: #1c3a4c; }
.cta-band .btn--primary:hover { background: #e9eef1; color: #1c3a4c; }
.cta-band .btn--ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.cta-band .btn--ghost:hover { border-color: #fff; color: #fff; }

.posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.post-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: var(--bg-card); }
.post-card h2 { font-size: 1.3rem; margin-bottom: 8px; }
.post-card h2 a { color: var(--ink); }
.post-card h2 a:hover { color: var(--accent-hi); }
.post-meta { font-size: .82rem; color: var(--ink-soft); margin-bottom: 14px; }
.post-card .excerpt { color: var(--ink-soft); font-size: .98rem; }
.read-more { font-weight: 600; font-size: .92rem; }

.article { max-width: 720px; margin: 0 auto; }
.article h1 { margin-bottom: 10px; }
.article .post-meta { margin-bottom: 32px; }
.article-body h2 { margin-top: 1.6em; }
.article-body img { border-radius: var(--radius); margin: 1.5em 0; }
.article-body blockquote { border-left: 3px solid var(--accent); margin: 1.5em 0; padding: 4px 0 4px 22px; color: var(--ink-soft); font-style: italic; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }

.site-footer { border-top: 1px solid var(--line); padding: 32px 0; font-size: .82rem; color: var(--ink-soft); }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--ink); }

.disclaimer { font-size: .78rem; color: var(--ink-soft); max-width: 70ch; margin: 0 auto; text-align: center; }

@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; width: 280px; box-shadow: 0 0 40px rgba(0,0,0,.5); }
  body.nav-open .sidebar { transform: translateX(0); }
  .site-main { margin-left: 0; }
  .topbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; height: 60px; padding: 0 18px; background: rgba(13,13,13,.92); border-bottom: 1px solid var(--line); backdrop-filter: saturate(160%) blur(8px); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 55; }
}
@media (max-width: 860px) {
  .track { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; gap: 28px; }
  .posts { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .track { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .cta-band { padding: 40px 22px; }
}
