/* ============================================================
   Richard Vallejo — personal site
   Design system: navy ink, cool off-white, one signal accent.
   Editorial serif headlines + grotesk sans UI/body.
   ============================================================ */

:root {
  /* type — overridden live by Tweaks */
  --font-display: "Newsreader", Georgia, serif;
  --font-sans: "Libre Franklin", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* accent — overridden live by Tweaks */
  --accent: oklch(0.62 0.13 230);
  --accent-ink: oklch(0.45 0.12 235);
  --accent-soft: oklch(0.62 0.13 230 / 0.10);

  /* neutrals (cool navy-tinted) */
  --ink:        oklch(0.23 0.024 250);
  --ink-2:      oklch(0.40 0.022 250);
  --ink-3:      oklch(0.55 0.018 250);
  --line:       oklch(0.90 0.010 250);
  --line-2:     oklch(0.94 0.008 250);
  --paper:      oklch(0.985 0.004 250);
  --paper-2:    oklch(0.965 0.006 250);
  --white:      oklch(0.995 0.002 250);

  /* dark surfaces (navy command) */
  --navy:       oklch(0.205 0.030 256);
  --navy-2:     oklch(0.255 0.034 256);
  --navy-line:  oklch(0.34 0.030 256);
  --navy-ink:   oklch(0.93 0.012 250);
  --navy-ink-2: oklch(0.72 0.018 250);

  --radius: 4px;
  --radius-lg: 8px;
  --maxw: 1160px;
  --gutter: clamp(20px, 5vw, 64px);

  --shadow-sm: 0 1px 2px oklch(0.2 0.03 256 / 0.06), 0 1px 1px oklch(0.2 0.03 256 / 0.04);
  --shadow-md: 0 4px 16px oklch(0.2 0.03 256 / 0.08), 0 1px 3px oklch(0.2 0.03 256 / 0.05);
  --shadow-lg: 0 18px 50px oklch(0.2 0.03 256 / 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- typography ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.07;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}
.serif { font-family: var(--font-display); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
  font-weight: 500;
  margin: 0;
}
.eyebrow.on-dark { color: var(--accent); }
.lede {
  font-size: clamp(17px, 1.4vw, 20px);
  color: var(--ink-2);
  line-height: 1.6;
  text-wrap: pretty;
}

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 8vw, 104px); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14.5px; font-weight: 500;
  padding: 11px 20px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-3); background: var(--white); }
.btn-ghost.on-dark { color: var(--navy-ink); border-color: var(--navy-line); }
.btn-ghost.on-dark:hover { border-color: var(--navy-ink-2); background: oklch(1 0 0 / 0.05); }
.btn .arr { transition: transform .18s ease; }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: oklch(0.985 0.004 250 / 0.82);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav.on-dark {
  background: oklch(0.205 0.030 256 / 0.82);
  border-bottom-color: var(--navy-line);
  color: var(--navy-ink);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.brand-mark {
  width: 30px; height: 30px; flex: none; position: relative;
  display: grid; place-items: center;
}
.brand-name { font-family: var(--font-display); font-size: 18.5px; letter-spacing: -0.01em; font-weight: 500; }
.brand-sub { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.nav.on-dark .brand-sub { color: var(--navy-ink-2); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 14px; font-weight: 500; padding: 8px 13px; border-radius: var(--radius);
  color: var(--ink-2); cursor: pointer; transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--ink); background: var(--paper-2); }
.nav-link.active { color: var(--ink); }
.nav.on-dark .nav-link { color: var(--navy-ink-2); }
.nav.on-dark .nav-link:hover, .nav.on-dark .nav-link.active { color: var(--navy-ink); background: oklch(1 0 0 / 0.06); }
.nav-link.active::after {
  content: ""; display: block; height: 2px; background: var(--accent);
  margin-top: 6px; border-radius: 2px;
}

/* ---------- placeholder media ---------- */
.ph {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg,
      oklch(0.92 0.012 250) 0 11px,
      oklch(0.955 0.008 250) 11px 22px);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--ink-3);
}
.ph.on-dark {
  background:
    repeating-linear-gradient(135deg,
      oklch(0.27 0.030 256) 0 11px,
      oklch(0.235 0.030 256) 11px 22px);
  border-color: var(--navy-line);
  color: var(--navy-ink-2);
}
.ph-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; background: var(--paper);
  padding: 5px 10px; border-radius: 100px; border: 1px solid var(--line);
}
.ph.on-dark .ph-label { background: var(--navy); border-color: var(--navy-line); }

/* ---------- chips / tags ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em;
  color: var(--ink-2); background: var(--white);
  border: 1px solid var(--line); padding: 5px 11px; border-radius: 100px;
}
.chip.accent { color: var(--accent-ink); border-color: var(--accent-soft); background: var(--accent-soft); }

/* ---------- cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.card.hover:hover { border-color: var(--ink-3); box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ---------- article list ---------- */
.article-row {
  display: grid; grid-template-columns: 1fr; gap: 6px;
  padding: 26px 0; border-top: 1px solid var(--line); cursor: pointer;
}
.article-row:hover .article-title { color: var(--accent-ink); }
.article-title {
  font-family: var(--font-display); font-size: clamp(21px, 2.2vw, 27px);
  line-height: 1.18; letter-spacing: -0.01em; transition: color .15s; text-wrap: balance;
}
.article-meta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 13px; color: var(--ink-3); font-family: var(--font-mono); letter-spacing: 0.02em; }
.article-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }

/* ---------- prose (article body) ---------- */
.prose { font-size: 19px; line-height: 1.72; color: var(--ink-2); max-width: 680px; }
.prose p { margin: 0 0 1.35em; text-wrap: pretty; }
.prose h2 { font-family: var(--font-display); font-size: 27px; color: var(--ink); margin: 1.8em 0 0.5em; letter-spacing: -0.01em; }
.prose h3 { font-family: var(--font-sans); font-weight: 650; font-size: 19px; color: var(--ink); margin: 1.6em 0 0.4em; }
.prose ul { padding-left: 1.1em; margin: 0 0 1.35em; }
.prose li { margin: 0.35em 0; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--accent);
  font-family: var(--font-display); font-size: 22px; line-height: 1.4; color: var(--ink);
}
.prose a.link { color: var(--accent-ink); border-bottom: 1px solid var(--accent-soft); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: 0.01em; }
.field input, .field textarea {
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; transition: border-color .15s, box-shadow .15s; width: 100%;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field.err input, .field.err textarea { border-color: oklch(0.58 0.16 25); }
.field-err { font-size: 12.5px; color: oklch(0.55 0.16 25); font-weight: 500; }

/* ---------- footer ---------- */
.footer { background: var(--navy); color: var(--navy-ink); padding-block: 64px 40px; }
.footer a:hover { color: #fff; }

/* ---------- misc ---------- */
.metric-num { font-family: var(--font-display); font-size: clamp(34px, 4vw, 52px); line-height: 1; letter-spacing: -0.02em; }
.fade-up { } /* entrance handled by JS-free always-visible state for robustness */

.kicker-line { display: inline-flex; align-items: center; gap: 12px; }
.kicker-line::before { content: ""; width: 26px; height: 1px; background: var(--accent); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 64px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .nav-links .nav-hide-sm { display: none; }
}

.link-arrow { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-ink); font-weight: 600; font-size: 14.5px; cursor: pointer; }
.link-arrow .arr { transition: transform .18s; }
.link-arrow:hover .arr { transform: translateX(3px); }

/* ---------- bento (home direction 3) ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(132px, auto);
  gap: 16px;
}
.bento > div { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; }
.bento-hero { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 3vw, 40px) !important; }
.bento-portrait { grid-column: span 2; grid-row: span 2; padding: 0 !important; overflow: hidden; }
.bento-cert { grid-column: span 1; grid-row: span 1; }
.bento-metric { grid-column: span 1; }
.bento-feature { grid-column: span 2; transition: border-color .18s, box-shadow .18s; }
.bento-feature:hover, .bento-cert:hover { border-color: var(--ink-3); box-shadow: var(--shadow-sm); }
@media (max-width: 920px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-hero, .bento-portrait, .bento-feature { grid-column: span 2; }
  .bento-portrait { min-height: 280px; grid-row: span 1; }
  .bento-hero { grid-row: span 1; }
}
@media (max-width: 540px) {
  .bento { grid-template-columns: 1fr; }
  .bento-hero, .bento-portrait, .bento-cert, .bento-metric, .bento-feature { grid-column: span 1; }
}

/* footer + metrics responsive */
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .metrics-strip-wrap > div, .bento-metric { }
}
.note-mini-title { transition: color .15s; }
.note-mini:hover .note-mini-title { color: var(--accent-ink); }

/* ---------- metrics strip ---------- */
.metrics-strip { display: grid; grid-template-columns: repeat(4, 1fr); }
.metrics-strip .metric-cell:first-child { border-left: none !important; }
@media (max-width: 720px) {
  .metrics-strip { grid-template-columns: repeat(2, 1fr); }
  .metrics-strip .metric-cell:nth-child(odd) { border-left: none !important; }
  .metrics-strip .metric-cell:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- industries strip (6 cells, 3-col) ---------- */
.ind-strip { display: grid; grid-template-columns: repeat(3, 1fr); }
.ind-strip .ind-cell { border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.ind-strip .ind-cell:nth-child(-n+3) { border-top: none; }
.ind-strip .ind-cell:nth-child(3n+1) { border-left: none; }
.ind-strip.on-dark .ind-cell { border-color: var(--navy-line); }
@media (max-width: 860px) {
  .ind-strip { grid-template-columns: repeat(2, 1fr); }
  .ind-strip .ind-cell { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
  .ind-strip .ind-cell:nth-child(-n+2) { border-top: none; }
  .ind-strip .ind-cell:nth-child(2n+1) { border-left: none; }
  .ind-strip.on-dark .ind-cell { border-color: var(--navy-line); }
}
@media (max-width: 520px) {
  .ind-strip { grid-template-columns: 1fr; }
  .ind-strip .ind-cell { border-left: none; border-top: 1px solid var(--line); }
  .ind-strip .ind-cell:first-child { border-top: none; }
  .ind-strip.on-dark .ind-cell { border-color: var(--navy-line); }
}

/* ---------- achievement number ---------- */
.ach-num {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--accent-ink); letter-spacing: 0.04em; padding-top: 4px;
  flex: none; min-width: 22px;
}

/* ---------- credentials strip (horizontal) ---------- */
.cred-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; }
.cred-cell { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.cred-cert { box-shadow: inset 0 0 0 1px var(--accent-soft); }
@media (max-width: 560px) { .cred-strip { grid-template-columns: 1fr 1fr; } }
