/* ==========================================================================
   jaybrownlee.com — design system
   Shared by index.html and resume.html
   ========================================================================== */

:root {
  --paper: #fcfcfa;
  --paper-2: #f4f3ee;
  --paper-3: #eceae3;
  --card: #ffffff;
  --ink: #14171a;
  --ink-2: #3a4046;
  --muted: #6b7280;
  --muted-2: #8b939b;
  --line: rgba(20, 23, 26, 0.11);
  --line-2: rgba(20, 23, 26, 0.2);
  --accent: #0f5c48;
  --accent-2: #0a4536;
  --accent-wash: rgba(15, 92, 72, 0.07);
  --shadow-sm: 0 1px 2px rgba(20, 23, 26, 0.05);
  --shadow-md: 0 12px 32px rgba(20, 23, 26, 0.08);

  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1120px;
  --gut: clamp(20px, 5vw, 48px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1113;
    --paper-2: #151a1d;
    --paper-3: #1c2226;
    --card: #171c20;
    --ink: #e9edef;
    --ink-2: #b4bdc3;
    --muted: #7f898f;
    --muted-2: #6a747a;
    --line: rgba(255, 255, 255, 0.11);
    --line-2: rgba(255, 255, 255, 0.2);
    --accent: #63c9ab;
    --accent-2: #8bdcc3;
    --accent-wash: rgba(99, 201, 171, 0.1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

/* Explicit toggle wins over the media query, in both directions. */
:root[data-theme="light"] {
  --paper: #fcfcfa;
  --paper-2: #f4f3ee;
  --paper-3: #eceae3;
  --card: #ffffff;
  --ink: #14171a;
  --ink-2: #3a4046;
  --muted: #6b7280;
  --muted-2: #8b939b;
  --line: rgba(20, 23, 26, 0.11);
  --line-2: rgba(20, 23, 26, 0.2);
  --accent: #0f5c48;
  --accent-2: #0a4536;
  --accent-wash: rgba(15, 92, 72, 0.07);
  --shadow-sm: 0 1px 2px rgba(20, 23, 26, 0.05);
  --shadow-md: 0 12px 32px rgba(20, 23, 26, 0.08);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0e1113;
  --paper-2: #151a1d;
  --paper-3: #1c2226;
  --card: #171c20;
  --ink: #e9edef;
  --ink-2: #b4bdc3;
  --muted: #7f898f;
  --muted-2: #6a747a;
  --line: rgba(255, 255, 255, 0.11);
  --line-2: rgba(255, 255, 255, 0.2);
  --accent: #63c9ab;
  --accent-2: #8bdcc3;
  --accent-wash: rgba(99, 201, 171, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11";
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9rem;
}
.skip:focus {
  left: 12px;
  top: 12px;
}

.wrap {
  width: min(var(--wrap), 100%);
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* ----- Type scale ----------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

.eyebrow {
  display: block;
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lede {
  color: var(--ink-2);
  font-size: clamp(1.06rem, 1.4vw, 1.24rem);
  line-height: 1.62;
  max-width: 62ch;
}

/* ----- Header --------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}

.masthead .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 66px;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.wordmark b {
  font-weight: 600;
}
.wordmark span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.masthead nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.masthead nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease;
}
.masthead nav a:hover {
  background: var(--accent-wash);
  color: var(--accent);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.theme-toggle svg {
  width: 17px;
  height: 17px;
}
.theme-toggle .moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  .theme-toggle .sun {
    display: none;
  }
  .theme-toggle .moon {
    display: block;
  }
}
:root[data-theme="dark"] .theme-toggle .sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .moon {
  display: block;
}
:root[data-theme="light"] .theme-toggle .sun {
  display: block;
}
:root[data-theme="light"] .theme-toggle .moon {
  display: none;
}

/* ----- Buttons -------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease,
    background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.btn.primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--paper);
  box-shadow: var(--shadow-md);
}
.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ----- Hero ----------------------------------------------------------- */

.hero {
  padding: clamp(52px, 8vw, 104px) 0 clamp(40px, 5vw, 64px);
}

.hero h1 {
  font-size: clamp(2.5rem, 6.1vw, 4.6rem);
  font-variation-settings: "opsz" 40;
  margin-bottom: 26px;
}

.hero .role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 22px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hero .role i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted-2);
}

.hero .btn-row {
  margin-top: 34px;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.hero-note i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
  flex: none;
}

/* ----- Facts strip ---------------------------------------------------- */

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fact {
  padding: 26px 24px;
  border-right: 1px solid var(--line);
}
.fact:first-child {
  padding-left: 0;
}
.fact:last-child {
  padding-right: 0;
  border-right: none;
}
.fact dt {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.fact dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.fact dd small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
}

/* ----- Sections ------------------------------------------------------- */

.section {
  padding: clamp(56px, 8vw, 104px) 0;
  border-bottom: 1px solid var(--line);
}
.section:last-of-type {
  border-bottom: none;
}

.section-head {
  max-width: 68ch;
  margin-bottom: clamp(32px, 4vw, 52px);
}
.section-head h2 {
  font-size: clamp(1.95rem, 4vw, 3.1rem);
  font-variation-settings: "opsz" 32;
}
.section-head .lede {
  margin: 20px 0 0;
}

/* ----- Two tracks ----------------------------------------------------- */

.tracks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.track {
  display: flex;
  flex-direction: column;
  padding: 32px 30px 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.track h3 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}
.track .track-sub {
  margin: 0 0 20px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.track > p {
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: 1rem;
}
.track ul {
  margin: auto 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  display: grid;
  gap: 11px;
}
/* Absolutely positioned marker, not a grid child — otherwise any inline
   <strong>/<em> inside a bullet becomes its own layout item and stacks. */
.track li {
  position: relative;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.55;
}
.track li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ----- Case studies --------------------------------------------------- */

.cases {
  display: grid;
  gap: 18px;
}

.case {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 36px;
  padding: 34px 34px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.case:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
}

.case-meta .org {
  display: block;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}
.case-meta .when,
.case-meta .what {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.7;
}
.case-meta .what {
  color: var(--accent);
}

.case-body h3 {
  font-size: 1.5rem;
  margin-bottom: 14px;
}
.case-body p {
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 1rem;
}
.case-body p:last-child {
  margin-bottom: 0;
}
.case-body strong {
  color: var(--ink);
  font-weight: 600;
}

.outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.outcomes li {
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
}

/* ----- Current work --------------------------------------------------- */

.builds {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
}

.build {
  display: flex;
  flex-direction: column;
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    border-color 0.2s ease;
}
.build:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
}

.build-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.build h3 {
  font-size: 1.45rem;
}
.badge {
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge.live {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent);
}

.build > p {
  margin: 0 0 18px;
  color: var(--ink-2);
  font-size: 0.98rem;
}

.build .stack-line {
  margin: auto 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.7;
}

.build .go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
}
.build .go svg {
  width: 14px;
  height: 14px;
  transition: transform 0.16s ease;
}
.build:hover .go svg {
  transform: translate(2px, -2px);
}

/* ----- Experience table ---------------------------------------------- */

.roles {
  border-top: 1px solid var(--line);
}
.role-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 150px;
  gap: 28px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.role-row .yr {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.role-row .co {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}
.role-row .co span {
  display: block;
  margin-top: 3px;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0;
}
.role-row .ttl {
  color: var(--ink-2);
  font-size: 0.9rem;
  text-align: right;
}

/* ----- Stack ---------------------------------------------------------- */

.stack-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px 48px;
}
.stack-group h3 {
  margin-bottom: 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* ----- Contact -------------------------------------------------------- */

.contact {
  padding: clamp(64px, 9vw, 116px) 0;
}
.contact h2 {
  font-size: clamp(2.2rem, 5.4vw, 4rem);
  font-variation-settings: "opsz" 36;
}
.contact .lede {
  margin: 22px 0 34px;
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 44px 0 0;
  padding: 1px 0 0;
  border-top: 1px solid var(--line);
}
.contact-list a {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  transition: color 0.16s ease;
}
.contact-list a:hover {
  color: var(--accent);
}
.contact-list dt {
  margin: 0 0 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.contact-list dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* ----- Footer --------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 30px 0 46px;
  color: var(--muted);
  font-size: 0.85rem;
}
.foot .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.foot a:hover {
  color: var(--accent);
}

/* ----- Reveal --------------------------------------------------------- */

/* Gated on .js so the content is never hidden when scripting is unavailable. */
html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
html.js .reveal.shown {
  opacity: 1;
  transform: none;
}

/* ----- Responsive ----------------------------------------------------- */

@media (max-width: 940px) {
  .facts {
    grid-template-columns: 1fr 1fr;
  }
  .fact {
    padding: 22px 20px 22px 0;
  }
  .fact:nth-child(1),
  .fact:nth-child(2) {
    border-bottom: 1px solid var(--line);
  }
  .fact:nth-child(2) {
    border-right: none;
    padding-right: 0;
  }
  .fact:nth-child(3) {
    padding-left: 0;
  }
  .tracks,
  .builds,
  .stack-groups {
    grid-template-columns: 1fr;
  }
  .case {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 26px;
  }
  .case-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 14px;
  }
  .role-row {
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 8px 22px;
  }
  .role-row .ttl {
    grid-column: 2;
    text-align: left;
  }
  .contact-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }
  .masthead .wrap {
    gap: 10px;
  }
  /* Keep the bar from overflowing: drop the location and the in-page jumps,
     leaving the two links that actually matter plus the theme toggle. */
  .wordmark span {
    display: none;
  }
  .masthead nav {
    gap: 0;
  }
  .masthead nav a {
    padding: 8px 8px;
    font-size: 0.85rem;
  }
  .masthead nav a.hide-sm {
    display: none;
  }
  .theme-toggle {
    margin-left: 2px;
  }
  .facts {
    grid-template-columns: 1fr;
  }
  .fact {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 20px 0;
  }
  .fact:last-child {
    border-bottom: none;
  }
  .btn {
    width: 100%;
  }
  .role-row {
    grid-template-columns: 1fr;
  }
  .role-row .ttl {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
  html.js .reveal {
    opacity: 1;
    transform: none;
  }
}
