/* Shared styles for jacobilagan.com */

@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ground: #EEF0F3;
  --paper: #F7F8FA;
  --ink: #141B2E;
  --ink-2: #3B4766;
  --muted: #4A5672;
  --rule: #C9CFDB;
  --navy: #1E2F5C;
  --panel: #17244A;
  --panel-rule: #2E3C66;
  --panel-text: #C9D2E8;
  --panel-muted: #93A0C2;
  --code-bg: #E2E6EE;
  --serif: "Newsreader", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wrap: 1200px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 24px; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--navy); }
a:hover { color: var(--muted); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
p, h1, h2, h3, dl, dd, figure, ol { margin: 0; }

.skip { position: absolute; left: 16px; top: -64px; z-index: 10; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 4px; text-decoration: none; }
.skip:focus { top: 16px; color: #fff; }

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

/* Type */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; text-wrap: balance; }
.display { font-size: 72px; line-height: 72px; }
.h2 { font-size: 48px; line-height: 48px; }
.h3 { font-size: 36px; line-height: 40px; }
.h4 { font-size: 30px; line-height: 36px; }
.h5 { font-size: 24px; line-height: 32px; }
.body-lg { font-size: 18px; line-height: 28px; text-wrap: pretty; }
.body { font-size: 16px; line-height: 24px; text-wrap: pretty; }
.small { font-size: 14px; line-height: 20px; text-wrap: pretty; }
.label { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.soft { color: var(--ink-2); }

/* Header */
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 32px 0; }
.brand { font-weight: 600; text-decoration: none; color: var(--ink); }
.nav { display: flex; gap: 32px; flex-wrap: wrap; }
.nav a { font-size: 14px; line-height: 20px; font-weight: 500; text-decoration: none; color: var(--muted); transition: color .3s var(--ease); }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a[aria-current] { text-decoration: underline; text-underline-offset: 6px; }

/* Hero */
.hero { padding: 96px 0 64px; display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-end; justify-content: space-between; }
.hero-main { flex: 1 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.hero h1 { max-width: 820px; }
.hero-facts { flex: 0 1 280px; display: flex; flex-direction: column; gap: 16px; padding-bottom: 8px; }
.fact { border-top: 1px solid var(--rule); padding-top: 12px; }
.fact dd { margin-top: 4px; }

/* Illustration */
.art { display: flex; flex-direction: column; gap: 12px; }
.art-frame { border-radius: 6px; overflow: hidden; background: var(--paper); }

/* Navy panel */
.panel { margin-top: 128px; background: var(--panel); color: #E6EAF4; border-radius: 20px; padding: 64px; display: flex; flex-direction: column; gap: 64px; }
.panel a { color: #fff; }
.panel a:hover { color: var(--panel-text); }
.panel-top { display: flex; flex-wrap: wrap; gap: 64px; align-items: flex-start; }
.panel-text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.panel h2, .panel h3 { color: #fff; }
.panel-facts { display: flex; flex-direction: column; gap: 12px; }
.panel-facts div { display: flex; gap: 16px; border-top: 1px solid var(--panel-rule); padding-top: 12px; }
.panel-facts dt { color: var(--panel-muted); width: 72px; flex: none; padding-top: 2px; }
.shot { flex: 1 1 520px; min-width: 0; transition: transform .5s var(--ease); }
.shot:hover { transform: translateY(-4px); }
.shot img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 24px 48px rgba(0, 0, 0, .28); }
.flows { display: flex; flex-wrap: wrap; gap: 48px; }
.flow { flex: 1 1 260px; min-width: 0; border-top: 1px solid var(--panel-rule); padding-top: 24px; display: flex; flex-direction: column; gap: 8px; }
.on-panel { color: var(--panel-text); }
.on-panel-muted { color: var(--panel-muted); }

/* Case study row */
.split { padding: 128px 0 0; display: flex; flex-wrap: wrap; gap: 64px; align-items: flex-start; }
.split-text { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.split-side { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 24px; padding-top: 40px; }
pre { margin: 0; background: var(--code-bg); color: var(--navy); border-radius: 6px; padding: 32px; font-family: var(--mono); font-size: 14px; line-height: 20px; white-space: pre-wrap; overflow-x: auto; }
pre .comment { color: #5A6788; }
.tests { list-style: none; padding: 0; display: flex; flex-direction: column; border-bottom: 1px solid var(--rule); }
.tests li { display: flex; gap: 16px; padding: 12px 0; border-top: 1px solid var(--rule); }

/* Statement */
.statement { padding: 160px 0; }
.statement p { max-width: 900px; color: var(--navy); }

/* Freelance list */
.list { display: flex; flex-direction: column; border-bottom: 1px solid var(--rule); }
.list-head { padding-bottom: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 24px; align-items: baseline; padding: 32px 0; border-top: 1px solid var(--rule); text-decoration: none; color: var(--ink); transition: background-color .3s var(--ease); }
.row:hover { background: rgba(30, 47, 92, .04); color: var(--ink); }
.row-num { width: 48px; }
.row-title { flex: 1 1 360px; }
.row-note { flex: 0 1 360px; }

/* About */
.about { padding: 128px 0 0; display: flex; flex-wrap: wrap; gap: 64px; align-items: flex-start; }
.about img { width: 240px; height: 300px; object-fit: cover; border-radius: 4px; filter: grayscale(1) contrast(1.05); }
.about-text { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.about-text .body-lg { max-width: 620px; }
.skills { display: flex; flex-wrap: wrap; gap: 32px; padding-top: 8px; }
.skills div { flex: 1 1 180px; border-top: 1px solid var(--rule); padding-top: 12px; }
.skills dd { margin-top: 8px; }

/* Contact */
.contact { padding: 160px 0 96px; display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-end; }
.contact h2 { flex: 1 1 520px; max-width: 720px; }
.contact-actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 4px; background: var(--navy); color: #fff; font-weight: 600; text-decoration: none; transition: transform .3s var(--ease); }
.btn:hover { color: #fff; transform: translateY(-1px); }
.btn:active { transform: scale(.98); }

.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 24px 0 48px; border-top: 1px solid var(--rule); }

.arrow { align-self: flex-start; font-weight: 500; text-underline-offset: 5px; text-decoration-thickness: 1px; }

/* Scroll reveal: site.js adds .pending only to elements below the first screen */
.reveal { transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.pending { opacity: 0; transform: translateY(32px); }

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .site-header { padding: 24px 0; }
  .nav { gap: 24px; }
  .hero { padding: 48px 0 40px; gap: 32px; }
  .display { font-size: 48px; line-height: 48px; }
  .h2 { font-size: 36px; line-height: 40px; }
  .h3 { font-size: 30px; line-height: 36px; }
  .h4 { font-size: 24px; line-height: 32px; }
  .panel { margin-top: 80px; padding: 24px; gap: 48px; border-radius: 16px; }
  .panel-top { gap: 40px; }
  .split, .about { padding-top: 80px; gap: 40px; }
  .split-side { padding-top: 0; }
  .hero-facts { flex-basis: 100%; }
  pre { padding: 16px; font-size: 12px; line-height: 16px; white-space: pre; }
  .statement { padding: 96px 0; }
  .statement .display { font-size: 36px; line-height: 40px; }
  .row { gap: 8px 16px; padding: 24px 0; }
  .contact { padding: 96px 0 64px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .shot, .btn, .row { transition: opacity .3s linear; }
  .reveal.pending { transform: none; }
  .shot:hover, .btn:hover { transform: none; }
}

/* Highlights strip (under a case study row) */
.highlights { padding-top: 64px; display: flex; flex-direction: column; gap: 24px; }
.highlight-grid { display: flex; flex-wrap: wrap; gap: 48px; }
.highlight { flex: 1 1 260px; min-width: 0; border-top: 1px solid var(--rule); padding-top: 24px; display: flex; flex-direction: column; gap: 8px; }
.highlight .figure { font-family: var(--mono); font-size: 14px; line-height: 20px; color: var(--navy); }

/* Section heads for list sections */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; }

/* Experience */
.experience { padding-bottom: 128px; }
.exp { display: flex; flex-direction: column; border-bottom: 1px solid var(--rule); }
.exp-row { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; padding: 24px 0; border-top: 1px solid var(--rule); }
.exp-date { flex: 0 0 160px; }
.exp-role { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.exp-note { flex: 0 1 400px; min-width: 0; }
.education { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 24px; }

/* Contact links */
.contact-links { display: flex; gap: 24px; flex-wrap: wrap; }

/* Case study pages */
.cs-header { padding: 64px 0 64px; display: flex; flex-direction: column; gap: 24px; }
.back { align-self: flex-start; font-size: 14px; line-height: 20px; font-weight: 500; text-decoration: none; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; transition: color .3s var(--ease); }
.back:hover { color: var(--ink); }
.cs-header h1 { max-width: 960px; }
.cs-lede { max-width: 680px; }
.tldr { display: flex; flex-wrap: wrap; gap: 32px 48px; padding: 24px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); margin-bottom: 96px; }
.tldr div { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cs-figure { margin: 0 0 96px; display: flex; flex-direction: column; gap: 12px; }
.cs-figure img { width: 100%; height: auto; border-radius: 8px; }
.cs-figure.boxed { background: var(--panel); border-radius: 20px; padding: 64px; }
.cs-figure.boxed img { max-width: 640px; margin: 0 auto; box-shadow: 0 24px 48px rgba(0, 0, 0, .28); }
.cs-section { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 680px); gap: 64px; padding-bottom: 96px; }
.cs-aside { display: flex; flex-direction: column; gap: 24px; }
.stat { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--rule); padding-top: 12px; }
.stat strong { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 40px; letter-spacing: -0.02em; color: var(--navy); }
.prose { display: flex; flex-direction: column; gap: 24px; }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 36px; letter-spacing: -0.02em; text-wrap: balance; }
.prose h3 { font-size: 18px; line-height: 28px; font-weight: 600; }
.prose p, .prose li { font-size: 18px; line-height: 28px; color: var(--ink-2); text-wrap: pretty; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 12px; }
.prose code { font-family: var(--mono); font-size: 15px; background: var(--code-bg); color: var(--navy); padding: 2px 4px; border-radius: 4px; }
.prose pre { margin: 8px 0; }
.prose .small { font-size: 14px; line-height: 20px; }
.prose .muted { color: var(--muted); }
.prose .lesson { font-family: var(--serif); font-size: 24px; line-height: 32px; letter-spacing: -0.01em; color: var(--navy); text-wrap: balance; padding: 24px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.next { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 16px; padding: 48px 0; margin-bottom: 48px; border-top: 1px solid var(--ink); text-decoration: none; color: var(--ink); transition: background-color .3s var(--ease); }
.next:hover { color: var(--ink); background: rgba(30, 47, 92, .04); }

/* Pipeline diagram */
.diagram { background: var(--paper); border-radius: 8px; padding: 48px; }
.diagram svg { width: 100%; height: auto; }
.diagram text { font-family: var(--sans); font-size: 14px; fill: var(--ink); }
.diagram .node rect { fill: #fff; stroke: var(--rule); }
.diagram .node.core rect { fill: var(--navy); stroke: var(--navy); }
.diagram .node.core text { fill: #fff; }
.diagram .sub { font-family: var(--mono); font-size: 12px; fill: var(--muted); }
.diagram .node.core .sub { fill: #C9D2E8; }
.diagram .edge { stroke: var(--navy); stroke-width: 1.5; fill: none; }
.diagram .edge.soft { stroke: #8A96B4; stroke-dasharray: 4 4; }
.diagram-list { display: none; list-style: none; padding: 0; flex-direction: column; }
.diagram-list li { display: flex; gap: 16px; padding: 12px 0; border-top: 1px solid var(--rule); }

/* Plain text pages */
.page { max-width: 680px; padding: 64px 0 128px; display: flex; flex-direction: column; gap: 24px; }

@media (max-width: 720px) {
  .highlights { padding-top: 48px; }
  .highlight-grid { gap: 32px; }
  .experience { padding-bottom: 80px; }
  .exp-date { flex-basis: 100%; }
  .cs-header { padding: 32px 0 48px; }
  .tldr { margin-bottom: 64px; }
  .cs-figure { margin-bottom: 64px; }
  .cs-figure.boxed { padding: 16px; border-radius: 16px; }
  .cs-section { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-bottom: 64px; }
  .cs-aside { flex-direction: row; flex-wrap: wrap; gap: 16px 32px; }
  .stat { flex: 1 1 140px; }
  .prose p, .prose li { font-size: 17px; line-height: 28px; }
  .diagram { padding: 16px; }
  .diagram svg { display: none; }
  .diagram-list { display: flex; }
}
