/* ==========================================================================
   JamShark - shared styles
   ========================================================================== */

/* Self-hosted fonts (Inter, Space Grotesk - both OFL-licensed, see
   /assets/fonts/LICENSE-*.txt) instead of loading from Google's servers,
   so visitors' IP addresses aren't sent to a third party just to render text. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/inter-700.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk-500.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk-600.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk-700.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-alt: #0f1620;
  --surface: #131b25;
  --surface-hover: #1a2430;
  --border: #223040;
  --text: #e8eef4;
  --text-dim: #9fb1c1;
  --text-faint: #6b7d8d;
  --accent: #8a2a2a;       /* shark red, muted for dark backgrounds */
  --accent-strong: #5e1c1c;
  --link: var(--accent);
  --radius: 12px;
  --max-width: 1120px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", var(--font-body);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f7f9fb;
    --bg-alt: #eef2f6;
    --surface: #ffffff;
    --surface-hover: #f0f4f8;
    --border: #dbe4ec;
    --text: #101820;
    --text-dim: #46566405;
    --text-dim: #465664;
    --text-faint: #6b7d8d;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { color: var(--text-dim); margin: 0 0 1em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  left: -9999px;
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  top: -999px;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
}
.skip-link:focus { top: 0; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
@media (prefers-color-scheme: light) {
  .site-header { background: rgba(247, 249, 251, 0.85); }
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--text-faint);
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a {
    display: block;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
  }
  .nav-toggle { display: inline-flex; }
}

/* ---- Hero ---- */
.hero {
  padding: 96px 0 72px;
  border-bottom: 1px solid var(--border);
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  max-width: 18ch;
  margin-bottom: 0.1em;
}
.terminal-h1::before {
  content: ">";
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;
  margin-right: 12px;
}
.terminal-h1::after {
  content: "_";
  display: inline-block;
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .terminal-h1::after { animation: none; }
}
.hero-subtitle {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 18px;
}
.hero .lead {
  font-size: 1.15rem;
  max-width: 60ch;
  color: var(--text-dim);
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.card .hero-actions {
  margin-top: auto;
  padding-top: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform 0.15s ease, background 0.15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-strong); }

/* ---- Sections ---- */
section { padding: 72px 0; }
.section-head { max-width: 60ch; margin-bottom: 40px; }
.section-head .kicker {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.grid {
  display: grid;
  gap: 24px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin-bottom: 8px; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); }
.card h3 + p { flex-grow: 1; }

.repo-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  max-width: 28px;
  max-height: 28px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.card h3 {
  min-width: 0;
  flex-wrap: wrap;
}
.card h3 a {
  min-width: 0;
  overflow-wrap: anywhere;
}
.repo-meta {
  color: var(--text-faint);
  font-size: 0.82rem;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 6px;
}
.tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(138, 42, 42, 0.14);
  border: 1px solid rgba(138, 42, 42, 0.4);
  border-radius: 999px;
  padding: 4px 10px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.stat .num {
  display: block;
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}
.stat .label {
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* ---- Identity / sameAs strip ---- */
.identity-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.identity-strip a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
}
.identity-strip a:hover {
  color: var(--text);
  border-color: var(--accent);
  text-decoration: none;
}

/* ---- Timeline (horizontal activity strip) ---- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 6px 4px 20px;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.timeline li {
  position: relative;
  flex: 0 0 240px;
  scroll-snap-align: start;
  padding: 16px 4px 0;
  border-top: 2px solid var(--accent);
}
.timeline li::before {
  content: "";
  position: absolute;
  top: -6px;
  left: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline .when {
  font-size: 0.8rem;
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.timeline p { font-size: 0.92rem; }
.timeline .repo-meta { margin-top: 6px; }
@media (max-width: 720px) {
  .timeline li { flex-basis: 210px; }
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 40px;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links a { color: var(--text-dim); font-size: 0.9rem; }
.footer-note { color: var(--text-faint); font-size: 0.85rem; margin-top: 20px; }

/* ---- Utility ---- */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.eyebrow-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--text-faint); }

.callout {
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.prose h2 { margin-top: 2em; }
.prose ul { color: var(--text-dim); padding-left: 1.2em; }
.prose li { margin-bottom: 0.5em; }
