/* Raphael Locsin — personal brand site */
:root {
  --ink: #14222e;
  --ink-soft: #2a3b4a;
  --muted: #5b6b78;
  --line: #d9e2e8;
  --paper: #ffffff;
  --ground: #f4f7f9;
  --tint: #e8f1f6;
  --brand: #0b4f72;
  --brand-bright: #106f9f;
  --brand-ink: #083a55;
  --accent: #c4a35a;
  --good: #1f7a4d;
  --good-bg: #e6f4ec;
  --bad: #a4262c;
  --bad-bg: #fbe9ea;
  --warn: #8a4b08;
  --warn-bg: #fff4e5;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(11, 61, 92, 0.08);
  --max: 1100px;
  --font: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--brand-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--brand-ink); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 247, 249, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
}
.logo-text { font-size: 15px; }
.logo-text span { display: block; font-weight: 400; color: var(--muted); font-size: 12px; line-height: 1.2; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: center;
}
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--brand);
  border-bottom-color: var(--brand-bright);
}
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ink);
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 0 4px;
  }
  .site-header .inner { flex-wrap: wrap; }
  .site-header.open .nav { display: flex; }
}

/* Layout */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}
.page { padding: 36px 0 72px; }
.page-narrow { max-width: 760px; }

/* Hero */
.hero {
  padding: 64px 0 48px;
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(16, 111, 159, 0.12), transparent 60%),
    linear-gradient(180deg, #eef4f8 0%, var(--ground) 100%);
  border-bottom: 1px solid var(--line);
}
.hero-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-bright);
  margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--font);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--brand-ink);
  text-wrap: balance;
}
.hero .lede {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 42rem;
  margin: 0 0 28px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn-primary:hover { background: var(--brand-ink); color: #fff; }
.btn-secondary {
  background: var(--paper);
  color: var(--brand);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--brand-bright); color: var(--brand-ink); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  padding-left: 8px;
  padding-right: 8px;
}

/* Cards */
.section { padding: 48px 0; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 24px;
}
.section-head h2 {
  font-family: var(--font);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin: 0;
  letter-spacing: -0.015em;
  color: var(--brand-ink);
}
.section-head p { margin: 6px 0 0; color: var(--muted); max-width: 48ch; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s;
}
a.card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-bright);
  color: inherit;
}
.card-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-bright);
}
.card h3 {
  font-family: var(--font);
  font-size: 1.35rem;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--brand-ink);
}
.card p { margin: 0; color: var(--muted); flex: 1; }
.card-cta {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-bright);
}

/* Intro / prose */
.prose {
  font-size: 1.05rem;
  color: var(--ink-soft);
}
.prose h2, .prose h3 {
  font-family: var(--font);
  color: var(--brand-ink);
  letter-spacing: -0.01em;
}
.prose h2 { font-size: 1.6rem; margin-top: 2.2em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.6em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  border-left: 3px solid var(--brand-bright);
  background: var(--tint);
  border-radius: 0 8px 8px 0;
  color: var(--ink);
}
.placeholder {
  background: #fff8e8;
  border: 1px dashed #d4b76a;
  color: #6b5310;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
}

/* Stats */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.stat .v {
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--brand-ink);
}
.stat .l {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Page title band */
.page-hero {
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #eef4f8, var(--ground));
}
.page-hero h1 {
  font-family: var(--font);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  color: var(--brand-ink);
}
.page-hero .sub {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
  font-size: 1.02rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #0b3d5c;
  color: #d7e4ee;
  padding: 36px 0 28px;
  font-size: 14px;
}
.site-footer a { color: #9dd3ee; }
.site-footer .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  gap: 18px;
  grid-template-columns: 2fr 1fr 1fr;
}
.site-footer h3 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9bb4c5;
  font-weight: 600;
}
.site-footer p, .site-footer ul { margin: 0; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer .fine {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 16px;
  color: #8fa7b8;
  font-size: 12px;
}
@media (max-width: 720px) {
  .site-footer .inner { grid-template-columns: 1fr; }
}

/* Research-specific */
.toc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 24px 0;
}
.toc ol { margin: 0; padding-left: 1.2em; }
.toc a { text-decoration: none; }
.download-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 24px 0;
}
.download-banner p { margin: 0; max-width: 48ch; opacity: 0.95; }
.download-banner .btn {
  background: #fff;
  color: var(--brand);
  border-color: #fff;
}
.download-banner .btn:hover { background: var(--tint); }

.figure {
  margin: 28px 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.figure figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

.definition {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 20px 0;
}
.definition strong { color: var(--brand-ink); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}


/* Hero with headshot */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}
.hero-photo {
  flex: none;
}
.hero-photo img {
  width: 240px;
  height: auto;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 3px solid #fff;
  background: #dce8f0;
}
@media (min-width: 900px) {
  .hero-photo img { width: 280px; }
}
@media (max-width: 720px) {
  .hero-grid {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .hero-photo { order: -1; }
  .hero-photo img { width: 160px; border-radius: 12px; }
}

/* About photo */
.about-photo {
  margin: 0 0 28px;
  max-width: 320px;
}
.about-photo img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 3px solid #fff;
}
.about-photo figcaption {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}
