/* ============================================================
   jesselanderson.com — pink masthead / project gallery
   Pink frames the site; copper remains in the unfiltered artwork.
   ============================================================ */

:root {
  color-scheme: light;

  /* Light palette; artwork retains its original colors in either mode. */
  --bg: #faf7f8;
  --bg-soft: #f0e9ed;
  --bg-panel: #e8dde3;
  --fg: #211c20;
  --fg-soft: #595057;
  --fg-quiet: #6d6069;
  --accent: #a52461;
  --accent-soft: rgba(165, 36, 97, 0.12);
  --masthead: #f4b8d2;
  --masthead-ink: #301c29;
  --pink: var(--line-strong); /* Legacy component token, now a neutral border. */
  --pink-soft: var(--fg-soft);
  --line: #ddd0d7;
  --line-strong: #ab95a2;
  --art-caption: #ffd0a2;

  /* Typography */
  --font-display: var(--font-body);
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* Layout */
  --measure: 1080px;
  --measure-wide: 1080px;
  --pad: clamp(1.5rem, 4vw, 3rem);
  --gap-section: clamp(2.5rem, 5vw, 4rem);
}

/* System is the default, including when scripting or storage is disabled. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #181619;
    --bg-soft: #231f24;
    --bg-panel: #302831;
    --fg: #f6edf2;
    --fg-soft: #c9bbc5;
    --fg-quiet: #b5a2af;
    --accent: #ff95c6;
    --accent-soft: rgba(255, 149, 198, 0.12);
    --masthead: #2b2028;
    --masthead-ink: #efc7da;
    --line: #44333f;
    --line-strong: #806576;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181619;
  --bg-soft: #231f24;
  --bg-panel: #302831;
  --fg: #f6edf2;
  --fg-soft: #c9bbc5;
  --fg-quiet: #b5a2af;
  --accent: #ff95c6;
  --accent-soft: rgba(255, 149, 198, 0.12);
  --masthead: #2b2028;
  --masthead-ink: #efc7da;
  --line: #44333f;
  --line-strong: #806576;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased; 
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  border-bottom: none;
  transition: text-decoration-color 160ms ease;
}
a:hover { text-decoration-thickness: 2px; }

img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 1rem;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); font-weight: 700;}
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 400;}
h3 { font-size: 1.15rem; font-weight: 400;}

p { margin: 0 0 1rem; max-width: var(--measure); }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.1em 0.35em;
}

.accent { color: var(--accent); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg-quiet);
  margin: 0 0 0.75rem;
}

.lede {
  font-size: 1.2rem;
  color: var(--fg-soft);
  max-width: var(--measure);
}

.lede-soft {
  font-size: 1rem;
  color: var(--fg-soft);
  max-width: var(--measure);
}

.section-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  margin-bottom: 1.5rem;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   Site shell
   ============================================================ */

.site-brand {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem var(--pad);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--fg);
  border: none;
}
.site-logo:hover { color: var(--accent); }

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--pink);
  border-radius: 2px;
  background: var(--bg-soft);
}

.site-nav-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0;
  margin-left: auto;
}
.site-nav-primary a {
  color: var(--fg-soft);
  border: none;
  white-space: nowrap;
}
.site-nav-primary a:hover { color: var(--fg); }
.site-nav-primary a[aria-current="page"] { color: var(--accent); }

.site-nav:empty { display: none; }
.site-logo { text-decoration: none; }
.brand-dot { color: var(--accent); }
.theme-control { position: relative; display: inline-flex; align-items: center; font-size: 0.8rem; color: var(--fg-soft); border-radius: 4px; }
.theme-control[hidden] { display: none; }
.theme-control:hover { color: var(--fg); background: var(--bg-soft); }
.theme-control select { appearance: none; font: inherit; color: inherit; background: transparent; border: 0; border-radius: inherit; padding: 0.5rem 1.4rem 0.5rem 2rem; min-height: 44px; cursor: pointer; }
.theme-control option { color: var(--fg); background: var(--bg); }
.theme-icon, .theme-chevron { position: absolute; pointer-events: none; }
.theme-icon { left: 0.5rem; }
.theme-chevron { right: 0.4rem; }
@media (forced-colors: active) {
  .theme-control select { appearance: auto; padding: 0.5rem; }
  .theme-icon, .theme-chevron { display: none; }
}
@media (max-width: 640px) {
  .site-brand { gap: 1rem; }
  .site-nav-primary { order: 3; width: 100%; margin-left: 0; gap: 1.2rem; }
  .theme-control { margin-left: auto; }
}

footer {
  margin-top: auto;
  padding: 4rem var(--pad) 2rem;
  text-align: center;
  color: var(--fg-quiet);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  border-top: 1px solid var(--line);
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

main {
  flex: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--pad);
  width: 100%;
}

section { margin-bottom: var(--gap-section); }

/* ============================================================
   Image placeholders (until real imagery arrives)
   ============================================================ */

.image-placeholder {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(217, 119, 87, 0.16), transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(80, 90, 100, 0.14), transparent 60%),
    linear-gradient(135deg, #1c1d22 0%, #0c0c0e 100%);
  border: 1px solid var(--line);
  margin: 1.5rem 0;
  overflow: hidden;
}
.image-placeholder::before {
  content: "";
  position: absolute; inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.2 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.35;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.image-placeholder::after {
  content: attr(data-note);
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--art-caption);
  background: rgba(12, 12, 14, 0.9);
  padding: 0.35rem 0.6rem;
  border-radius: 2px;
}
.image-placeholder--hero { aspect-ratio: 21 / 9; }

/* When a real image is supplied: drop the forced 21:9 (or 16:9) aspect-ratio
   and let the image's own dimensions decide the box height; hide the gradient
   and noise overlay; keep the bottom-left caption (::after) overlaying the
   image as a small monospace tag. The shape's border, radius, and margin stay. */
.image-placeholder--filled {
    background: transparent;
    aspect-ratio: auto;
}
.image-placeholder--filled::before {
    display: none;
}
.image-placeholder img {
    width: 100%;
    height: auto;
    display: block;
}

/* Carousel: slides stack inside the .image-placeholder shell. The active
   slide is `position: relative` and provides the box height. The rest overlay
   it with `position: absolute` and crossfade in/out via opacity. */
.image-placeholder--carousel {
    position: relative;
}
.image-placeholder--carousel .carousel-slide {
    margin: 0;
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}
.image-placeholder--carousel .carousel-slide.is-active {
    position: relative;
    opacity: 1;
    pointer-events: auto;
}
.image-placeholder--carousel .carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.image-placeholder--carousel .carousel-slide.is-active img {
    height: auto;
}
.carousel-caption {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    color: var(--art-caption);
    background: rgba(12, 12, 14, 0.9);
    padding: 0.35rem 0.6rem;
    border-radius: 2px;
}
.carousel-dots {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.4rem;
    z-index: 2;
}
.carousel-dot {
    width: 0.55rem;
    height: 0.55rem;
    border: 0;
    border-radius: 50%;
    background: var(--pink-soft);
    cursor: pointer;
    padding: 0;
    transition: background 160ms ease, transform 160ms ease;
}
.carousel-dot:hover { background: var(--pink); }
.carousel-dot.is-active {
    background: var(--pink);
    transform: scale(1.15);
}

/* ============================================================
   Page header (used on /work, /about, /now, for-agents)
   ============================================================ */

.page-header {
  margin-bottom: var(--gap-section);
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

/* ============================================================
   Home
   ============================================================ */

.home .hero { margin-bottom: var(--gap-section); }

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 2rem;
  max-width: 22ch;
}
.hero-headline--accent { color: var(--accent); }

.intro {
  margin: var(--gap-section) 0;
}
.intro p { font-size: 1.05rem; color: var(--fg-soft); max-width: var(--measure-wide); }
.intro p strong { color: var(--fg); }

.footer-beat {
  margin-top: var(--gap-section);
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  color: var(--fg-soft);
}
.footer-beat p { max-width: var(--measure-wide); }

/* ============================================================
   Work
   ============================================================ */

.project { margin-bottom: 4rem; }
.project--feature { padding-bottom: 4rem; border-bottom: 1px solid var(--line); }

.project-stats {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}
.project-stats li {
  padding: 1rem 1.25rem;
  background: var(--bg-soft);
  border: 1px solid var(--pink);
  border-radius: 3px;
}
.project-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.project-stats span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--fg-quiet);
  margin-top: 0.25rem;
}

.project-bullets, .prior-list, .project ul:not(.project-stats) {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.project-bullets li, .prior-list li, .project ul:not(.project-stats) li {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.project-bullets li:last-child, .prior-list li:last-child, .project ul:not(.project-stats) li:last-child {
  border-bottom: 1px solid var(--line);
}
.prior-list h3 { margin-bottom: 0.5rem; }
.prior-list p { color: var(--fg-soft); margin: 0; }

/* Markdown-first variant of the prior-work list — natural h3 + p pairs */
.prior-list-md h3 {
  margin: 0;
  padding: 1rem 0 0.5rem;
  border-top: 1px solid var(--line);
  font-size: 1.05rem;
}
.prior-list-md p {
  color: var(--fg-soft);
  margin: 0 0 1rem;
}
.prior-list-md > p:last-child {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.prior-work { margin-top: var(--gap-section); padding-top: 3rem; border-top: 1px solid var(--line-strong); }

/* ============================================================
   About
   ============================================================ */

.arc-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  counter-reset: arc;
}
.arc-item {
  position: relative;
  padding: 1rem 0 1rem 3rem;
  border-top: 1px solid var(--line);
  counter-increment: arc;
}
.arc-item:last-child { border-bottom: 1px solid var(--line); }
.arc-item::before {
  content: counter(arc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.05rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-quiet);
  letter-spacing: 0.05em;
}
.arc-postscript {
  margin-top: 1.5rem;
  color: var(--fg-soft);
  font-style: italic;
}

.family-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.family-list li {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.family-list li:last-child { border-bottom: 1px solid var(--line); }
.family-postscript {
  margin-top: 1.5rem;
  color: var(--fg-soft);
}

.likes-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.likes-grid li {
  padding: 1.25rem;
  background: var(--bg-soft);
  border: 1px solid var(--pink);
  border-radius: 3px;
  color: var(--fg-soft);
}
.likes-grid strong { color: var(--fg); }

/* ============================================================
   Now
   ============================================================ */

.now-block {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}
.now-block:last-child { border-bottom: 1px solid var(--line); }
.now-bullets {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}
.now-bullets li {
  padding: 0.75rem 0;
  color: var(--fg-soft);
  max-width: var(--measure-wide);
}
.now-bullets strong { color: var(--fg); }

/* ============================================================
   Standards
   ============================================================ */

.standards-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.standards-item {
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}
.standards-item:last-child { border-bottom: 1px solid var(--line); }
.standards-item h3 { color: var(--accent); }
.standards-item p { color: var(--fg-soft); margin-bottom: 0.5rem; }
.standards-item .example {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg-quiet);
}
