/* Shared theme for the Reeb2.0 project pages (max.areebali.com/adobemax/*.html).
   Mirrors the microsite's tokens so the case studies read as one piece. */
:root {
  --ink: #050506;
  --ink-2: #0b0c0e;
  --acid: #ccff00;
  --acid-glow: rgba(216, 255, 58, 0.55);
  --paper: #f2f2ec;
  --muted: rgba(242, 242, 236, 0.62);
  --faint: rgba(242, 242, 236, 0.38);
  --hair: rgba(242, 242, 236, 0.14);
  --steel: #2a2c30;
  --glass: rgba(30, 32, 36, 0.55);
  --magenta: #ff2e93;
  --cyan: #27f5c2;
  --f-poster: "Anton", "Impact", "Arial Narrow", sans-serif;
  --f-head: "Archivo", "Arial Black", "Helvetica Neue", sans-serif;
  --f-ui: "Chakra Petch", "Eurostile", "Arial", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: clamp(18px, 5vw, 72px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--ink); scrollbar-color: var(--acid) var(--ink); overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0;
  /* Fixed atmosphere matching the microsite: acid + violet field radials over
     ink (grain + scanlines come from the pseudo-elements below). */
  background:
    radial-gradient(ellipse 72% 60% at 16% 22%, rgba(204, 255, 0, 0.06), transparent 66%),
    radial-gradient(ellipse 62% 56% at 84% 80%, rgba(123, 63, 242, 0.06), transparent 70%),
    var(--ink);
  background-attachment: fixed;
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: 15px;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--acid); color: #000; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }

/* Scanlines over everything, like the microsite's .scan */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 89; pointer-events: none; mix-blend-mode: screen;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 4px);
}
/* Film grain (static fractal-noise sprite), like the microsite's .grain */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0.06;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E") 0 0 / 180px 180px;
}

/* ── Top HUD bar ─────────────────────────────────────────────── */
.p-hud {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
}
.p-corner { position: absolute; width: 26px; height: 26px; border: 0 solid var(--acid); }
.c-tl { top: calc(16px + env(safe-area-inset-top, 0px)); left: 16px; border-top-width: 2px; border-left-width: 2px; }
.c-tr { top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; border-top-width: 2px; border-right-width: 2px; }
.c-bl { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 16px; border-bottom-width: 2px; border-left-width: 2px; }
.c-br { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); right: 16px; border-bottom-width: 2px; border-right-width: 2px; }
.p-topbar {
  position: absolute; top: calc(26px + env(safe-area-inset-top, 0px)); left: var(--gutter); right: var(--gutter);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font: 600 11px/1 var(--f-ui); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
.p-back {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 15px 8px; cursor: pointer;
  border: 1px solid var(--hair); background: rgba(10, 11, 13, 0.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--paper); font: 600 11px/1 var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.p-back:hover { border-color: var(--acid); color: var(--acid); }
.p-back svg { width: 15px; height: 10px; }
.p-idx { color: var(--faint); white-space: nowrap; }
.p-idx em { font-style: normal; color: var(--acid); }

/* ── Layout shell ────────────────────────────────────────────── */
.wrap { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.p-hero { padding-top: clamp(120px, 20vh, 220px); padding-bottom: clamp(28px, 5vh, 56px); }
.p-eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: clamp(18px, 3vh, 30px);
  font: 600 11px/1 var(--f-ui); letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}
.p-eyebrow .dot { color: var(--acid); }
.p-eyebrow .p-marker {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border: 1.5px solid var(--acid); border-radius: 50%; color: var(--acid); font-size: 12px;
}
/* Heading as a torn paper sticker — black type on a ragged paper bar, tilted,
   matching the microsite's identity scene. */
.title {
  position: relative; display: inline-block; isolation: isolate;
  margin: 0; font-family: var(--f-poster); font-weight: 400;
  font-size: clamp(2.3rem, 9vw, 6.5rem); line-height: 1; letter-spacing: 0.01em; text-transform: uppercase; white-space: nowrap;
  color: #000; padding: 0.06em 0.26em 0.03em; transform: rotate(-1.8deg);
}
.title::before {
  content: ""; position: absolute; inset: 0.06em -0.02em 0.04em; z-index: -1; background: var(--paper);
  clip-path: polygon(0.0% 6.2%,2.8% 2.6%,5.6% 8.4%,8.3% 5.6%,11.1% 0.4%,13.9% 4.5%,16.7% 0.9%,19.4% 6.9%,22.2% 2.7%,25.0% 3.6%,27.8% 6.5%,30.6% 2.6%,33.3% 2.1%,36.1% 1.9%,38.9% 4.0%,41.7% 0.3%,44.4% 8.0%,47.2% 6.0%,50.0% 3.8%,52.8% 7.2%,55.6% 3.7%,58.3% 8.0%,61.1% 1.9%,63.9% 1.3%,66.7% 5.5%,69.4% 7.8%,72.2% 2.8%,75.0% 6.4%,77.8% 6.6%,80.6% 1.4%,83.3% 1.1%,86.1% 6.6%,88.9% 7.5%,91.7% 1.2%,94.4% 8.5%,97.2% 2.5%,100.0% 4.7%,100.0% 95.3%,97.2% 95.1%,94.4% 98.6%,91.7% 91.2%,88.9% 93.1%,86.1% 99.1%,83.3% 93.1%,80.6% 94.3%,77.8% 98.6%,75.0% 93.7%,72.2% 98.8%,69.4% 93.0%,66.7% 98.8%,63.9% 99.5%,61.1% 91.5%,58.3% 98.3%,55.6% 99.1%,52.8% 94.0%,50.0% 94.1%,47.2% 95.4%,44.4% 94.1%,41.7% 99.0%,38.9% 92.2%,36.1% 98.8%,33.3% 91.8%,30.6% 95.6%,27.8% 91.7%,25.0% 93.4%,22.2% 95.6%,19.4% 93.2%,16.7% 97.8%,13.9% 96.7%,11.1% 94.5%,8.3% 94.2%,5.6% 91.2%,2.8% 91.7%,0.0% 97.9%);
}
.title .ink2 { color: var(--acid); }
.lede {
  margin: clamp(22px, 4vh, 40px) 0 0; max-width: 62ch;
  font-size: clamp(1rem, 1.5vw, 1.18rem); line-height: 1.75; color: var(--muted);
}
.p-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(22px, 3.5vh, 34px); }
.p-tag {
  padding: 6px 11px 5px; border: 1px solid var(--hair); background: rgba(255,255,255,0.02);
  font: 600 10px/1 var(--f-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}

/* Media */
.media { margin: clamp(32px, 6vh, 72px) 0; }
.media video, .media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; border: 1px solid var(--hair); }
.media.tall img { aspect-ratio: auto; }
.media-cap { margin: 14px 0 0; max-width: 60ch; font-size: clamp(0.92rem, 1.3vw, 1.05rem); line-height: 1.7; color: var(--muted); }

/* CTA link */
.p-cta {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 20px;
  padding: 13px 22px 12px; background: var(--acid); color: #000; cursor: pointer;
  font: 700 12px/1 var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase;
  transition: transform 0.2s, box-shadow 0.2s;
}
.p-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(204, 255, 0, 0.22); }
.p-cta.ghost { background: transparent; color: var(--acid); box-shadow: inset 0 0 0 1.5px var(--acid); }
.p-cta.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--acid), 0 10px 28px rgba(204, 255, 0, 0.12); }
.p-cta svg { width: 15px; height: 15px; }

/* Section heading */
.sec { padding: clamp(36px, 7vh, 88px) 0; border-top: 1px solid var(--hair); }
.sec-k {
  margin: 0 0 clamp(16px, 2.5vh, 26px); display: flex; align-items: baseline; gap: 14px;
  font: 600 11px/1 var(--f-ui); letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint);
}
.sec-k b { color: var(--acid); font-weight: 600; }
.sec h2 { margin: 0 0 18px; font-family: var(--f-head); font-weight: 900; font-size: clamp(1.5rem, 3.4vw, 2.6rem); line-height: 1.05; letter-spacing: -0.01em; }
.sec p { margin: 0 0 16px; max-width: 64ch; color: var(--muted); font-size: clamp(0.98rem, 1.4vw, 1.12rem); line-height: 1.75; }

/* Meta grid (role / tools / etc.) */
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--hair); border: 1px solid var(--hair); margin-top: clamp(26px, 4vh, 44px); }
.meta div { background: var(--ink); padding: 18px 20px; }
.meta dt { margin: 0 0 8px; font: 600 10px/1 var(--f-ui); letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.meta dd { margin: 0; font-size: 14px; color: var(--paper); line-height: 1.5; }

/* Outcomes */
.outcomes { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: clamp(20px, 3vh, 32px); }
.oc { border: 1px solid var(--hair); padding: 20px; background: linear-gradient(to bottom, rgba(255,255,255,0.02), transparent); }
.oc .ov { font-family: var(--f-head); font-weight: 900; font-size: clamp(1.4rem, 3vw, 2rem); color: var(--acid); line-height: 1; }
.oc .ol { margin: 10px 0 8px; font: 600 10px/1 var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.oc .od { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: clamp(20px, 3vh, 32px); }
.gallery a { position: relative; overflow: hidden; border: 1px solid var(--hair); background: #000; }
.gallery img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.5s ease; }
.gallery a:hover img { transform: scale(1.04); }
.gallery .wide { grid-column: span 2; }
.gallery .wide img { aspect-ratio: 16 / 9; }

/* Video pair */
.vpair { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: clamp(20px, 3vh, 32px); }
.vpair figure { margin: 0; }
.vpair video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; border: 1px solid var(--hair); }
.vpair figcaption { margin-top: 9px; font: 600 10px/1 var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }

/* Footer */
.p-foot { position: relative; z-index: 2; border-top: 1px solid var(--hair); margin-top: clamp(40px, 8vh, 110px); padding: clamp(40px, 7vh, 84px) var(--gutter) calc(40px + env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.p-foot .home { display: inline-flex; align-items: center; }
.p-foot .home svg { width: 44px; height: 44px; display: block; }
.p-foot small { font: 600 10px/1.4 var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); text-align: right; }

/* Back-to-top arrow, bottom-right */
.to-top {
  position: fixed; z-index: 70;
  right: clamp(16px, 4vw, 40px); bottom: calc(clamp(16px, 4vw, 40px) + env(safe-area-inset-bottom, 0px));
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 1px solid var(--hair); background: rgba(10, 11, 13, 0.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--paper); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s, border-color 0.2s, color 0.2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--acid); color: var(--acid); }
.to-top svg { width: 18px; height: 18px; }

@media (max-width: 680px) {
  .p-topbar { top: calc(22px + env(safe-area-inset-top, 0px)); }
  .p-idx small { display: none; }
  .gallery { grid-template-columns: 1fr; }
  .gallery .wide { grid-column: span 1; }
  .gallery img, .gallery .wide img { aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .p-cta, .gallery img { transition: none; }
}
