/* ============================================================
   Design tokens — one accent, near-black ground, quiet borders.
   Swap --accent to re-skin the whole site.
   ============================================================ */
:root {
  --bg: #0b0d10;
  --surface: #11141a;
  --border: #1e2430;
  --border-strong: #2a3242;
  --text: #e6eaf2;
  --muted: #8b94a7;
  --accent: #5eead4;
  --accent-dim: rgba(94, 234, 212, 0.08);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --w: 46rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* faint dot grid, visible only if you look for it */
  background-image: radial-gradient(rgba(139, 148, 167, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
}

.mono { font-family: var(--font-mono); }
.accent-text { color: var(--accent); }

a { color: var(--text); text-decoration: none; }
p a, .contact-lede a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
p a:hover { text-decoration-style: solid; }

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

/* ============ Nav ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--w);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  backdrop-filter: blur(8px);
  background: rgba(11, 13, 16, 0.82);
  border-bottom: 1px solid transparent;
}
body.scrolled .nav { border-bottom-color: var(--border); }

.nav-brand { font-family: var(--font-mono); font-size: 0.95rem; }
.prompt { color: var(--accent); }
.cursor { animation: blink 1.2s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; gap: 1.4rem; font-family: var(--font-mono); font-size: 0.85rem; }
.nav-links a { color: var(--muted); transition: color 120ms ease; }
.nav-links a:hover { color: var(--text); }
.nav-resume { color: var(--accent) !important; }

/* ============ Layout ============ */
main {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============ Hero ============ */
.hero { padding: 7rem 0 5rem; }
.hero-greeting {
  font-size: clamp(1.6rem, 4.5vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.15;
  white-space: nowrap; /* one line above mobile; script.js shrinks to fit */
}
.hero-cols {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
}
.pixel-art { width: 11rem; height: 11rem; flex: none; }

.hero-body { margin-top: 1.5rem; max-width: 34rem; color: var(--muted); }

/* ============ Buttons ============ */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}
.btn:hover { border-color: var(--accent); background: var(--accent-dim); }
.btn-primary { border-color: var(--accent); color: var(--accent); }

/* ============ Sections ============ */
.section { padding: 3.5rem 0; border-top: 1px solid var(--border); }
.section h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}
.section-num { color: var(--accent); font-size: 1rem; margin-right: 0.4rem; }

/* ============ Timeline (experience) ============ */
.timeline { list-style: none; display: grid; gap: 2.2rem; }
.timeline-item {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1.5rem;
}
.timeline-meta { color: var(--muted); font-size: 0.8rem; padding-top: 0.3rem; }
.timeline-body h3 { font-size: 1.05rem; font-weight: 600; }
.timeline-body .role { color: var(--muted); font-weight: 400; }
.timeline-body p { margin-top: 0.5rem; color: var(--muted); font-size: 0.97rem; }

/* ============ Interactive experience timeline ============ */

.xp-bullets { list-style: none; margin-top: 0.5rem; display: grid; gap: 0.3rem; }
.xp-bullets li { color: var(--muted); font-size: 0.97rem; padding-left: 1.1rem; position: relative; }
.xp-bullets li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }

/* Constellation: canvas-rendered sky (bloom stars, parallax dust, faint
   line) in frost monochrome; a star takes its brand color when selected.
   The DOM elements here are labels + invisible accessible hit targets. */
.xp-axis {
  position: relative;
  height: 11rem;
  margin: 2.5rem 0 1rem;
}
.sand-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.xp-sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.xp-star {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  opacity: 0;
}
.xp-star.flip { flex-direction: column-reverse; }

/* Labels fade in on the same stagger as the canvas stars. */
.section.visible .xp-star {
  animation: star-in 420ms ease var(--in-delay, 0s) forwards;
}
@keyframes star-in {
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .xp-star { opacity: 1; animation: none !important; }
}
.xp-node {
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.xp-node:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}
.xp-node-label {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color 150ms ease;
}
.xp-star:hover .xp-node-label { color: var(--text); }
.xp-star.active .xp-node-label { color: var(--star); }

.xp-detail {
  overflow: hidden;
  transition: height 220ms cubic-bezier(0.22, 1, 0.36, 1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--star, var(--border));
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  min-height: 0;
}
.xp-detail .timeline-meta { margin-bottom: 0.3rem; }
/* Card entrance: slow-out easing with a small follow-through overshoot —
   snappy (200ms) but never abrupt. */
.xp-detail-inner { animation: xp-in 200ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes xp-in {
  0% { opacity: 0; transform: translateY(9px) scale(0.985); }
  70% { opacity: 1; transform: translateY(-2px) scale(1.004); }
  100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .xp-detail-inner { animation: none; }
}

/* ============ Tags ============ */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.tags li {
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid transparent;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* ============ Project cards ============ */
/* Product identities and lightweight, responsive product previews. */
.project-showcase { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.project-card { --project-accent: #82b4ff; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: var(--surface); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; min-width: 0; }
.project-card:hover { transform: translateY(-5px); border-color: var(--project-accent); box-shadow: 0 15px 45px #0004; }
.hermes-card { --project-accent: #22d3ee; }
.project-preview { height: 280px; display: block; position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.coldread-preview { color: #e5edff; background: radial-gradient(ellipse at 70% 40%, #19498166, transparent 75%), #080e19; text-decoration: none; }
.project-details { padding: 23px; }
.project-brand { display: flex; gap: 11px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
/* Hermes app icon copied from its Xcode asset catalog. */
.actual-hermes-brand { display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 50%, #0e56752b, transparent 70%), #000; gap: 8px; }
.actual-hermes-brand > img { width: 150px; height: 150px; object-fit: contain; }
.hermes-wordmark { font-size: 25px; font-weight: 300; letter-spacing: 7px; color: #eaf7ff; padding-left: 7px; }
.hermes-brand-caption { font-size: 7px; letter-spacing: 2px; color: #6facc6; margin-top: 8px; }
.actual-site-preview { width: 100%; height: 100%; object-fit: cover; object-position: left top; display: block; }
.actual-preview-caption { position: absolute; bottom: 12px; left: 16px; font-size: 9px; color: #a6d9ef; background: #080d12dd; padding: 6px 9px; border: 1px solid #82b4ff25; border-radius: 5px; }
.project-brand .coldread-wordmark { font-family: var(--font-mono); font-weight: 400; letter-spacing: .03em; }
.coldread-wordmark > span { color: #8bd5ef; }
.coldread-wordmark > i { display: inline-block; width: 7px; height: 15px; background: #8bd5ef; margin-left: 3px; vertical-align: -2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.project-preview:focus-visible, .project-link:focus-visible { outline: 2px solid var(--project-accent); outline-offset: -3px; }
@media (max-width: 640px) { .project-showcase { grid-template-columns: 1fr; } .project-preview { height: 285px; } .report-preview strong { font-size: 30px; } .fitness-phone { left: 25%; } .fitness-watch { right: 20%; } }
@media (prefers-reduced-motion: reduce) { .project-card { transition: none; } .project-card:hover { transform: none; } }

/* ============ Writing ============ */
.articles { list-style: none; display: grid; gap: 2rem; }
.article-item {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1.5rem;
}
.article-meta { color: var(--muted); font-size: 0.8rem; padding-top: 0.35rem; }
.article-body h3 { font-size: 1.05rem; font-weight: 600; }
.article-body h3 a { text-decoration: none; transition: color 120ms ease; }
.article-body h3 a:hover { color: var(--accent); }
.article-arrow {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent);
  display: inline-block;
  transition: transform 120ms ease;
}
.article-body h3 a:hover .article-arrow { transform: translate(2px, -2px); }
.article-body p { margin-top: 0.5rem; color: var(--muted); font-size: 0.97rem; max-width: 36rem; }

@media (max-width: 40rem) {
  .article-item { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* ============ Contact ============ */
.contact-lede { color: var(--muted); max-width: 32rem; }
.contact-row { margin-top: 1.6rem; display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.social { list-style: none; display: flex; gap: 1.4rem; margin-top: 2rem; font-size: 0.85rem; }
.social a { color: var(--muted); }
.social a:hover { color: var(--accent); }

/* ============ Footer ============ */
.footer {
  max-width: var(--w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  display: flex;
  gap: 0.6rem;
}
.footer a { color: var(--muted); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.footer a:hover { color: var(--accent); }

/* ============ Scroll reveal ============ */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 500ms ease, transform 500ms ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cursor { animation: none; }
  .card, .btn { transition: none; }
}

/* ============ Small screens ============ */
@media (max-width: 40rem) {
  /* One-scroll page on mobile: keep only brand + resume in the nav so it
     never overflows the viewport. */
  .nav-links a:not(.nav-resume) { display: none; }
  .hero { padding: 3.5rem 0 1rem; }
  .section { padding: 2.5rem 0; }
  .hero-greeting { white-space: normal; }
  .hero-cols { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .pixel-art { align-self: center; width: 8.5rem; height: 8.5rem; }
  .timeline-item { grid-template-columns: 1fr; gap: 0.4rem; }
  .nav-links { gap: 1rem; }
  /* Taller sky on small screens so the stars breathe */
  .xp-axis { height: 15rem; }
}


.project-brand img { border-radius: 12px; flex-shrink: 0; }
.project-brand h3 { font-size: 1.1rem; letter-spacing: -.4px; }
.project-category { display: block; font-size: 8px; color: var(--muted); margin-top: 3px; }
.project-status { margin-left: auto; font-size: 8px; padding: 5px 7px; border: 1px solid var(--border-strong); border-radius: 20px; color: #c3cbd8; }
.project-status.live { color: #96c4ff; border-color: #82b4ff40; }
.project-details h4 { font-size: 1.16rem; font-weight: 500; line-height: 1.35; letter-spacing: -.4px; margin-bottom: 10px; }
.project-details p { font-size: .87rem; line-height: 1.7; color: var(--muted); }
.project-details .tags { margin-top: 18px; gap: 5px; }
.project-details .tags li { font-size: 9px; }
.project-link, .project-coming { display: flex; justify-content: space-between; margin-top: 23px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 11px; }
.project-link { color: #a6cbff; text-decoration: none; }
.project-link:hover { color: white; }
.project-coming { color: var(--muted); }

.project-brand img.coldread-brand-mark { object-fit: contain; padding: 7px 1px; filter: invert(1); border-radius: 0; }

/* Short experience notes, sized to their content. */
.experience-brand { display: flex; align-items: center; gap: 13px; margin: 8px 0 14px; }
.experience-logo { width: 40px; height: 40px; object-fit: contain; padding: 6px; background: #fff; border-radius: 9px; flex-shrink: 0; }
.experience-brand h3 { font-size: 1.08rem; line-height: 1.3; }
.experience-role { display: block; font-size: .78rem; color: var(--muted); margin-top: 3px; }
.experience-summary { color: #bbc3d1; font-size: .97rem; line-height: 1.6; max-width: 37rem; }
.xp-detail { padding: 1.2rem 1.5rem 1.4rem; }
.xp-detail .timeline-meta { font-size: .72rem; }
 .pappy-card { --project-accent: #b575ec; }
.pappy-preview { background: radial-gradient(ellipse at 50% 85%, #65429c30, transparent 70%), #101019; }
.pappy-preview > img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; padding: 16px 20px 0; }

/* Projects get a wider canvas than the reading column. */
#projects {
  width: min(80rem, calc(100vw - 4rem));
  margin-inline: calc((100% - min(80rem, calc(100vw - 4rem))) / 2);
  scroll-margin-top: 5rem;
}
.project-card { display: flex; flex-direction: column; }
.project-details { display: flex; flex-direction: column; flex: 1; padding: clamp(1.25rem, 2.1vw, 1.75rem); }
.project-details .tags { margin-bottom: 1.4rem; }
.project-link, .project-coming { margin-top: auto; }
.project-preview { flex: none; height: auto; aspect-ratio: 1.5; }
.project-brand { row-gap: 9px; }
@media (min-width: 64rem) {
  .project-showcase { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.75rem); }
  .project-brand { gap: 10px; }
  .project-status { font-size: 8px; }
  .project-details h4 { font-size: clamp(1.1rem, 1.5vw, 1.35rem); }
  .project-details p { font-size: .9rem; }
  .actual-hermes-brand > img { width: clamp(90px, 10vw, 140px); height: clamp(90px, 10vw, 140px); }
  .hermes-wordmark { font-size: clamp(18px, 1.8vw, 25px); }
}
@media (min-width: 40.01rem) and (max-width: 63.99rem) {
  .project-showcase { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 40rem) {
  #projects { width: 100%; margin-inline: 0; }
  .project-showcase { grid-template-columns: 1fr; }
}

/* Give the opening and career constellation a desktop scale. */
@media (min-width: 64rem) {
  .hero, #journey {
    width: min(68rem, calc(100vw - 6rem));
    margin-inline: calc((100% - min(68rem, calc(100vw - 6rem))) / 2);
  }
  .hero { padding: 8rem 0 5.5rem; }
  .hero-greeting { font-size: clamp(3rem, 4.5vw, 4.25rem); }
  .hero-cols { gap: 4rem; }
  .hero-text { flex: 1; }
  .hero-body { max-width: 43rem; margin-top: 2rem; font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.75; }
  .pixel-art { width: clamp(14rem, 20vw, 19rem); height: clamp(14rem, 20vw, 19rem); }
  #journey { padding-block: 4rem; }
  #journey > h2 { font-size: 1.8rem; }
  .xp-axis { height: 15rem; margin: 2.5rem 0 1.5rem; }
  .xp-node-label { font-size: .85rem; }
  .xp-node { width: 2.6rem; height: 2.6rem; }
  .xp-detail { padding: 1.5rem 1.75rem; }
  .experience-brand h3 { font-size: 1.22rem; }
  .experience-logo { width: 46px; height: 46px; }
  .experience-role { font-size: .85rem; }
  .experience-summary { font-size: 1.08rem; max-width: 52rem; }
  .xp-detail .timeline-meta { font-size: .8rem; }
}

/* Carry the desktop rhythm through the final sections. */
@media (min-width: 64rem) {
  #writing, #contact {
    width: min(68rem, calc(100vw - 6rem));
    margin-inline: calc((100% - min(68rem, calc(100vw - 6rem))) / 2);
    padding-block: 4rem;
    scroll-margin-top: 5rem;
  }
  #writing > h2, #contact > h2 { font-size: 1.8rem; }
  .section-num { font-size: 1.1rem; }
  .article-item { grid-template-columns: 12rem minmax(0, 1fr); gap: 2.5rem; }
  .article-meta { font-size: .9rem; }
  .article-body h3 { font-size: 1.4rem; line-height: 1.4; }
  .article-body p { max-width: 48rem; font-size: 1.08rem; line-height: 1.75; margin-top: .85rem; }
  .article-body .tags { margin-top: 1.25rem; }
  .contact-lede { max-width: 48rem; font-size: 1.2rem; line-height: 1.75; }
  .contact-row { margin-top: 2rem; gap: 1rem; }
  .contact-row .btn { font-size: 1rem; padding: .85rem 1.2rem; }
  .social { font-size: 1rem; gap: 2rem; margin-top: 2.5rem; }
  .footer { max-width: none; width: min(68rem, calc(100vw - 6rem)); padding: 2.5rem 0; font-size: .85rem; flex-wrap: wrap; }
}

.pappy-preview > img { padding: 0; object-fit: contain; object-position: center; }

.pappy-preview { background: #101218; }
.pappy-card { --project-accent: #768293; }

.pappy-calm-preview { background: #101218; }
.pappy-calm-preview > img.pappy-character { position: absolute; inset: auto 0 0; width: 100%; height: 81%; object-fit: contain; object-position: center bottom; filter: none; }
.pappy-calm-preview > img.tool-icon { position: absolute; width: 8%; height: 12%; padding: 0; object-fit: contain; object-position: center; filter: none; opacity: .85; }
.tool-github { left: 12%; top: 38%; }
.tool-mixpanel { left: 26%; top: 17%; }
.tool-granola { left: 46%; top: 6%; border-radius: 5px; }
.tool-snowflake { right: 26%; top: 17%; }
.tool-slack { right: 12%; top: 38%; }

/* Preserve the juggling pose and the character’s original purple color. */
.pappy-calm-preview > img.pappy-character { height: 81%; width: 100%; filter: saturate(1.15); object-fit: contain; object-position: center bottom; }
.tool-github { left: 13%; top: 43%; }
.tool-mixpanel { left: 25%; top: 17%; }
.tool-granola { left: 46%; top: 4%; }
.tool-snowflake { right: 25%; top: 17%; }
.tool-slack { right: 13%; top: 43%; }

.project-details > p { margin-bottom: 1.75rem; }
.project-category { font-size: .65rem; }
