/* ---------- tokens ---------- */
:root {
  --paper:     #F2EFE9;
  --card:      #FCFAF6;
  --ink:       #22252A;
  --slate:     #5E6167;
  --rule:      #DFDAD1;

  --pine:      #1C5348;
  --pine-deep: #123B33;
  --mint:      #A6D8C4;
  --mint-soft: #DDEFE6;
  --pink:      #F4B4E0;
  --pink-soft: #FBE2F2;

  --display: "Rubik", system-ui, sans-serif;
  --body:    "DM Sans", system-ui, sans-serif;
  --script:  "Caveat Brush", "Bradley Hand", cursive;

  --measure: 60ch;
  --gutter:  clamp(1.25rem, 5vw, 4rem);
  --radius:  18px;
}

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

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

/* the hero button jumps down the page, so ease it rather than teleport */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pine); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 2.5px solid var(--pine);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--gutter);
  top: 0.75rem;
  z-index: 10;
  background: var(--ink);
  color: var(--card);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
}

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--gutter);
  border-bottom: 1.5px solid var(--ink);
  background: var(--paper);
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
  text-decoration: none;
  color: var(--ink);
}
.wordmark:hover { color: var(--pine); }

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 500;
}

.masthead nav a {
  color: var(--slate);
  text-decoration: none;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
}
.masthead nav a:hover { color: var(--ink); background: var(--mint-soft); }
.masthead nav a[aria-current="page"] {
  color: var(--pine-deep);
  border-color: var(--ink);
  background: var(--mint-soft);
}

/* ---------- layout ---------- */
main { padding: 0 var(--gutter); }

.wrap { max-width: 62rem; margin: 0 auto; }

.section { padding: 3.25rem 0; scroll-margin-top: 1.5rem; }

.eyebrow {
  font-family: var(--display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pine);
  margin: 0 0 1.75rem;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2.5rem, 6vw, 4rem);
}

.hi {
  font-family: var(--script);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  color: var(--pine);
  margin: 0 0 0.1rem;
  transform: rotate(-2.5deg);
  transform-origin: left center;
}

/* the stacked name, built like the sticker: dark line over green line */
.bigname {
  font-size: clamp(2.9rem, 8.5vw, 5.1rem);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0 0 1.4rem;
}
.bigname .l1 {
  display: block;
  color: var(--ink);
  text-shadow: 3px 3px 0 var(--pink);
}
.bigname .l2 {
  display: block;
  color: var(--pine);
  text-shadow: 3px 3px 0 var(--mint);
}

.hero .lede { margin-bottom: 1.1rem; }

.lede {
  max-width: var(--measure);
  font-size: 1.06rem;
  color: var(--slate);
  margin: 0 0 1.15rem;
}
.lede strong { color: var(--ink); font-weight: 700; }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.6rem;
}

.btn {
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-solid { background: var(--pine); color: var(--card); }
.btn-ghost { background: var(--card); color: var(--ink); }
.btn:hover {
  color: var(--card);
  background: var(--ink);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--mint);
}
.btn-ghost:hover { box-shadow: 3px 3px 0 var(--pink); }

/* ---------- the interactive item explorer ---------- */
.explorer {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 7px 7px 0 var(--mint);
  padding: 1.35rem 1.35rem 1.15rem;
  margin: 0;
}

.explorer-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
  margin: 0 0 0.9rem;
}

.explorer svg { width: 100%; height: auto; display: block; touch-action: none; cursor: grab; }
.explorer svg:active { cursor: grabbing; }

.plot-frame { fill: none; stroke: var(--rule); stroke-width: 1; }
.plot-grid  { stroke: var(--rule); stroke-width: 0.75; stroke-dasharray: 2 3; }
.plot-fill  { fill: var(--mint); opacity: 0.28; }
.plot-line  { fill: none; stroke: var(--pine); stroke-width: 2.5; stroke-linecap: round; }
.plot-label { font-family: "DM Sans", sans-serif; font-size: 7px; fill: var(--slate); }

.model-dot {
  fill: var(--card);
  stroke: var(--ink);
  stroke-width: 1.25;
  transition: r 0.12s ease;
}
.model-hit { fill: transparent; cursor: pointer; }
.model-hit:hover + .model-dot,
.model-hit:focus + .model-dot { fill: var(--pink); r: 5; }

.handle { cursor: grab; }
.handle:active { cursor: grabbing; }

.handle-ring {
  stroke: var(--ink);
  stroke-width: 1.5;
  transition: r 0.12s ease;
}
.handle-b .handle-ring { fill: var(--pink); }
.handle-a .handle-ring { fill: var(--mint); }
.handle:hover .handle-ring,
.handle:focus-visible .handle-ring { r: 6.5; }

.handle-pulse { opacity: 0.3; }
.handle-b .handle-pulse { fill: var(--pink); }
.handle-a .handle-pulse { fill: var(--mint); }

.readout {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin: 0.75rem 0 0;
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--slate);
}
.readout b {
  font-weight: 700;
  color: var(--pine-deep);
  font-variant-numeric: tabular-nums;
}

.sliders {
  display: grid;
  gap: 0.5rem 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1.5px solid var(--rule);
}
.sliders label {
  display: grid;
  gap: 0.15rem;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--slate);
}
.sliders input[type="range"] {
  width: 100%;
  accent-color: var(--pine);
  margin: 0;
}

.explorer figcaption {
  font-size: 0.78rem;
  color: var(--slate);
  line-height: 1.55;
  margin-top: 0.85rem;
}

.tooltip {
  font-family: var(--display);
  font-size: 7.5px;
  font-weight: 600;
  fill: var(--ink);
}
.tooltip-box {
  fill: var(--card);
  stroke: var(--ink);
  stroke-width: 1;
  rx: 3;
}

/* ---------- work cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.35rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:nth-child(3n+1) { box-shadow: 5px 5px 0 var(--mint); }
.card:nth-child(3n+2) { box-shadow: 5px 5px 0 var(--pink); }
.card:nth-child(3n+3) { box-shadow: 5px 5px 0 var(--mint-soft); }
.card:hover { transform: translate(-2px, -2px); }
.card:nth-child(3n+1):hover { box-shadow: 8px 8px 0 var(--mint); }
.card:nth-child(3n+2):hover { box-shadow: 8px 8px 0 var(--pink); }
.card:nth-child(3n+3):hover { box-shadow: 8px 8px 0 var(--mint-soft); }

.card { text-decoration: none; color: inherit; }
.card h3 { font-size: 1.2rem; margin-bottom: 0.15rem; color: var(--ink); }
.card:hover h3, .card:focus-visible h3 { color: var(--pine); }
.card .meta { margin-bottom: 0.7rem; }
.card .summary { font-size: 0.94rem; color: var(--slate); margin: 0 0 1rem; }
.card .tags { margin-top: auto; }

/* ---------- scrolling page tickers ---------- */
.tickers { display: grid; gap: 0.85rem; }

.ticker-row {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 0.8rem 1.15rem;
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.ticker-row:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--mint);
}

.ticker-label {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.ticker-label:hover { color: var(--pine); }
.tile-arrow { color: var(--pine); display: inline-block; transition: transform 0.18s ease; }
.ticker-label:hover .tile-arrow { transform: translateX(3px); }

/* fade the ends so items slide in and out rather than popping */
.ticker {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 2rem, #000 calc(100% - 2rem), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 2rem, #000 calc(100% - 2rem), transparent);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 30s linear infinite;
}
.ticker-group { display: flex; }

/* stop on hover or keyboard focus, so the links can actually be clicked */
.ticker-row:hover .ticker-track,
.ticker-track:focus-within { animation-play-state: paused; }

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-right: 0.85rem;
  white-space: nowrap;
}
.ticker-item a {
  font-size: 0.92rem;
  color: var(--slate);
  text-decoration: none;
}
.ticker-item a:hover { color: var(--pine); text-decoration: underline; }
.ticker-sep { color: var(--mint); font-size: 1.1rem; line-height: 1; }

@keyframes ticker-scroll { to { transform: translateX(-50%); } }

@media (max-width: 34rem) {
  .ticker-row { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ---------- entries ---------- */
.entry {
  padding-left: 1.25rem;
  border-left: 2.5px solid var(--mint);
  margin-bottom: 2.75rem;
  scroll-margin-top: 1.5rem;
}
/* flash the entry you arrived at from a homepage card */
.entry:target { border-left-color: var(--pink); }
.entry:last-child { margin-bottom: 0; }

.entry h3 { font-size: 1.25rem; margin-bottom: 0.2rem; }
.entry h3 a { text-decoration: none; color: var(--ink); }
.entry h3 a:hover { color: var(--pine); }

.entry .role { font-size: 0.95rem; font-weight: 500; color: var(--ink); margin: 0 0 0.15rem; }

.meta {
  font-family: var(--display);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--slate);
  margin: 0 0 0.9rem;
}

.entry ul { margin: 0; padding-left: 1.05rem; max-width: var(--measure); }
.entry li { margin-bottom: 0.5rem; color: var(--slate); }
.entry li::marker { color: var(--mint); }
.entry li:last-child { margin-bottom: 0; }

.entry p.summary { margin: 0 0 0.9rem; max-width: var(--measure); color: var(--slate); }

.subentry { margin-top: 1.75rem; }
.subentry .role { font-weight: 700; }

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
}
.tags li {
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--pine-deep);
  background: var(--mint-soft);
  border: 1.5px solid var(--mint);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin: 0;
}

.linkrow {
  margin: 0.9rem 0 0;
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ---------- awards ---------- */
.awards { list-style: none; margin: 0; padding: 0; }
.awards li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.9rem 0;
  border-bottom: 1.5px solid var(--rule);
}
.awards li:first-child { border-top: 1.5px solid var(--rule); }
.awards li:target { background: var(--pink-soft); box-shadow: 0 0 0 0.5rem var(--pink-soft); border-radius: 2px; }
.awards .award-name { font-size: 1rem; font-weight: 500; }
.awards .award-name span { display: block; color: var(--slate); font-size: 0.88rem; font-weight: 400; }
.awards .award-year {
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pine);
}

/* ---------- footer ---------- */
.footer {
  margin-top: 4rem;
  border-top: 1.5px solid var(--ink);
  padding: 2rem var(--gutter) 3rem;
}
.footer-inner {
  max-width: 62rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: baseline;
}
.footer-name { font-family: var(--display); font-weight: 700; margin: 0; }
.footer-links {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 500;
}

/* ---------- responsive ---------- */
@media (max-width: 60rem) {
  .hero { grid-template-columns: 1fr; }
}

@media (max-width: 34rem) {
  .masthead { flex-direction: column; align-items: flex-start; }
  .masthead nav { gap: 0.3rem; margin-left: -0.75rem; }
  .explorer { box-shadow: 4px 4px 0 var(--mint); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
