/* Andrew Bertke: "Bold and modern" design
   A deep teal intro block, wide expanded headlines, sunflower accent,
   square edges and heavy rules instead of soft cards. */

:root {
  --deep: #0c2f33;
  --deep-2: #12434a;
  --paper: #ffffff;
  --wash: #f2f5f4;
  --ink: #14191f;
  --muted: #56616b;
  --rule: #dfe5e3;
  --sun: #ffd23f;
  --teal: #0f6f73;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 74rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --deep: #071d20;
    --deep-2: #0d2d31;
    --paper: #0f1416;
    --wash: #151c1f;
    --ink: #e8eeec;
    --muted: #9fb0ad;
    --rule: #26302f;
    --teal: #6fd0cb;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  overflow-x: clip;
}

a { color: var(--teal); text-underline-offset: 0.2em; text-decoration-thickness: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 0.5rem; background: var(--sun); color: #14191f; padding: 0.5rem 0.75rem; z-index: 10; }
.skip:focus { left: 0.5rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Full-bleed dark top: header + hero share the block */
.site-header, .hero {
  background: var(--deep);
  color: #fff;
  padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))) !important;
}

.site-header {
  margin: 0;
  padding: 1.25rem var(--gutter);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.wordmark {
  color: #fff; text-decoration: none;
  font-weight: 900; font-size: 1.05rem; letter-spacing: 0.01em;
  font-variation-settings: "wdth" 125;
}
.site-header ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-header nav a {
  color: rgba(255, 255, 255, 0.78); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 0.2rem 0; border-bottom: 2px solid transparent;
}
.site-header nav a:hover { color: #fff; border-bottom-color: var(--sun); }

/* Hero */
.hero {
  margin: 0;
  padding: clamp(2.5rem, 7vw, 5.5rem) var(--gutter) 0;
  display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: end;
}
@media (min-width: 56rem) { .hero { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 3.5rem; } }
.hero-text { padding-bottom: clamp(2.5rem, 6vw, 5rem); }

.hero-title {
  margin: 0 0 2rem;
  font-weight: 900; line-height: 0.92; letter-spacing: -0.01em;
  font-size: clamp(3rem, 9.5vw, 7.25rem);
  font-variation-settings: "wdth" 125;
  text-transform: none;
}
.hero-title .line { display: block; }

.token {
  display: inline-block;
  font-family: var(--mono); font-weight: 500; font-size: 0.34em;
  letter-spacing: 0; vertical-align: 0.5em;
  color: var(--sun); border: 2px solid var(--sun);
  padding: 0.2em 0.5em;
  font-variation-settings: normal;
}
.token.is-resolved {
  font-family: var(--font); font-weight: 900; font-size: 1em;
  font-variation-settings: "wdth" 125;
  vertical-align: baseline; border: 0; padding: 0;
  color: var(--sun);
}

.lede {
  font-size: clamp(1.1rem, 1.7vw, 1.3rem); line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  max-width: 38rem; margin: 0 0 2rem;
}

.hero-photo { margin: 0; align-self: end; justify-self: center; width: 100%; max-width: 26rem; }
.hero-photo img { display: block; width: 100%; height: auto; }
@media (max-width: 55.99rem) { .hero-photo { max-width: 18rem; order: 2; } .hero-text { padding-bottom: 0; } }

/* Buttons: square, heavy */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-block; padding: 0.85rem 1.4rem;
  font-weight: 800; text-decoration: none; border: 2px solid currentColor;
  font-variation-settings: "wdth" 110;
}
.hero .btn-primary { background: var(--sun); border-color: var(--sun); color: #14191f; }
.hero .btn-primary:hover { background: #fff; border-color: #fff; }
.hero .btn-quiet { color: #fff; }
.hero .btn-quiet:hover { background: #fff; color: var(--deep); border-color: #fff; }

/* Sections */
.section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) var(--gutter) 0;
}
.section h2 {
  margin: 0 0 1rem;
  font-weight: 700; line-height: 1; letter-spacing: -0.005em;
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  font-variation-settings: "wdth" 125;
}
@media (max-width: 40rem) {
  .section h2 { font-size: clamp(1.9rem, 8.6vw, 2.4rem); font-variation-settings: "wdth" 112; }
  .contact h2 { font-size: 3.2rem; }
}
.section h2 { overflow-wrap: break-word; }
.section-intro { font-size: 1.15rem; color: var(--muted); max-width: 44rem; margin: 0 0 2.5rem; }
.section p { max-width: 46rem; }

/* Projects: a grid of tiles with heavy top rules */
.work:not(.portfolio) { counter-reset: none; }
#impact, #work, #now { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 2.5rem; }
@media (min-width: 46rem) { #impact, #work, #now { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 70rem) { #work { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
#impact > h2, #impact > .section-intro, #work > h2, #work > .section-intro, #now > h2, #now > .section-intro { grid-column: 1 / -1; }
.project {
  border-top: 4px solid var(--ink);
  padding: 1.1rem 0 2.25rem;
}
#impact .project:first-of-type { border-top-color: var(--sun); }
.project h3 { margin: 0 0 0.6rem; font-size: 1.25rem; line-height: 1.25; font-weight: 800; font-variation-settings: "wdth" 110; }
.project p { margin: 0 0 0.6rem; }
.tags { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-top: 0.75rem !important; }

/* Experience and community rows */
.job {
  display: grid; grid-template-columns: 1fr; gap: 0.5rem 3rem;
  padding: 1.75rem 0; border-top: 2px solid var(--ink);
}
@media (min-width: 52rem) { .job { grid-template-columns: 18rem minmax(0, 1fr); } }
.job h3 { margin: 0; font-size: 1.35rem; line-height: 1.2; font-weight: 800; font-variation-settings: "wdth" 115; }
.job-meta { margin: 0.35rem 0 0; color: var(--muted); }
.job-body > p { margin: 0 0 0.75rem; }

.ladder { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.ladder li {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 1rem;
  padding: 0.55rem 0; border-bottom: 1px solid var(--rule);
}
.ladder li:first-child strong { background: var(--sun); color: #14191f; padding: 0 0.3rem; }
.ladder span { margin-left: auto;  font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.brands { color: var(--muted); }
.brands-label { font-weight: 800; color: var(--ink); }
.earlier-list { margin: 0; padding-left: 1.1rem; }
.earlier-list li { margin-bottom: 0.5rem; }
.education { border-top: 2px solid var(--ink); padding-top: 1.5rem; }
.education h3 { margin: 0 0 0.5rem; font-size: 1.35rem; font-weight: 800; font-variation-settings: "wdth" 115; }
.education ul { margin: 0; padding-left: 1.1rem; }

/* Definition lists (ideas, toolkit) */
.kit { margin: 0; display: grid; grid-template-columns: 1fr; column-gap: 2.5rem; }
@media (min-width: 46rem) { .kit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kit > div { border-top: 4px solid var(--ink); padding: 1.1rem 0 2rem; }
.kit dt { font-weight: 800; font-size: 1.2rem; line-height: 1.25; margin-bottom: 0.5rem; font-variation-settings: "wdth" 110; }
.kit dd { margin: 0; }

/* Portfolio: tight grid, square edges */
.work-group { margin: 3rem 0 0.25rem; font-size: 1.4rem; font-weight: 800; font-variation-settings: "wdth" 115; }
.work-intro { color: var(--muted); margin: 0 0 1.25rem; }
.work-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); }
.work-item { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: zoom-in; }
.work-item img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  background: #fff; outline: 1px solid var(--rule);
  transition: outline-color 150ms ease, transform 150ms ease;
}
.work-item:hover img { outline: 4px solid var(--sun); }
.work-item:focus-visible { outline: 3px solid var(--sun); outline-offset: 4px; }
.work-name { display: block; font-weight: 800; margin-top: 0.6rem; line-height: 1.3; }
.work-client { display: block; color: var(--muted); font-size: 0.9rem; }
.work-count { display: inline-block; margin-top: 0.3rem; font-family: var(--mono); font-size: 0.72rem; color: var(--teal); }

/* Lightbox */
.lightbox { padding: 0; border: 0; width: min(54rem, 94vw); max-height: 92vh; background: var(--paper); color: var(--ink); }
.lightbox::backdrop { background: rgba(7, 29, 32, 0.85); }
.lb-bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.9rem 1.1rem; background: var(--deep); color: #fff; }
.lb-title { margin: 0; font-weight: 800; }
.lb-client { margin: 0; color: rgba(255,255,255,0.75); font-size: 0.9rem; }
.lb-actions { display: flex; gap: 0.75rem; align-items: center; flex-shrink: 0; }
.lb-close { font: inherit; font-weight: 800; padding: 0.45rem 0.9rem; border: 0; background: var(--sun); color: #14191f; cursor: pointer; }
.lb-body { overflow: auto; max-height: calc(92vh - 4.5rem); }
.lb-caption { max-width: 40rem; margin: 0 auto; padding: 1rem 1.1rem; }
.lb-caption:empty { display: none; }
.lb-images { display: grid; gap: 0.75rem; padding-bottom: 0.75rem; }
.lb-images img { display: block; margin: 0 auto; max-width: 100%; height: auto; }

/* Community photo */
.job-photo { margin: 1.25rem 0 0; max-width: 38rem; }
.job-photo img { display: block; width: 100%; height: auto; }
.job-photo figcaption { margin-top: 0.5rem; color: var(--muted); font-size: 0.9rem; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 2rem 3.5rem; }
@media (min-width: 52rem) { .about-grid { grid-template-columns: 22rem minmax(0, 1fr); } }
.about-side { display: grid; gap: 1.25rem; align-content: start; }
.about-photo { width: 100%; height: auto; display: block; }
.facts { margin: 0; border-top: 4px solid var(--ink); }
.facts > div { padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.about-body p { margin: 0 0 1.1rem; font-size: 1.1rem; }
.about-body p:first-child { font-size: 1.3rem; line-height: 1.5; font-weight: 500; }

/* Contact: big sunflower block */
.section.contact {
  max-width: none; margin-top: clamp(4rem, 9vw, 7rem);
  padding: clamp(3.5rem, 8vw, 6rem) var(--gutter);
  padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  background: var(--sun); color: #14191f;
}
.contact-inner { max-width: none; }
.contact h2 { font-size: clamp(3rem, 10vw, 7rem); color: #14191f; }
.contact p { font-size: 1.25rem; margin: 0 0 2rem; }
.contact .btn-primary { background: #14191f; border-color: #14191f; color: var(--sun); }
.contact .btn-primary:hover { background: transparent; color: #14191f; }
.contact .btn-quiet { color: #14191f; }
.contact .btn-quiet:hover { background: #14191f; color: var(--sun); }

.site-footer {
  background: #14191f; color: rgba(255,255,255,0.7);
  margin: 0; padding: 1.5rem max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); font-size: 0.9rem;
}
.site-footer p { margin: 0; }

/* Case studies (current work) */
.eyebrow, .case-number {
  margin: 0 0 0.5rem;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--teal);
}
.case-study-intro, .portfolio-divider { border-top: 4px solid var(--ink); padding-top: 1.25rem; margin-top: 2.5rem; }
.portfolio-divider { margin-top: 4.5rem; }
.case-study-intro h3, .portfolio-divider h3 {
  margin: 0 0 0.5rem; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.15;
  font-weight: 700; font-variation-settings: "wdth" 115;
}
.case-study-intro p:last-child, .portfolio-divider p:last-child { color: var(--muted); margin: 0; }

.case-study {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem 3rem;
  padding: 2.5rem 0; border-bottom: 1px solid var(--rule);
  align-items: center;
}
@media (min-width: 56rem) {
  .case-study { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .case-study-reverse .case-visual { order: 2; }
}
.case-copy h3 { margin: 0 0 0.75rem; font-size: 1.5rem; line-height: 1.2; font-weight: 800; font-variation-settings: "wdth" 110; }
.case-summary { font-size: 1.1rem; margin: 0 0 1.25rem; }
.case-details { margin: 0 0 0.5rem; }
.case-details > div { padding: 0.65rem 0; border-top: 1px solid var(--rule); }
.case-details dt { font-weight: 800; font-size: 0.95rem; }
.case-details dd { margin: 0.15rem 0 0; }

/* The diagram panel */
.case-visual {
  background: var(--deep); color: #fff;
  padding: clamp(1.25rem, 3vw, 2rem);
  min-height: 100%;
  display: flex; flex-direction: column; justify-content: center;
}
.case-visual strong { display: block; font-weight: 700; line-height: 1.25; }
.case-visual small { display: block; color: rgba(255,255,255,0.72); font-size: 0.85rem; line-height: 1.4; margin-top: 0.2rem; }

/* 01: flow */
.flow { display: grid; gap: 0.35rem; }
.flow-node { display: grid; grid-template-columns: 2.5rem 1fr; column-gap: 0.75rem; align-items: start; border: 2px solid rgba(255,255,255,0.22); padding: 0.75rem 0.9rem; }
.flow-node span { grid-row: span 2; font-family: var(--mono); color: var(--sun); font-size: 0.9rem; padding-top: 0.1rem; }
.flow-node:last-child { border-color: var(--sun); }
.flow-arrow { text-align: center; color: var(--sun); line-height: 1; transform: rotate(90deg); font-size: 1.1rem; }

/* 02: automation map */
.source-stack, .output-row { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.source-stack span, .output-row span { border: 2px solid rgba(255,255,255,0.22); padding: 0.4rem 0.7rem; font-size: 0.9rem; }
.output-row span { border-color: var(--sun); }
.map-connector { text-align: center; color: var(--sun); font-size: 1.3rem; line-height: 1; margin: 0.6rem 0; }
.analysis-box { background: var(--sun); color: #14191f; text-align: center; padding: 1rem; }
.analysis-box small { color: #14191f; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; margin: 0 0 0.25rem; }
.analysis-box strong { font-size: 1.25rem; font-variation-settings: "wdth" 115; }
.analysis-box span { display: block; font-size: 0.9rem; }

/* 03: Word to HTML */
.transform-demo { flex-direction: row; align-items: center; gap: 0.75rem; }
.document-card { flex: 1; min-width: 0; background: #fff; color: #14191f; padding: 1rem; min-height: 11rem; display: flex; flex-direction: column; gap: 0.5rem; }
.doc-label { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; color: #56616b; }
.document-card i { display: block; height: 0.5rem; background: #c9d1cf; width: 100%; }
.document-card i.short { width: 60%; }
.document-card.messy b { font-family: "Times New Roman", serif; font-style: italic; font-weight: 700; font-size: 1.1rem; color: #3a52a8; text-decoration: underline; }
.document-card.messy i:nth-of-type(2) { background: #f2c7c7; }
.document-card code { font-family: var(--mono); font-size: 0.78rem; background: #f2f5f4; padding: 0.3rem 0.4rem; border-left: 3px solid var(--sun); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transform-arrow { flex: 0 0 auto; text-align: center; color: var(--sun); font-size: 1.5rem; line-height: 1; }
.transform-arrow span { display: block; font-family: var(--mono); font-size: 0.65rem; color: rgba(255,255,255,0.8); max-width: 5.5rem; margin-bottom: 0.3rem; line-height: 1.3; }
@media (max-width: 30rem) {
  .transform-demo { flex-direction: column; align-items: stretch; }
  .transform-arrow { transform: rotate(90deg); }
  .transform-arrow span { display: none; }
  .document-card { min-height: 0; }
}

/* 04: image types */
.accessibility-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.accessibility-grid > div { border: 2px solid rgba(255,255,255,0.22); padding: 0.9rem; }
.image-symbol { display: block; color: var(--sun); font-size: 1.6rem; line-height: 1; margin-bottom: 0.5rem; }
@media (max-width: 26rem) { .accessibility-grid { grid-template-columns: 1fr; } }
.accessibility-grid { align-content: center; }
.see-also { grid-column: 1 / -1; margin: 0.5rem 0 0; padding: 1rem 1.25rem; background: var(--wash); border-left: 4px solid var(--sun); max-width: none !important; }
.case-study { scroll-margin-top: 1.5rem; }

/* Travel photos in About */
.travel-grid { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 70rem) { .travel-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.travel-grid figure { margin: 0; }
.travel-grid img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.travel-grid figcaption { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); margin-top: 0.35rem; }

/* Desktop / mobile toggle in the lightbox */
.lb-views { display: inline-flex; border: 2px solid rgba(255,255,255,0.5); }
.lb-views[hidden] { display: none; }
.lb-views button { font: inherit; font-size: 0.9rem; font-weight: 700; padding: 0.35rem 0.75rem; border: 0; background: transparent; color: #fff; cursor: pointer; }
.lb-views button[aria-pressed="true"] { background: #fff; color: var(--deep); }
.lb-images.is-mobile img { max-width: min(100%, 375px); box-shadow: 0 0 0 1px var(--rule); }
@media (max-width: 30rem) { .lb-bar { flex-wrap: wrap; } .lb-views button { padding: 0.35rem 0.55rem; } }

/* Badge on thumbnails that include a mobile version */
.work-item { position: relative; }
.work-item[data-mobile]::after {
  content: "+ Mobile";
  position: absolute; top: 0; right: 0.5rem;
  margin-top: calc(125% - 2.1rem); /* bottom corner of the 4:5 thumbnail */
  padding: 0.3rem 0.55rem 0.3rem 1.55rem;
  background: var(--sun) no-repeat 0.5rem 50% / 0.7rem auto
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 22'%3E%3Crect x='1.5' y='1.5' width='11' height='19' rx='2' fill='none' stroke='%2314191f' stroke-width='2.2'/%3E%3Ccircle cx='7' cy='17' r='1.3' fill='%2314191f'/%3E%3C/svg%3E");
  color: #14191f; font-family: var(--mono); font-size: 0.7rem; line-height: 1.2;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  pointer-events: none;
}
