/* ============================================================
   DIGICRAFT — Design System
   Geometric sans (Space Grotesk) + Mono accents (JetBrains Mono)
   White / near-black #14171C / red #FF0000 (used sparingly)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root{
  --bg: #FFFFFF;
  --bg-soft: #F5F6F7;
  --ink: #14171C;
  --ink-60: #5B6068;
  --ink-30: #A7ABB1;
  --line: #E6E8EA;
  --line-strong: #14171C;
  --red: #FF0000;
  --dark: #0E1014;
  --dark-soft: #16191F;

  --maxw: 1320px;
  --gutter: 32px;
  --col-gap: 24px;

  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --step--1: clamp(0.78rem, 0.75rem + 0.15vw, 0.86rem);
  --step-0: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  --step-1: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4: clamp(2.8rem, 2rem + 4vw, 5.2rem);
  --step-5: clamp(3.6rem, 2.2rem + 6.5vw, 7.5rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){ html{ scroll-behavior: auto; } }

body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection{ background: var(--red); color: #fff; }

a{ color: inherit; text-decoration: none; }
img, svg{ display: block; max-width: 100%; }
button{ font-family: inherit; cursor: pointer; }

/* ---------- Layout ---------- */
.wrap{
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section{ padding-block: clamp(72px, 9vw, 150px); }
.section--tight{ padding-block: clamp(48px, 6vw, 90px); }

.grid12{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--col-gap);
}

/* ---------- Typography ---------- */
h1,h2,h3,h4{ font-weight: 600; line-height: 1.02; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1{ font-size: var(--step-5); letter-spacing: -0.035em; }
h2{ font-size: var(--step-4); letter-spacing: -0.03em; }
h3{ font-size: var(--step-2); }
p{ margin: 0; text-wrap: pretty; }

.display{ font-weight: 700; line-height: 0.98; letter-spacing: -0.04em; }

.eyebrow{
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-60);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before{
  content: "";
  width: 9px; height: 9px;
  background: var(--red);
  display: inline-block;
  box-shadow: 5px 5px 0 var(--ink), -1px -4px 0 var(--ink-30);
}
.eyebrow--plain::before{ box-shadow: none; }

.lead{ font-size: var(--step-1); line-height: 1.5; color: var(--ink-60); max-width: 46ch; }
.mono{ font-family: var(--font-mono); }
.tnum{ font-variant-numeric: tabular-nums; }
.red{ color: var(--red); }
.muted{ color: var(--ink-60); }

/* index numbering */
.idx{ font-family: var(--font-mono); font-size: var(--step--1); color: var(--ink-30); letter-spacing: 0.1em; }

/* ---------- Buttons ---------- */
.btn{
  --bw: 1.5px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 16px 24px;
  border: var(--bw) solid var(--ink);
  background: var(--ink);
  color: #fff;
  transition: transform .35s var(--ease), background .35s var(--ease), color .35s var(--ease);
  overflow: hidden;
  isolation: isolate;
}
.btn .btn__dot{ width: 8px; height: 8px; background: var(--red); transition: transform .35s var(--ease); }
.btn:hover{ background: var(--red); border-color: var(--red); }
.btn:hover .btn__dot{ background: #fff; transform: translateX(4px); }

.btn--ghost{ background: transparent; color: var(--ink); }
.btn--ghost:hover{ background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--ghost:hover .btn__dot{ background: var(--red); }

.btn--lg{ padding: 20px 30px; }

/* text link with pixel underline */
.tlink{
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  position: relative;
}
.tlink .arrow{ color: var(--red); transition: transform .3s var(--ease); }
.tlink:hover .arrow{ transform: translateX(6px); }
.tlink::after{
  content: "";
  position: absolute; left: 0; bottom: -6px;
  width: 100%; height: 2px;
  background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.tlink:hover::after{ transform: scaleX(1); }

/* ---------- Header ---------- */
.site-header{
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  transition: transform .4s var(--ease);
}
.site-header__inner{
  height: 76px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.brand{ display: flex; align-items: center; }
.brand img{ height: 26px; width: auto; }
.nav{ display: flex; align-items: center; gap: 4px; }
.nav a{
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  padding: 10px 16px;
  color: var(--ink-60);
  position: relative;
  transition: color .25s var(--ease);
}
.nav a:hover{ color: var(--ink); }
.nav a.active{ color: var(--ink); }
.nav a.active::before{
  content: ""; position: absolute; left: 16px; bottom: 4px;
  width: 8px; height: 8px; background: var(--red);
}
.header-cta{ display: flex; align-items: center; gap: 18px; }

.nav-toggle{ display: none; background: none; border: 0; padding: 8px; }
.nav-toggle span{ display:block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .3s var(--ease), opacity .3s; }

@media (max-width: 900px){
  .nav, .header-cta .btn{ display: none; }
  .nav-toggle{ display: block; }
  .mobile-nav{ display: flex; }
}

/* mobile nav overlay */
.mobile-nav{
  position: fixed; inset: 0; z-index: 99;
  background: var(--dark); color: #fff;
  flex-direction: column; justify-content: center;
  padding: var(--gutter);
  gap: 8px;
  transform: translateY(-100%);
  transition: transform .5s var(--ease);
  display: none;
}
.mobile-nav.open{ transform: translateY(0); }
@media (max-width: 900px){ .mobile-nav{ display: flex; } }
.mobile-nav a{
  font-size: var(--step-3); font-weight: 600; letter-spacing: -0.02em;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.12);
  display: flex; justify-content: space-between; align-items: baseline;
}
.mobile-nav a .n{ font-family: var(--font-mono); font-size: var(--step--1); color: var(--red); }
.mobile-nav .mn-meta{ margin-top: 28px; font-family: var(--font-mono); font-size: var(--step--1); color: rgba(255,255,255,0.5); letter-spacing: 0.1em; }

/* ---------- Footer ---------- */
.site-footer{ background: var(--dark); color: rgba(255,255,255,0.7); padding-top: clamp(64px, 8vw, 110px); }
.site-footer a{ color: rgba(255,255,255,0.7); transition: color .25s; }
.site-footer a:hover{ color: #fff; }
.footer-top{ display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand img{ height: 30px; margin-bottom: 26px; }
.footer-brand p{ max-width: 30ch; color: rgba(255,255,255,0.55); font-size: var(--step-0); }
.footer-col h4{
  font-family: var(--font-mono); font-size: var(--step--1); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.16em; color: rgba(255,255,255,0.4);
  margin-bottom: 20px;
}
.footer-col ul{ list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.footer-col li{ font-size: var(--step-0); }
.footer-bottom{
  margin-top: clamp(48px, 6vw, 80px);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-block: 28px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.04em;
  color: rgba(255,255,255,0.4);
}
@media (max-width: 760px){
  .footer-top{ grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-brand{ grid-column: 1 / -1; }
  .footer-bottom{ flex-direction: column; align-items: flex-start; }
}

/* ---------- Pixel motif ---------- */
.pixel-cluster{ display: inline-grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.pixel-cluster i{ width: 10px; height: 10px; background: var(--red); opacity: 0; }
.pixel-cluster i:nth-child(3n){ background: var(--ink); }

/* ---------- Reveal animation ---------- */
.reveal{ opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in{ opacity: 1; transform: none; }
.reveal[data-d="1"]{ transition-delay: .08s; }
.reveal[data-d="2"]{ transition-delay: .16s; }
.reveal[data-d="3"]{ transition-delay: .24s; }
.reveal[data-d="4"]{ transition-delay: .32s; }
.reveal[data-d="5"]{ transition-delay: .40s; }
@media (prefers-reduced-motion: reduce){
  .reveal{ opacity: 1 !important; transform: none !important; }
}

/* clip-reveal for headlines */
.line-mask{ display: block; overflow: hidden; }
.line-mask > span{ display: block; transform: translateY(105%); transition: transform .9s var(--ease); }
.in .line-mask > span, .line-mask.in > span{ transform: none; }

/* ---------- Cards / image placeholders ---------- */
.ph{
  position: relative;
  background:
    repeating-linear-gradient(135deg, var(--bg-soft) 0 11px, #ECEEF0 11px 22px);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ph__tag{
  font-family: var(--font-mono); font-size: var(--step--1);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-60);
  background: var(--bg); padding: 7px 12px; border: 1px solid var(--line);
}
.ph--dark{ background: repeating-linear-gradient(135deg, #16191F 0 11px, #1C2026 11px 22px); border-color: rgba(255,255,255,0.08); }
.ph--dark .ph__tag{ background: var(--dark); color: rgba(255,255,255,0.6); border-color: rgba(255,255,255,0.12); }

/* image-backed media (work / map) */
.media-img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; display: block; }
.ph:has(.media-img){ background: var(--dark); }
.ph .wcard__cat, .ph .corner, .ph .pixel-cluster, .ph .ph__tag{ z-index: 3; }

/* rule line */
.hr{ height: 1px; background: var(--line); border: 0; margin: 0; }

/* utility */
.stack{ display: grid; gap: 20px; }
.flow > * + *{ margin-top: 1.1em; }
.cluster{ display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.pad-top{ padding-top: 100px; }
.center{ text-align: center; }
.dark-section{ background: var(--dark); color: rgba(255,255,255,0.72); }
.dark-section h1, .dark-section h2, .dark-section h3{ color: #fff; }

/* ---------- Shared page hero (subpages) ---------- */
.page-hero{ position: relative; background: var(--dark); color: #fff; overflow: hidden; }
.page-hero__canvas{ position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .85; }
.page-hero::after{
  content:""; position:absolute; inset:0; z-index:1; pointer-events:none;
  background: linear-gradient(100deg, rgba(14,16,20,.97) 0%, rgba(14,16,20,.8) 45%, rgba(14,16,20,.2) 80%, rgba(14,16,20,0) 100%);
}
.page-hero__inner{ position: relative; z-index: 2; padding-block: clamp(120px, 16vh, 190px) clamp(56px, 7vw, 96px); }
.page-hero .eyebrow{ color: rgba(255,255,255,.6); margin-bottom: 26px; }
.page-hero .eyebrow::before{ box-shadow: 5px 5px 0 #fff, -1px -4px 0 rgba(255,255,255,.4); }
.page-hero h1{ color:#fff; font-size: var(--step-4); max-width: 18ch; }
.page-hero h1 .red{ color: var(--red); }
.page-hero__lead{ color: rgba(255,255,255,.66); font-size: var(--step-1); line-height: 1.5; max-width: 52ch; margin-top: 28px; }
.page-hero__crumb{
  position: relative; z-index:2; border-top: 1px solid rgba(255,255,255,.12);
  padding-block: 20px; display:flex; gap: 10px; align-items:center;
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing:.08em; text-transform: uppercase; color: rgba(255,255,255,.45);
}
.page-hero__crumb .red{ color: var(--red); }
