/* Elsebright portfolio — buildless stylesheet.
   Design tokens first; edit colors and type here. */

:root {
  --paper: #f8f5ef;
  --card: #f1ebe2;
  --card-feature: #efe7f1;
  --ink: #211e1c;
  --ink-soft: #3b3632;
  --muted: #5f5a54;
  --line: #ddd5c9;
  --violet: #4f40d9;
  --violet-hover: #3c2fc0;
  --violet-tint: #e5ddfb;
  --violet-ink: #4a35b5;
  --violet-glow: #7a5ad9;
  --focus: #4f40d9;

  --serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --gutter: clamp(20px, 4vw, 56px);
  --max: 1440px;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body:has(dialog[open]) { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  padding: 12px 16px; background: var(--ink); color: #fff; border-radius: 8px; font-size: 14px;
}
.skip:focus { top: 12px; }

.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 16px;
}

/* ---------- Header ---------- */
.site-header {
  max-width: var(--max); margin: 0 auto; padding: 28px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase;
}
.brand-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); flex: none; }
.site-header nav { display: flex; gap: clamp(18px, 3vw, 40px); font-size: 14px; }
.site-header nav a { padding: 6px 0; color: var(--ink-soft); border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.site-header nav a:hover { color: var(--violet); border-bottom-color: currentColor; }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate;
  max-width: var(--max); margin: 0 auto;
  min-height: clamp(520px, 44vw, 640px);
  padding: clamp(32px, 5vw, 72px) var(--gutter) 64px;
  display: flex; align-items: center;
}
.hero-copy { position: relative; z-index: 2; max-width: min(560px, 44%); }
.hero h1 { font-size: clamp(64px, 7.4vw, 112px); line-height: .92; letter-spacing: -0.025em; margin-bottom: 28px; }
.hero h1 .line { display: block; }
.intro { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.5; color: var(--muted); max-width: 30ch; margin-bottom: 32px; }

.button-primary {
  display: inline-flex; align-items: center; gap: 14px;
  min-height: 48px; padding: 0 22px;
  background: var(--ink); color: #fff; border-radius: 999px;
  font-size: 14px; font-weight: 500; letter-spacing: .01em;
  transition: background-color .2s, transform .2s var(--ease);
}
.button-primary:hover { background: var(--violet); }
.button-primary:active { transform: translateY(1px); }

.hero-art {
  /* The frame takes the artwork's own shape (1312×696), so the whole
     composition shows — sticky notes through the two-gang wallplate. */
  position: absolute; z-index: -1; top: 50%; right: 0; transform: translateY(-50%);
  width: 64%; aspect-ratio: 1312 / 696; overflow: hidden;
  border-radius: 24px 0 0 24px;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--paper) 0%, rgba(248, 245, 239, 0) 7%);
}
.hero-art figcaption, .detail-art figcaption {
  position: absolute; right: 14px; bottom: 14px; z-index: 1;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(248, 245, 239, .88); color: var(--ink-soft);
  font-size: 11px; letter-spacing: .04em;
}

/* ---------- Section scaffolding ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: 72px var(--gutter); }
.section h2 { font-size: clamp(40px, 4.2vw, 60px); line-height: 1.02; }
.portfolio { padding-top: 40px; outline: none; }
.section-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-top .eyebrow { margin-bottom: 10px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  font-size: 13px; color: var(--ink); white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s;
}
.filters button:hover { border-color: var(--violet); color: var(--violet); }
.filters button[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }

/* ---------- Cards (shared) ---------- */
.card {
  /* --ar (image width ÷ height) is set per card from config.js.
     The art column is as wide as the card height × --ar, so the image
     shows whole instead of being cropped to a fixed box. */
  --art-h: 268px;
  --art-max: 58%;
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) min(calc(var(--art-h) * var(--ar, 1.2)), var(--art-max));
  min-height: var(--art-h);
  background: var(--card); border-radius: var(--radius);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -18px rgba(51, 38, 25, .28); }
.card-copy { display: flex; flex-direction: column; align-items: flex-start; padding: 30px 12px 28px 30px; z-index: 1; } /* no position: the trigger's ::after must cover the whole card */
.card-status {
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.card-title { font-size: clamp(32px, 2.8vw, 42px); line-height: 1; margin-bottom: 14px; }
.card-title .accent { color: var(--violet); }
.card-title .subtitle { display: block; margin-top: 6px; font-size: .5em; line-height: 1.15; color: var(--ink); }
.card-trigger {
  display: block; padding: 0; border: 0; background: none; text-align: left;
  font: inherit; letter-spacing: inherit; line-height: inherit;
}
/* Stretch the button's hit area over the whole card. */
.card-trigger::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: var(--radius); }
.card-trigger:focus-visible { outline: none; }
.card-trigger:focus-visible::after { outline: 3px solid var(--focus); outline-offset: -3px; }
.card-desc { font-size: 15px; line-height: 1.55; color: var(--muted); max-width: 27ch; margin-bottom: 20px; }
.text-link {
  margin-top: auto; display: inline-block;
  font-size: 14px; font-weight: 500; color: var(--violet);
}
.text-link .arrow { display: inline-block; transition: transform .25s var(--ease); }
.card:hover .text-link .arrow { transform: translateX(4px); }

.card-art { position: relative; overflow: hidden; }
.card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card-art img { transform: scale(1.02); }
/* A soft seam only — not wide enough to hide the product's edge. */
.card-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--card) 0%, rgba(241, 235, 226, 0) 8%);
}

/* ---------- Large ---------- */
.grid-large { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 1200px) {
  .grid-large { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--large { --art-h: clamp(256px, 19vw, 280px); }
}

/* ---------- Small ---------- */
.more { margin-top: 48px; }
.more-heading {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding-top: 28px; margin-bottom: 20px; border-top: 1px solid var(--line);
}
.more-heading h3 { font-size: clamp(28px, 2.4vw, 34px); line-height: 1.1; }
.more-heading p { font-size: 14px; color: var(--muted); }
.grid-small { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 600px) { .grid-small { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1280px) { .grid-small { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card--small { --art-h: 188px; --art-max: 50%; border-radius: var(--radius-sm); }
@media (min-width: 1280px) { .card--small { --art-h: 212px; --art-max: 52%; } .card--small .card-title { font-size: 21px; } }
.card--small .card-copy { padding: 18px 6px 16px 18px; }
.card--small .card-status { font-size: 10.5px; margin-bottom: 8px; letter-spacing: .12em; }
.card--small .card-title { font-size: 23px; margin-bottom: 8px; }
.card--small .card-desc { font-size: 13px; line-height: 1.45; margin-bottom: 12px; }
.card--small .text-link { font-size: 13px; }
.card--small .card-trigger::after { border-radius: var(--radius-sm); }

/* ---------- Feature (Spark.ai) ---------- */
[data-group="feature"] { margin-top: 24px; }
.card--feature {
  grid-template-columns: minmax(0, 1fr);
  min-height: 280px; background: var(--card-feature);
}
.card--feature .card-copy { padding: 36px 40px; max-width: 460px; }
.card--feature .card-art { position: absolute; inset: 0 0 0 auto; width: 76%; }
.card--feature .card-art::after {
  background: linear-gradient(90deg, var(--card-feature) 0%, rgba(239, 231, 241, .45) 13%, rgba(239, 231, 241, 0) 28%);
}
.pill {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: var(--violet-tint); color: var(--violet-ink);
  font-size: 12px; font-weight: 500; margin-bottom: 18px;
}
.card--feature .card-title { font-size: clamp(52px, 5vw, 72px); line-height: .95; margin-bottom: 12px; }
.card--feature .card-title .accent { color: var(--violet-glow); }
.feature-headline { font-family: var(--serif); font-size: clamp(26px, 2.2vw, 32px); line-height: 1.1; margin-bottom: 4px; }
.card--feature .card-desc { margin-bottom: 22px; }

/* ---------- Empty state ---------- */
.empty-state {
  padding: 56px 24px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty-state p { margin-bottom: 12px; }
.text-button { border: 0; background: none; padding: 6px 2px; color: var(--violet); font-size: 15px; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Approach ---------- */
.approach {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px;
  border-top: 1px solid var(--line); padding-top: 88px; padding-bottom: 88px;
}
.principles { display: grid; gap: 28px; }
.principles article { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.principles article:last-child { border-bottom: 0; padding-bottom: 0; }
.principle-index { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.principles h3 { font-size: 30px; line-height: 1.1; margin-bottom: 10px; }
.principles p:not(.principle-index) { font-size: 15.5px; line-height: 1.65; color: var(--muted); max-width: 52ch; }

/* ---------- About ---------- */
.about {
  text-align: center; padding-top: 96px; padding-bottom: 96px;
  background: radial-gradient(ellipse 60% 70% at 70% 100%, #e4dcf3 0%, rgba(228, 220, 243, 0) 70%);
}
.about h2 { margin-bottom: 24px; }
.about p:not(.eyebrow) { font-size: 16px; line-height: 1.75; color: var(--muted); max-width: 52ch; margin: 0 auto 24px; }
.about .text-link { margin: 0 auto; }

/* ---------- Footer ---------- */
.site-footer { max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) 40px; border-top: 1px solid var(--line); }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.footer-top p { font-family: var(--serif); font-size: 20px; }
.footer-note { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

/* ---------- Detail dialog ---------- */
.detail {
  width: min(720px, calc(100% - 32px)); max-width: none;
  max-height: min(90vh, 920px); max-height: min(90dvh, 920px);
  padding: 0; border: 0; border-radius: 18px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(25, 20, 33, .45);
  overflow: auto; overscroll-behavior: contain;
}
.detail[open] { animation: rise .28s var(--ease); }
.detail::backdrop { background: rgba(25, 20, 33, .5); backdrop-filter: blur(4px); animation: fade .28s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.detail-close {
  position: sticky; top: 12px; float: right; margin: 12px 12px -52px 0; z-index: 4;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: rgba(248, 245, 239, .92); color: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.detail-close:hover { background: #fff; color: var(--violet); }
.detail-art {
  position: relative; width: 100%; aspect-ratio: var(--ar, 2); max-height: 40vh;
  overflow: hidden; background: var(--card); isolation: isolate;
}
/* Fill any side space with a soft, blurred copy of the same image — no blank bars. */
.detail-art::before {
  content: ''; position: absolute; inset: -40px; z-index: -1;
  background: var(--art) center / cover no-repeat; filter: blur(28px) saturate(1.05); opacity: .55;
}
.detail-art img { width: 100%; height: 100%; object-fit: contain; }
/* Spark's art is a very wide band; frame it like the card (2.4:1, anchored on the prism) rather than letterboxing a thin strip. */
.detail[data-size="feature"] .detail-art { aspect-ratio: 2.4; }
.detail[data-size="feature"] .detail-art img { object-fit: cover; }
.detail-art + .eyebrow { margin: 28px 36px 8px; }
.detail h2 { font-size: clamp(40px, 5vw, 54px); line-height: 1; margin: 0 36px 16px; }
.detail-headline { font-family: var(--serif); font-size: 26px; margin: -6px 36px 12px; }
.detail-text { font-size: 16.5px; line-height: 1.7; color: var(--muted); margin: 0 36px 20px; max-width: 60ch; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 36px 24px; }
.detail-tags li { font-size: 12.5px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); }
.detail-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 36px 12px; }
.link-note { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
.detail-checked, .detail-nolink { font-size: 13px; color: var(--muted); margin: 0 36px 36px; }
.detail-nolink { padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { display: block; min-height: 0; padding-bottom: 0; }
  .hero-copy { max-width: none; }
  .hero h1 { font-size: clamp(60px, 13vw, 96px); }
  .hero-art {
    position: relative; z-index: 0; top: auto; transform: none; width: auto;
    margin: 40px calc(var(--gutter) * -1) 0; border-radius: 0;
  }
  .hero-art::after { background: linear-gradient(180deg, var(--paper) 0%, rgba(248, 245, 239, 0) 6%, rgba(248, 245, 239, 0) 94%, var(--paper) 100%); }
  .section-top { flex-direction: column; align-items: flex-start; }
  .approach { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 64px; padding-bottom: 64px; }
  /* Stack Spark: a band wide enough to hold the whole prism. */
  .card--feature { grid-template-rows: auto auto; }
  .card--feature .card-art { position: relative; inset: auto; width: auto; grid-row: 1; aspect-ratio: 3; }
  .card--feature .card-art::after { background: linear-gradient(0deg, var(--card-feature) 0%, rgba(239, 231, 241, 0) 9%); }
  .card--feature .card-copy { grid-row: 2; padding: 22px 28px 28px; max-width: none; }
}

@media (max-width: 600px) {
  .site-header { padding-top: 22px; padding-bottom: 22px; }
  .wordmark { font-size: 11px; letter-spacing: .2em; gap: 8px; }
  .site-header nav { gap: 16px; font-size: 13px; }
  .hero h1 { font-size: clamp(54px, 16.5vw, 72px); margin-bottom: 20px; }
  .intro { margin-bottom: 26px; }
  .hero-art { margin-top: 32px; }
  .section { padding-top: 56px; padding-bottom: 56px; }
  .portfolio { padding-top: 24px; }
  .section h2 { font-size: 40px; }
  .filters button { min-height: 38px; padding: 0 14px; }

  .card--large { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; min-height: 0; }
  .card--large .card-art { grid-row: 1; aspect-ratio: var(--ar, 1.4); }
  .card--large .card-copy { grid-row: 2; padding: 20px 22px 24px; }
  .card--large .card-art::after { background: linear-gradient(0deg, var(--card) 0%, rgba(241, 235, 226, 0) 6%); }
  .card-title { font-size: 34px; }
  .card-desc { max-width: none; }

  .more-heading { display: block; }
  .more-heading p { margin-top: 6px; }
  .card--feature .card-art { aspect-ratio: 2.4; }
  .card--feature .card-copy { padding: 20px 22px 26px; }
  .card--feature .card-title { font-size: 56px; }

  .about { padding-top: 64px; padding-bottom: 64px; }
  .footer-note { flex-direction: column; gap: 8px; }

  .detail { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92vh; max-height: 92dvh; }
  .detail-art + .eyebrow, .detail h2, .detail-headline, .detail-text, .detail-tags, .detail-links, .detail-checked, .detail-nolink { margin-left: 22px; margin-right: 22px; }
  .detail h2 { font-size: 40px; }
  .detail-text { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover, .card:hover .card-art img, .card:hover .text-link .arrow { transform: none; }
}

/* 2026 refresh: clear typography and scalable product illustrations. */
:root { --serif: var(--sans); --max: 1320px; --radius: 20px; --card: #fffdf9; }
h1,h2,h3 { font-weight: 600; letter-spacing: -.045em; }
.hero h1 { font-size: clamp(44px,5.6vw,76px); line-height: 1.05; max-width: 14ch; }
.hero .intro { font-size: 19px; line-height: 1.65; max-width: 44ch; }
.hero { padding-top: 70px; }
.hero-art { max-width: 100%; border-radius: 24px; overflow: hidden; }
.hero-art img { width:100%; height:auto; aspect-ratio:1000/720; object-fit:contain; }
.section h2 { font-size:clamp(32px,3.5vw,46px); line-height:1.12; }
.card { border: 1px solid #e4ddd2; box-shadow:none; background:#fffdf9; }
.card--large { display:flex; flex-direction:column; }
.card--large .card-art { order:-1; aspect-ratio:1000/640; width:100%; height:auto; }
.card-art img { width:100%; height:100%; object-fit:contain; }
.card-art::after { display:none; }
.card-copy { padding:28px; }
.card-title { font-size:30px; line-height:1.12; letter-spacing:-.04em; }
.card-desc { max-width:44ch; font-size:16px; line-height:1.65; }
.card-title .subtitle { font-size:14px; font-weight:500; letter-spacing:0; margin-top:10px; }
.card--small { display:flex; flex-direction:column; }
.card--small .card-art { order:-1; width:100%; max-width:none; height:auto; aspect-ratio:1000/720; }
.card--small .card-copy { padding:22px; }
.card--small .card-title { font-size:23px; }
.card--small .card-desc { font-size:15px; }
.card--feature { display:grid; grid-template-columns:1fr 1fr; }
.card--feature .card-art { position:relative; inset:auto; width:100%; grid-column:2; grid-row:1; aspect-ratio:1000/720; }
.card--feature .card-copy { grid-column:1; grid-row:1; padding:36px; align-self:center; }
.card--feature .card-title { font-size:48px; }
.feature-headline { font-family:var(--sans); font-size:25px; letter-spacing:-.03em; }
.principles h3 { font-size:25px; }
.footer-top p { font-size:17px; }
.detail h2 { font-size:36px; }
.detail-art { background:#ede8df; }
.detail-art img { object-fit:contain; width:100%; max-height:380px; }
@media(max-width:600px){
 .hero { padding-top:42px; }
 .hero h1 { font-size:45px; }
 .hero .intro {font-size:17px;}
 .hero-art img { aspect-ratio:1000/720; }
 .card-copy {padding:23px;}
 .card-title {font-size:28px;}
 .card--feature {display:flex;flex-direction:column;}
 .card--feature .card-art {order:-1;}
 .card--feature .card-copy {padding:24px;}
 .card--feature .card-title {font-size:36px;}
 .section-top {gap:22px;}
}
