/* ============================================================
   wesual.art — tokens, primitives, components.
============================================================ */

/* ---- Tokens ------------------------------------------------ */
:root {
  --bg:            #07050a;
  --text:          #f4ede6;
  --text-muted:    #9c958c;
  --accent:        #ffccaa;
  --accent-strong: #ff8d6a;
  --accent-soft:   rgba(255, 204, 170, 0.14);
  --rule:          rgba(255, 226, 200, 0.14);
  --panel:         rgba(12, 9, 8, 0.55);
  --panel-strong:  rgba(12, 9, 8, 0.78);
  --chrome:        rgba(7, 5, 10, 0.86);
  --pad-x: 4vw;
  --radius: 18px;
}
[data-theme="light"] {
  --bg:            #f1ebe2;
  --text:          #1a140e;
  --text-muted:    #5a544c;
  --accent:        #b94824;
  --accent-strong: #8c2f12;
  --accent-soft:   rgba(185, 72, 36, 0.12);
  --rule:          rgba(20, 12, 0, 0.12);
  --panel:         rgba(247, 240, 232, 0.78);
  --panel-strong:  rgba(247, 240, 232, 0.92);
  --chrome:        rgba(241, 235, 226, 0.92);
}

/* ---- Reset + base ------------------------------------------ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  font-weight: 300; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: var(--accent-soft); }

/* ---- Shader layers -----------------------------------------
   #back (darksun) sits behind content so panel backdrop-filter
   blurs it. #front (tiles) sits above panels (below .top),
   screen-blended so bright pixels show without obscuring text. */
#eps-shader-back,
#eps-shader-front {
  position: fixed; inset: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#eps-shader-back  { z-index: 0; }
#eps-shader-front { z-index: 5; mix-blend-mode: screen; }
[data-theme="light"] #eps-shader-back  { opacity: 0.35; mix-blend-mode: multiply; }
[data-theme="light"] #eps-shader-front { opacity: 0.50; mix-blend-mode: multiply; }
body[data-shader="off"] #eps-shader-back,
body[data-shader="off"] #eps-shader-front { opacity: 0; }
body[data-shader="off"][data-theme="dark"] {
  background: radial-gradient(70vw 50vh at 70% 35%, #14080a, #07050a 60%, #050306);
}

/* ---- Primitives -------------------------------------------- */
.matte {
  background: var(--panel);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--rule);
  border-radius: 22px;
  padding: clamp(1.25rem, 2.2vw, 2.25rem);
}

.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--accent); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font: inherit;
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap;
  transition: 0.15s;
}
.pill:hover, .pill.active { background: var(--accent); color: var(--bg); }
.pill.primary { font-weight: 500; }
.pill--sm { padding: 0.4rem 0.8rem; letter-spacing: 0.12em; }
.pill--lg { padding: 0.9rem 1.4rem; font-size: 14px; gap: 14px; }
.pill svg { width: 14px; height: 14px; fill: currentColor; }

/* .section-rule — small label with a hairline on either side. */
.section-rule {
  display: flex; align-items: center; gap: 14px;
  font-size: 13px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.section-rule::before, .section-rule::after {
  content: ''; flex: 1; height: 1px; background: var(--rule);
}
/* .section-rule { */
  /* margin-bottom: 1.25rem; */
  /* font-size: 13px; letter-spacing: 0.28em; text-transform: uppercase; */
  /* color: var(--text-muted); */
  /* text-align: center; */
/* } */

/* ---- Top bar ----------------------------------------------- */
.top {
  position: fixed; inset: 0 0 auto 0;
  z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad-x);
  padding-top: max(18px, env(safe-area-inset-top));
  font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--chrome);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--rule);
}
.top .mark {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-weight: 500;
}
.top .mark .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-strong);
}
.top nav { display: flex; gap: 22px; align-items: center; }
.top nav a {
  position: relative; padding-bottom: 4px;
  transition: color 0.15s;
}
.top nav a:hover,
.top nav a.is-current { color: var(--accent); }
.top nav a.is-current::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--accent-strong);
}

/* ---- Marquee (index bottom strip) -------------------------- */
.marquee {
  position: fixed; inset: auto 0 0 0;
  z-index: 5;
  display: flex; justify-content: space-between;
  padding: 12px var(--pad-x);
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
  background: var(--chrome);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--rule);
}
.marquee span { display: inline-flex; gap: 18px; }

/* ---- Tweaks panel ------------------------------------------ */
.tweaks {
  position: fixed; bottom: 22px; right: 22px;
  z-index: 50;
  display: none;
  min-width: 200px;
  padding: 16px 18px;
  border: 1px solid var(--rule); border-radius: 14px;
  background: var(--panel-strong);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 12px; color: var(--text);
}
.tweaks.is-open { display: block; }
.tweaks h4 {
  margin-bottom: 10px;
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-muted);
}
.tweaks .row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; margin-bottom: 10px;
}
.tweaks .row:last-child { margin-bottom: 0; }
.tweaks .seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--rule); border-radius: 999px;
}
.tweaks .seg button {
  padding: 4px 12px;
  background: transparent; border: 0; color: var(--text);
  font: inherit;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer;
}
.tweaks .seg button.active { background: var(--accent); color: var(--bg); }
.tweaks .close-x {
  position: absolute; top: 8px; right: 10px;
  background: transparent; border: 0;
  color: var(--text-muted); font-size: 14px; cursor: pointer;
}
.tweaks .close-x:hover { color: var(--accent); }

/* ============================================================
   INDEX page
============================================================ */
.index {
  position: relative; z-index: 2;
  min-height: 100vh;
  padding: 110px clamp(20px, 22vw, 380px) 70px var(--pad-x);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.hero { display: flex; flex-direction: column; gap: 24px; }
.hero h1 {
  margin-bottom: 13px;
  font-size: clamp(37px, 6vw, 108px);
  line-height: 0.94; letter-spacing: -0.03em;
  font-weight: 400;
}
.hero h1 .we { color: var(--accent); }
.hero .tagline {
  margin-top: 10px;
  font-size: clamp(14px, 1.3vw, 22px);
  font-style: italic; letter-spacing: 0.01em;
  color: var(--accent);
}
.hero .lede {
  max-width: 30ch;
  font-size: clamp(18px, 1.3vw, 22px);
  line-height: 1.5;
  margin-top: 13px; 
  margin-bottom:32px;
}
.hero .cta-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
  margin-top: 8px;
}
/* latent — HTML currently commented out */
.hero .eyebrow {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted);
}
.hero .contact-note {
  margin-top: 22px;
  font-size: 13px; line-height: 1.5; font-style: italic;
  color: var(--text-muted);
}

/* ---- Cluster (label + flat link list) ---------------------- */
.cluster { display: flex; flex-direction: column; gap: 8px; }
.cluster .label {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: inherit;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-muted);
}
.cluster .label::after {
  content: ''; flex: 1; height: 1px; background: var(--rule);
}
.cluster .links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.cluster .links a {
  padding: 4px 0;
  font-size: 18px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.cluster .links a:hover { color: var(--accent); border-color: var(--accent); }
.cluster .links a.link2 { color: var(--text-muted); }

.clusters--primary { display: flex; flex-direction: column; gap: 22px; }
.clusters--primary .label {
  font-size: 15px; letter-spacing: 0.26em;
  color: var(--accent);
}
.clusters--primary .cluster .label::before {
  content: ''; display: inline-block;
  width: 14px; height: 1px; background: var(--text-muted);
}
.clusters--primary .links { gap: 10px 22px; }

.matte--secondary { padding-top: 1.25rem; }
.clusters--secondary {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
}
.clusters--secondary .section-rule { grid-column: 1 / -1; }
.clusters--secondary .links { gap: 4px 12px; }
.clusters--secondary .links a { font-size: 16px; }

/* ---- Aside column ------------------------------------------ */
.aside {
  display: flex; flex-direction: column; gap: 28px;
  max-width: 540px;
  padding-top: 8px;
}
.aside .bio {
  display: flex; flex-direction: column; gap: 14px;
  font-size: clamp(16px, 1.2vw, 18px); line-height: 1.65;
}

/* ---- Portrait ---------------------------------------------- */
.portrait-below {
  display: flex; justify-content: center;
  margin-top: 4px;
  pointer-events: none;
}
.portrait-below img {
  display: block; width: 100%; max-width: 460px;
  opacity: 0.85; filter: contrast(1.15) brightness(1.05);
}
[data-theme="light"] .portrait-below img {
  opacity: 0.9; filter: invert(1) contrast(1.2); mix-blend-mode: multiply;
}

/* ============================================================
   PORTFOLIO page
============================================================ */
.portfolio {
  position: relative; z-index: 1;
  padding: 110px var(--pad-x) 120px;
  max-width: 1600px; margin: 0 auto;
}
.portfolio-head {
  padding-bottom: 11px; margin-bottom: 23px;
  border-bottom: 1px solid var(--rule);
}
.portfolio-head h1 {
  font-size: clamp(44px, 5.5vw, 88px); line-height: 0.94;
  letter-spacing: -0.03em; font-weight: 400;
}
.portfolio-head h1 .accent { color: var(--accent); }
/* latent */
.portfolio-head .meta {
  display: flex; flex-direction: column; gap: 20px;
  padding-top: 12px;
  font-size: 16px; line-height: 1.55;
}
.portfolio-head .meta .stat-row {
  display: flex; flex-wrap: wrap; gap: 38px;
  margin-top: 12px; padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.portfolio-head .meta .stat { display: flex; flex-direction: column; gap: 4px; }
.portfolio-head .meta .stat b {
  font-size: 28px; font-weight: 500; color: var(--accent);
}
.portfolio-head .meta .stat span {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted);
}

.theme-toc {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  margin-bottom: 36px;
}
.theme-toc .pill { align-items: baseline; }
.theme-toc .pill .ct {
  font-size: 13px; letter-spacing: 0.06em;
  font-feature-settings: 'tnum' 1;
  opacity: 0.7;
}

/* ---- Works grid + cards ------------------------------------ */
.works {
  display: grid; gap: 28px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 100px;
}
.work {
  position: relative;
  display: flex; flex-direction: column;
  overflow: hidden; cursor: pointer;
  border: 1px solid var(--rule);
  background: var(--panel);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s;
}
.work:hover, .work.is-active { border-color: var(--accent); }
.work.is-wide { grid-column: 1 / -1; }
.work.is-hidden,
.work.is-hidden-by-detail { display: none; }

.work .thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0e0a08 center/cover no-repeat;
  overflow: hidden;
}
.work.is-wide .thumb { aspect-ratio: 21 / 7; }
.work .thumb::after {
  content: ''; position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.55));
}
.work .thumb .year {
  position: absolute; left: 12px; bottom: 10px; z-index: 2;
  font-size: 11px; letter-spacing: 0.16em;
  color: var(--accent);
}

.work .body {
  display: flex; flex-direction: column; gap: 6px;
  padding: 1rem 1.1rem 1.25rem;
}
.work .body h3 {
  font-size: clamp(17px, 1.3vw, 21px);
  font-weight: 500; line-height: 1.12;
}
.work .body .medium { font-size: 16px; letter-spacing: 0.04em; }
.work .body .sub {
  margin-top: 4px;
  font-size: 14px; font-style: italic; color: var(--accent);
}
.work .body .badge-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
}
.work .body .badge {
  padding: 3px 8px; white-space: nowrap;
  border: 1px solid var(--rule); border-radius: 999px;
  font-size: 14px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted);
}
.work .body .ext-mark {
  margin-left: auto;
  font-size: 10px; letter-spacing: 0.18em;
  color: var(--accent-strong);
}
.work .placeholder-art {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted);
  background:
    repeating-linear-gradient(45deg, rgba(255,204,170,0.08) 0 2px, transparent 2px 14px),
    linear-gradient(135deg, #1c1410, #0a0706);
}

/* ---- Expanded detail panel --------------------------------- */
.detail {
  grid-column: 1 / -1;
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 36px;
  padding: 2rem;
  border: 1px solid var(--accent);
  background: var(--panel-strong);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.detail .media { display: flex; flex-direction: column; gap: 14px; }
.detail .media .frame {
  aspect-ratio: 16 / 9;
  background: #000 center/cover no-repeat;
  border: 1px solid var(--rule);
}
.detail .media .frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.detail .media .strip { display: flex; gap: 8px; }
.detail .media .strip img {
  width: 76px; height: 50px; object-fit: cover;
  border: 1px solid var(--rule);
}
.detail .media .links,
.detail .info  .links {
  display: flex; flex-wrap: wrap; gap: 8px 10px;
  margin-top: 4px;
}

.detail .info { display: flex; flex-direction: column; gap: 16px; }
.detail .info .eyebrow {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 14px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-muted);
}
.detail .info h3 {
  font-size: clamp(28px, 2.6vw, 40px); line-height: 1;
  font-weight: 500; letter-spacing: -0.02em;
}
.detail .info .sub {
  margin-top: -8px;
  font-size: 16px; font-style: italic; color: var(--accent);
}
.detail .info .row {
  display: grid; grid-template-columns: 90px 1fr; gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--rule);
  font-size: 17px; line-height: 1.55;
}
.detail .info .row:first-of-type { border-top: 0; padding-top: 0; }
.detail .info .row .k {
  padding-top: 3px;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted);
}
.detail .info .row .v.notes { font-size: 13px; color: var(--accent); }
.detail .info .row .v.notes div { padding: 2px 0; }
.detail .info .body { margin-top: 4px; }
.detail .info .body p {
  margin-bottom: 10px;
  font-size: 17px; line-height: 1.6;
}

.detail .close {
  position: absolute; top: 16px; right: 18px;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--rule); border-radius: 50%;
  background: var(--panel); color: var(--text);
  font-size: 14px; cursor: pointer;
  transition: 0.15s;
}
.detail .close:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* ============================================================
   ASSEMBLY page
============================================================ */
.assembly {
  position: relative; z-index: 1;
  padding: 110px var(--pad-x) 140px;
  max-width: 1100px; margin: 0 auto;
}
.assembly .matte { margin-bottom: 28px; }

.assembly-head { text-align: center; }
.assembly-head .eyebrow {
  margin-bottom: 18px;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-muted);
}
.assembly-head h1 {
  font-size: clamp(48px, 6vw, 92px);
  line-height: 0.94; letter-spacing: 0.04em;
  font-weight: 400;
}
.assembly-head .sub {
  margin-top: 14px;
  font-size: clamp(16px, 1.3vw, 19px);
  font-style: italic; color: var(--accent);
}
.assembly-head .actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  margin-top: 28px;
}

.assembly .intro p {
  margin-bottom: 16px;
  font-size: clamp(16px, 1.4vw, 20px); line-height: 1.65;
}
.assembly .intro p:last-child { margin-bottom: 0; }

.assembly .piece .head { text-align: center; margin-bottom: 22px; }
.assembly .piece .head h2 {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 500; line-height: 1.05; letter-spacing: -0.015em;
}
.assembly .piece .head .blurb {
  margin-top: 8px;
  font-size: 17px; font-style: italic; color: var(--accent);
}
.assembly .piece .head .logs {
  margin-top: 12px;
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted);
}
.assembly .piece .head .logs a {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  transition: 0.15s;
}
.assembly .piece .head .logs a:hover { color: var(--accent); }

.assembly .piece .frame {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--rule);
}
.assembly .piece .frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

.assembly .piece .annot { margin-top: 22px; }
.assembly .piece .annot h3 {
  margin: 14px 0 8px;
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.assembly .piece .annot p {
  margin-bottom: 12px;
  font-size: 14px; line-height: 1.6;
}
.assembly .piece .annot a {
  color: var(--accent);
  border-bottom: 1px solid var(--rule);
  transition: 0.15s;
}
.assembly .piece .annot a:hover { border-color: var(--accent); }

.assembly > footer {
  margin-top: 12px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 13px; font-style: italic;
  color: var(--text-muted);
}

/* ============================================================
   Responsive — layout-only changes (clamp covers typography)
============================================================ */
@media (max-width: 960px) {
  .index    { grid-template-columns: 1fr; padding-top: 90px; padding-right: var(--pad-x); }
  .works    { grid-template-columns: 1fr; }
  .detail   { grid-template-columns: 1fr; padding: 1.25rem; }
  .marquee  { display: none; }
  .top      { padding: 16px 22px; }
}
@media (max-width: 600px) {
  :root { --pad-x: 18px; }
  .top { padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
  .top nav { gap: 14px; }
  .top nav a { padding: 8px 0; }
  .index { padding: 88px var(--pad-x) 56px; gap: 22px; }
  .hero { gap: 18px; }
  .aside { gap: 20px; max-width: none; }
  .clusters--secondary { grid-template-columns: 1fr; }
  .portfolio { padding: 88px var(--pad-x) 80px; }
  .portfolio-head { padding-bottom: 24px; margin-bottom: 24px; }
  .works { gap: 20px; margin-bottom: 60px; }
  .detail .info .row { grid-template-columns: 76px 1fr; gap: 10px; font-size: 16px; }
  .tweaks {
    left: 12px; right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    min-width: 0;
  }
  .assembly { padding: 88px var(--pad-x) 90px; }
  .assembly .matte { margin-bottom: 20px; }
}
