/* ===========================
   FONTS — self-hosted woff2
   =========================== */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/fraunces-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/fraunces-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===========================
   CUSTOM PROPERTIES
   =========================== */

:root {
  --accent: #3E5C52;        /* one-line change to swap accent */
  --bg: #FBFAF6;
  --ink: #1C1B19;
  --body: #393731;
  --muted: #5B5851;
  --border: #D2CFC8;
  --icon: #8A877F;
  --footer-bg: #1C1B19;
  --footer-fg: #FBFAF6;
  --footer-label: #C8C5BD;
}

/* ===========================
   RESET + BASE
   =========================== */

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }
a { color: inherit; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
dl, ul, ol { margin: 0; padding: 0; }
figure { margin: 0; }

/* ===========================
   SKIP LINK
   =========================== */

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 1rem;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
}
.skip-link:focus { inset-inline-start: 1rem; }

/* ===========================
   FOCUS STYLES
   =========================== */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ===========================
   SITE HEADER
   =========================== */

.site-header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-family: Fraunces, Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  font-size: 16px;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  padding: 10px 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav-link[aria-current="page"] {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
  text-underline-offset: 8px;
}

.cv-link {
  text-decoration: none;
  padding: 10px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

.contact-pill {
  text-decoration: none;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* ===========================
   SECTION HEADERS
   =========================== */

.section-top {
  border-top: 1.5px solid var(--ink);
  padding-top: 16px;
  margin-bottom: 32px;
}
.section-top--between {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.section-top--mb8 { margin-bottom: 8px; }

.section-label {
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}

.page-eyebrow {
  font-size: 15px;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0 0 24px;
  display: block;
}

/* ===========================
   HEADINGS
   =========================== */

.h1-home {
  font-family: Fraunces, Georgia, serif;
  font-weight: 400;
  font-size: clamp(32px, 3.8vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: 18em;
  text-wrap: balance;
}
.h1-page {
  font-family: Fraunces, Georgia, serif;
  font-weight: 400;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  max-width: 16em;
  text-wrap: balance;
}
.h1-case {
  font-family: Fraunces, Georgia, serif;
  font-weight: 400;
  font-size: clamp(36px, 4.8vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 18em;
  text-wrap: balance;
}
.h2-article {
  font-family: Fraunces, Georgia, serif;
  font-weight: 400;
  font-size: 34px;
  line-height: 1.15;
  margin-bottom: 16px;
}
.h3-article {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.25;
  margin-bottom: 12px;
}
.h2-work {
  font-family: Fraunces, Georgia, serif;
  font-weight: 400;
  font-size: 34px;
  line-height: 1.15;
  margin: 0 0 20px;
}

/* ===========================
   TEXT UTILITIES
   =========================== */

.lead {
  font-size: 19px;
  color: var(--body);
  line-height: 1.6;
  text-wrap: pretty;
}
.lead--xl { font-size: 20px; line-height: 1.55; }
.text-body { color: var(--body); text-wrap: pretty; }
.text-muted { color: var(--muted); text-wrap: pretty; }
.text-accent { color: var(--accent); }

/* ===========================
   CONTENT LINKS
   =========================== */

.link-arrow {
  font-weight: 600;
  color: var(--accent);
  display: inline-block;
}
.back-link {
  display: inline-block;
  padding: 10px 0;
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
}

/* ===========================
   HERO
   =========================== */

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 32px 88px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px;
}
.hero-body {
  flex: 1 1 520px;
  min-width: 0;
}
.hero-actions {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}
.btn-primary {
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  padding: 15px 26px;
  border-radius: 999px;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.btn-outline {
  text-decoration: none;
  border: 1.5px solid var(--ink);
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.btn-text {
  padding: 14px 8px;
  font-weight: 500;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.hero-portrait {
  flex: 0 1 380px;
  width: 380px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: cover;
  mix-blend-mode: multiply;
  display: block;
}

/* ===========================
   HOME SECTIONS
   =========================== */

.home-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px 96px;
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr));
  gap: 48px;
  align-items: start;
}
.toc-list {
  list-style: none;
  border-top: 1px solid var(--border);
}
.toc-item {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.toc-num { width: 28px; color: var(--muted); }
.work-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 48px;
}
.work-method-title {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: 24px;
  margin: 0 0 12px;
}
.story-excerpt {
  max-width: 36em;
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 19px;
  line-height: 1.65;
  color: var(--body);
  text-wrap: pretty;
}

/* ===========================
   PAGE INTRO / BODY
   =========================== */

.page-intro {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 32px 72px;
}
.page-body {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px 96px;
}
.page-narrow { max-width: 720px; }

/* ===========================
   WORK PAGE
   =========================== */

.loop-list {
  list-style: none;
  border-top: 1px solid var(--border);
  margin-bottom: 72px;
}
.loop-item {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.loop-num { width: 28px; flex: none; color: var(--accent); }
.loop-title { font-weight: 600; margin-bottom: 6px; }

/* ===========================
   PROJECTS PAGE
   =========================== */

.project-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 32px;
}
.project-section--last { padding-bottom: 96px; }

.project-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 12px 48px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  align-items: start;
}
.project-row-plain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 12px 48px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.project-num { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.project-title {
  font-family: Fraunces, Georgia, serif;
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
}
.project-cta { font-weight: 600; color: var(--accent); margin: 0; }
.project-cta--muted { font-weight: 600; color: var(--muted); margin: 0; }
.project-status { font-size: 14px; font-weight: 600; color: var(--accent); margin: 16px 0 0; display: block; }
.project-status--muted { color: var(--muted); }

/* ===========================
   CASE STUDY HEADER
   =========================== */

.case-header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 32px 56px;
}
.meta-grid {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 0 32px;
}
.meta-item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.meta-label {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
}
.meta-value { margin: 0; }
.meta-value--accent { font-weight: 600; color: var(--accent); }

/* ===========================
   30-SECOND SUMMARY
   =========================== */

.summary-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px 72px;
}
.summary-top {
  border-top: 1.5px solid var(--ink);
  padding-top: 24px;
}
.summary-list {
  list-style: none;
  max-width: 720px;
  border-top: 1px solid var(--border);
  margin-bottom: 40px;
}
.summary-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  color: var(--body);
  text-wrap: pretty;
}

/* ===========================
   CASE STUDY BODY LAYOUT
   =========================== */

.case-body {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px 96px;
  display: flex;
  flex-wrap: wrap;
  gap: 48px 64px;
  align-items: flex-start;
}
.case-nav {
  flex: 0 1 220px;
  min-width: 200px;
  font-size: 15px;
  position: sticky;
  top: 24px;
}
.case-nav-list {
  list-style: none;
  border-top: 1px solid var(--border);
}
.case-nav-link {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
  align-items: center;
}
.case-nav-num { color: var(--accent); width: 24px; flex: none; }
.case-article {
  flex: 999 1 560px;
  min-width: 0;
  max-width: 720px;
}
.case-article p + p { margin-top: 20px; }

/* ===========================
   DETAIL LIST (dl in articles)
   =========================== */

.detail-list {
  border-top: 1px solid var(--border);
  margin-bottom: 72px;
}
.detail-list--tight { margin-bottom: 40px; }
.detail-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.detail-item--tight { padding: 14px 0; border-bottom: 1px solid var(--border); }
.detail-label {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}
.detail-value { color: var(--body); margin: 0; }

/* ===========================
   DECISION LIST (ol in articles)
   =========================== */

.decision-list {
  list-style: none;
  border-top: 1px solid var(--border);
  margin-bottom: 32px;
}
.decision-item { padding: 20px 0; border-bottom: 1px solid var(--border); }
.decision-title { font-weight: 600; margin: 0 0 6px; }
.decision-note { color: var(--muted); }

/* ===========================
   TABLES
   =========================== */

.table-wrap { overflow-x: auto; margin-bottom: 72px; }
.table-wrap--tight { overflow-x: auto; margin-bottom: 28px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.5; }
th {
  text-align: left;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 16px 10px 0;
  border-bottom: 1.5px solid var(--ink);
  vertical-align: bottom;
}
td {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--body);
}
.td-strong { font-weight: 600; color: var(--ink); }

/* ===========================
   FIGURES & IMAGES
   =========================== */

.screenshot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.screenshot--card { border-radius: 8px; }
figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); max-width: 720px; }

/* ===========================
   ABOUT PAGE
   =========================== */

.about-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 32px 112px;
}
.about-top {
  border-top: 1.5px solid var(--ink);
  padding-top: 16px;
  margin-bottom: 40px;
}
.about-body {
  max-width: 36em;
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 19px;
  line-height: 1.65;
  color: var(--body);
  text-wrap: pretty;
}

/* ===========================
   CASE STUDY BOTTOM NAV
   =========================== */

.case-footer-nav {
  border-top: 1.5px solid var(--ink);
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 72px;
}

/* ===========================
   FOOTER
   =========================== */

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 32px;
}
.footer-label {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--footer-label);
  margin: 0 0 8px;
  display: block;
}
.footer-links { line-height: 2; }
.footer-links a:hover { text-decoration-thickness: 2px; }

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 900px) {
  .case-nav { position: static; flex: 1 1 100%; }
}

@media (max-width: 768px) {
  .site-header,
  .hero,
  .home-section,
  .page-intro,
  .page-body,
  .summary-section,
  .case-header,
  .case-body,
  .project-section,
  .about-section,
  .footer-inner { padding-inline: 20px; }
  .hero { gap: 32px; padding-block: 40px 64px; }
  .hero-portrait { order: -1; flex: 0 1 240px; width: 240px; }
  .h2-article { font-size: 28px; }
  .h3-article { font-size: 20px; }
  .h2-work { font-size: 28px; }
}

@media (max-width: 480px) {
  .site-header,
  .hero,
  .home-section,
  .page-intro,
  .page-body,
  .summary-section,
  .case-header,
  .case-body,
  .project-section,
  .about-section,
  .footer-inner { padding-inline: 16px; }
  .hero-portrait { flex: 0 1 200px; width: 200px; }
}

/* ===========================
   MOTION
   =========================== */

/* Page cross-fade (graceful fallback: no effect in unsupported browsers) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

/* Hover / focus transitions */
@media (prefers-reduced-motion: no-preference) {
  .nav-link, .cv-link, .back-link, .case-nav-link, .link-arrow, .project-row {
    transition: color 150ms ease, text-decoration-color 150ms ease;
  }
  .contact-pill, .btn-primary, .btn-outline, .btn-text {
    transition: background 150ms ease, color 150ms ease,
                border-color 150ms ease, opacity 150ms ease;
  }
}

/* Scroll-triggered fade-up — requires CSS scroll-driven animations */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .fade-up {
      animation: fade-up linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 20%;
    }
    @keyframes fade-up {
      from { opacity: 0; transform: translateY(12px); }
      to   { opacity: 1; transform: translateY(0); }
    }
  }
}

/* Diagram connector draw-in */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .cs-diagram path.connector {
      stroke-dasharray: 2000;
      stroke-dashoffset: 2000;
      animation: draw-line linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
    @keyframes draw-line {
      to { stroke-dashoffset: 0; }
    }
  }
}
