/* ============================================================
   ICEBOLETHU — Design tokens (v2)
   Aligned to the Apollis system: DM Serif Display + DM Sans,
   warm paper / true-black, terracotta accent, tight radii.
   ============================================================ */

:root {
  /* Type */
  --font-display: "Merriweather", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Radii — restrained, editorial */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-2xl: 30px;
  --r-pill: 999px;

  --pad-page: clamp(20px, 5vw, 80px);
  --maxw: 1240px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 0.16s;
  --t: 0.32s;
  --t-slow: 0.6s;
}

/* ---------- LIGHT (warm paper) ---------- */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg:        #f5f5f2;
  --bg-2:      #efeee9;
  --surface:   #ffffff;
  --surface-2: #fafaf7;
  --surface-3: #ecebe6;
  --text:      #0d0d0c;
  --text-2:    #45443f;
  --text-3:    #76756c;
  --border:    #e4e2da;
  --border-2:  #d0cec4;

  --accent:        #e0481d;
  --accent-strong: #c23c14;
  --accent-soft:   #fbe5dc;
  --accent-line:   #f1b29c;
  --on-accent:     #ffffff;

  --shadow-sm: 0 1px 2px rgba(13,13,12,0.05), 0 0 0 1px rgba(13,13,12,0.04);
  --shadow-md: 0 4px 16px rgba(13,13,12,0.08), 0 1px 3px rgba(13,13,12,0.05);
  --shadow-lg: 0 22px 50px -16px rgba(13,13,12,0.22), 0 6px 14px -6px rgba(13,13,12,0.10);
  --glass: rgba(255,255,255,0.78);
  --glass-brd: rgba(228,226,218,0.9);
  --hatch: rgba(120,118,108,0.10);
  --on-photo: #ffffff;
}

/* ---------- DARK (true black) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #0a0a0b;
  --bg-2:      #131314;
  --surface:   #161617;
  --surface-2: #1d1d1f;
  --surface-3: #252527;
  --text:      #f4f4f5;
  --text-2:    #c9c9cc;
  --text-3:    #88888d;
  --border:    #29292c;
  --border-2:  #3a3a3e;

  --accent:        #ff5a2c;
  --accent-strong: #ff7549;
  --accent-soft:   #3a1810;
  --accent-line:   #5a2a1a;
  --on-accent:     #0a0a09;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.4);
  --shadow-lg: 0 28px 60px -18px rgba(0,0,0,0.75), 0 8px 18px -8px rgba(0,0,0,0.55);
  --glass: rgba(18,18,20,0.72);
  --glass-brd: rgba(58,58,62,0.7);
  --hatch: rgba(220,220,225,0.07);
  --on-photo: #ffffff;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
  overflow-x: clip;
}

::selection { background: var(--accent); color: var(--on-accent); }

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

/* Display headings = serif; UI headings = sans */
h1, h2 { font-family: var(--font-display); font-weight: 400; line-height: 1.04; letter-spacing: -0.015em; color: var(--text); }
h3, h4 { font-family: var(--font-body); font-weight: 600; line-height: 1.15; letter-spacing: -0.012em; color: var(--text); }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-page); }
.section { padding-block: clamp(56px, 8vw, 116px); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 18px; height: 1.5px; background: var(--accent); display: inline-block; }
.muted { color: var(--text-2); }
.lead { font-size: clamp(17px, 1.7vw, 19px); color: var(--text-2); line-height: 1.62; max-width: 56ch; }
.serif { font-family: var(--font-display); font-weight: 400; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Micro-interaction utilities ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

.lift { box-shadow: var(--shadow-sm); transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease); }
.lift:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.press { transition: transform var(--t-fast) var(--ease); }
.press:active { transform: scale(0.97); }

.ul { position: relative; }
.ul::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform var(--t) var(--ease);
}
.ul:hover::after { transform: scaleX(1); transform-origin: left; }

/* Photo wrapper */
.photo { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--accent-soft), var(--surface-3)); }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.9s var(--ease); }
.photo-zoom:hover img { transform: scale(1.06); }
.photo-tint { position: absolute; inset: 0; }

/* Hatched placeholder (fallback only) */
.ph {
  position: relative; overflow: hidden;
  background-color: var(--surface-2);
  background-image: repeating-linear-gradient(135deg, var(--hatch) 0 1.5px, transparent 1.5px 11px);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: grid; place-items: center; color: var(--text-3);
}
.ph__tag {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  background: var(--surface); color: var(--text-2);
  padding: 5px 11px; border-radius: var(--r-pill); box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; gap: 7px;
}

/* View Transition theme swap */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 9999; }

:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee { display: flex; width: max-content; animation: marquee 42s linear infinite; }
.marquee:hover { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .marquee { animation: none; } }

@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes growbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes slowspin { to { transform: rotate(360deg); } }

/* scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; border: 3px solid var(--bg); }
