/* Shared design tokens and components for tharuka.xyz and the learning hub. */
:root {
  /* Palette from the profile photo: amber backdrop, black outfit, yellow lenses. */
  --brand: #f5a623;
  --brand-ink: #111111;
  --yellow: #ffd23f;
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --bg-soft: #faf7f2;
  --text: #111111;
  --muted: #5c5650;
  --border: #ece7df;
  --accent: #b45309;
  --accent-2: #b45309;
  --accent-soft: rgba(245, 166, 35, 0.16);
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1120px;
  --font: "Inter", "Noto Sans Sinhala", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Noto Sans Sinhala", var(--font);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0e0e0e;
  --bg-elev: #161616;
  --bg-soft: #1c1b19;
  --text: #f2efe9;
  --muted: #a8a29a;
  --border: #2a2825;
  --accent: #f5a623;
  --accent-2: #f5a623;
  --accent-soft: rgba(245, 166, 35, 0.14);
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.grad-text { color: inherit; background: linear-gradient(transparent 62%, var(--brand) 62%, var(--brand) 92%, transparent 92%); padding: 0 0.08em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
[data-theme="dark"] .grad-text { color: var(--brand); background: none; padding: 0; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; color: var(--text); font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--brand);
  display: grid; place-items: center; color: var(--brand-ink); font-size: 0.85rem; letter-spacing: 0;
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--muted); font-size: 0.92rem; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.nav .nav-cta { color: var(--text); border: 1px solid var(--border); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text); display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .menu-toggle { display: grid; }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--bg-elev); border-bottom: 1px solid var(--border); padding: 12px 20px 20px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .header-actions { margin-left: auto; }
}
.header-actions { display: flex; gap: 8px; }

/* Buttons and chips */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 12px;
  font-weight: 600; font-size: 0.95rem; border: 1px solid var(--border); color: var(--text);
  background: var(--bg-elev); transition: transform 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--accent); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { border-color: var(--text); opacity: 0.88; }
.btn svg { width: 18px; height: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.chip {
  font-size: 0.78rem; font-weight: 500; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-soft); color: var(--muted); border: 1px solid var(--border);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent);
}

.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: 64px; color: var(--muted); font-size: 0.9rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.socials { display: flex; gap: 8px; }
.socials a { color: var(--muted); }
.socials a:hover { color: var(--accent); }
.socials svg { width: 20px; height: 20px; }

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

/* A complementary cobalt "pop" colour, used sparingly against the amber. */
:root { --pop: #2f54eb; --pop-ink: #ffffff; }
[data-theme="dark"] { --pop: #5b7cff; }

/* Dotted backdrop used behind heroes. */
.hero-dots {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 16%, transparent) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at 75% 30%, #000 0%, transparent 65%);
  mask-image: radial-gradient(ellipse at 75% 30%, #000 0%, transparent 65%);
}
.eyebrow .num {
  display: inline-grid; place-items: center; min-width: 28px; height: 20px; padding: 0 6px; border-radius: 6px;
  background: var(--text); color: var(--bg); font-size: 0.7rem; letter-spacing: 0.04em;
}
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--accent-soft); }
