/* Howard Kessa — personal site
   Minimal but considered. Zero JS, zero third-party assets.
   Design tokens: cream + deep navy + warm gold accent. System fonts only.
*/

:root {
  color-scheme: light dark;

  /* Palette — light */
  --bg: #f6f3ec;
  --bg-elev: #fbf9f3;
  --bg-card: #ffffff;
  --bg-glass: rgba(251, 249, 243, 0.72);
  --fg: #151a23;
  --fg-body: #2a3340;
  --fg-muted: #5a6574;
  --fg-soft: #8b94a2;
  --accent: #2f4a6b;
  --accent-ink: #1a2b42;
  --accent-soft: #e3e9f1;
  --gold: #9c7a3f;
  --gold-soft: #f1e5c9;
  --border: #e7e2d4;
  --border-strong: #d6cfbc;
  --shadow-sm: 0 1px 2px rgba(20, 30, 45, 0.04);
  --shadow-md: 0 4px 12px rgba(20, 30, 45, 0.06), 0 1px 2px rgba(20, 30, 45, 0.04);
  --shadow-lg: 0 8px 24px rgba(20, 30, 45, 0.08), 0 2px 4px rgba(20, 30, 45, 0.04);

  /* Geometry */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --content-max: 760px;
  --content-narrow: 640px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e14;
    --bg-elev: #10161d;
    --bg-card: #141b24;
    --bg-glass: rgba(16, 22, 29, 0.72);
    --fg: #e8ecf2;
    --fg-body: #c8d0db;
    --fg-muted: #8c97a6;
    --fg-soft: #5d6b7c;
    --accent: #8fb3d8;
    --accent-ink: #b8d2ed;
    --accent-soft: #1a2735;
    --gold: #d4b570;
    --gold-soft: #322a14;
    --border: #1e2731;
    --border-strong: #2a3542;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html {
  /* smooth hash-link jumps if any */
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg-body);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 90% -10%, rgba(47, 74, 107, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(156, 122, 63, 0.06), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  letter-spacing: -0.005em;
}

@media (prefers-color-scheme: dark) {
  body {
    background-image:
      radial-gradient(1200px 600px at 90% -10%, rgba(143, 179, 216, 0.08), transparent 60%),
      radial-gradient(900px 500px at -10% 20%, rgba(212, 181, 112, 0.05), transparent 60%);
  }
}

/* Layout */
.wrap {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

main { flex: 1; }

/* Sticky header with backdrop blur */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--bg-glass);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

.site-header .wrap {
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s;
}

.brand:hover { opacity: 0.82; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-ink) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.03em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 2px 6px rgba(47, 74, 107, 0.22);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  gap: 1px;
}

.brand-text .name {
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.brand-text .sub {
  font-size: 0.72rem;
  color: var(--fg-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0.1rem;
  transition: color 0.15s;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0.1rem;
  right: 0.1rem;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.site-nav a:hover { color: var(--fg); }
.site-nav a:hover::after { transform: scaleX(1); }

.site-nav a[aria-current="page"] {
  color: var(--fg);
}
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* Hero (index) */
.hero {
  position: relative;
  padding: 3.5rem 0 2rem;
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(156, 122, 63, 0.18);
}

.hero .eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 2.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  margin: 0 0 1rem;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--fg);
  font-weight: 700;
}

.hero .lede {
  font-size: 1.08rem;
  color: var(--fg-muted);
  max-width: 58ch;
  margin: 0 0 2.25rem;
  line-height: 1.6;
}

/* Link cards */
.link-cards {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .link-cards { grid-template-columns: 1fr 1fr; }
}

.link-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.15rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.link-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(47, 74, 107, 0.04), transparent 50%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .link-card::before {
    background: linear-gradient(135deg, rgba(143, 179, 216, 0.06), transparent 50%);
  }
}

.link-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.link-card:hover::before { opacity: 1; }

.link-card .label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}

.link-card .label svg {
  width: 12px;
  height: 12px;
}

.link-card .title {
  font-weight: 600;
  color: var(--fg);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.link-card .desc {
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.link-card .arrow {
  position: absolute;
  top: 1.15rem;
  right: 1.25rem;
  color: var(--fg-soft);
  transition: transform 0.2s ease, color 0.2s ease;
}

.link-card:hover .arrow {
  transform: translate(3px, -3px);
  color: var(--accent);
}

/* Status bar on home */
.status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 1rem 1.25rem;
  margin: 2rem 0 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.status .item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.status svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

/* Doc pages */
.doc {
  padding: 1rem 0;
}

.doc .doc-head {
  padding: 2.5rem 0 1.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.doc .doc-head .kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.doc .doc-head .kicker svg {
  width: 14px;
  height: 14px;
}

.doc h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.35rem);
  margin: 0 0 0.6rem;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--fg);
  font-weight: 700;
}

.doc .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  color: var(--fg-soft);
  font-size: 0.82rem;
}

.doc .meta .chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0;
}

.doc .meta .chip svg {
  width: 11px;
  height: 11px;
}

.doc .meta .dot {
  color: var(--fg-soft);
  opacity: 0.5;
}

.doc .body { max-width: var(--content-narrow); }

.doc h2 {
  font-size: 1.1rem;
  margin: 2.5rem 0 0.7rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc h2 svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

.doc p, .doc li {
  color: var(--fg-body);
  margin: 0 0 0.85rem;
}

.doc ul {
  padding-left: 1.35rem;
  margin: 0 0 1.1rem;
}

.doc ul li { margin-bottom: 0.4rem; }

.doc a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-thickness 0.15s;
}

.doc a:hover { text-decoration-thickness: 2px; }

.doc code {
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  font-size: 0.86em;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0;
}

@media (prefers-color-scheme: dark) {
  .doc code { color: var(--accent-ink); }
}

.callout {
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  padding: 1.1rem 1.3rem;
  margin: 1.5rem 0 2rem;
  border-radius: var(--radius-sm);
}

.callout p { margin: 0 0 0.6rem; }
.callout p:last-child { margin-bottom: 0; }
.callout strong {
  color: var(--fg);
  font-weight: 700;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  margin-top: 4rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  color: var(--fg-soft);
  font-size: 0.85rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.site-footer .legal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.site-footer .legal svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.site-footer nav {
  display: flex;
  gap: 1.25rem;
}

.site-footer a {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer a:hover { color: var(--accent); }

/* Selection */
::selection {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
