/* idcolor.ru — Color Tool (Coolors-style workspace)
   Editorial Luxury vibe carried into secondary pages, but homepage = real tool.
*/

/* ============ TOKENS ============ */
:root {
  --f-display: 'Archivo', system-ui, -apple-system, sans-serif;
  --f-sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --t-micro: 10.5px;
  --t-eyebrow: 11.5px;
  --t-tiny: 12.5px;
  --t-sm: 14px;
  --t-base: 15px;
  --t-lg: 17.5px;
  --t-xl: 22px;
  --t-2xl: 28px;
  --t-3xl: 40px;
  --t-display: clamp(48px, 8vw, 120px);

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px; --s-11: 160px;

  --r-pill: 999px;
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-shell: 38px;

  --e-out: cubic-bezier(0.32, 0.72, 0, 1);
  --e-out-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --e-spring: cubic-bezier(0.5, 1.55, 0.4, 1);
  --d-fast: 180ms;
  --d: 360ms;
  --d-slow: 700ms;

  --header-h: 84px;
}

/* ============ THEME — neutral tool palette ============ */
:root,
[data-theme='light'] {
  --bg: #fafaf9;
  --bg-soft: #f4f4f3;
  --shell: rgba(15, 15, 20, 0.045);
  --shell-ring: rgba(15, 15, 20, 0.09);
  --panel: #ffffff;
  --ink: #0a0a0b;
  --ink-2: #404044;
  --ink-3: #71717a;
  --ink-4: #a1a1aa;
  --line: rgba(15, 15, 20, 0.09);
  --line-soft: rgba(15, 15, 20, 0.05);
  --inner-highlight: rgba(255, 255, 255, 0.6);
  --shadow-card: 0 30px 60px -32px rgba(15, 15, 20, 0.18), 0 10px 25px -15px rgba(15, 15, 20, 0.1);
  --shadow-soft: 0 14px 36px -20px rgba(15, 15, 20, 0.14);
  --noise-opacity: 0;
}

[data-theme='dark'] {
  --bg: #0a0a0b;
  --bg-soft: #131316;
  --shell: rgba(255, 255, 255, 0.04);
  --shell-ring: rgba(255, 255, 255, 0.09);
  --panel: #16161a;
  --ink: #fafafa;
  --ink-2: #c4c4c8;
  --ink-3: #71717a;
  --ink-4: #52525a;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.04);
  --inner-highlight: rgba(255, 255, 255, 0.05);
  --shadow-card: 0 30px 60px -32px rgba(0, 0, 0, 0.7), 0 10px 25px -15px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 16px 40px -20px rgba(0, 0, 0, 0.4);
  --noise-opacity: 0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0a0a0b;
    --bg-soft: #131316;
    --shell: rgba(255, 255, 255, 0.04);
    --shell-ring: rgba(255, 255, 255, 0.09);
    --panel: #16161a;
    --ink: #fafafa;
    --ink-2: #c4c4c8;
    --ink-3: #71717a;
    --ink-4: #52525a;
    --line: rgba(255, 255, 255, 0.08);
    --line-soft: rgba(255, 255, 255, 0.04);
    --inner-highlight: rgba(255, 255, 255, 0.05);
    --shadow-card: 0 30px 60px -32px rgba(0, 0, 0, 0.7), 0 10px 25px -15px rgba(0, 0, 0, 0.5);
    --shadow-soft: 0 16px 40px -20px rgba(0, 0, 0, 0.4);
    --noise-opacity: 0;
  }
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: var(--t-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
  overflow-x: hidden;
  transition: background var(--d) var(--e-out), color var(--d) var(--e-out);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; color: inherit; cursor: pointer; padding: 0; }
code, kbd { font-family: var(--f-mono); font-feature-settings: 'tnum' 1, 'zero' 1; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* Grain overlay removed — was adding "designed" feel inappropriate for a tool */

.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding-left: clamp(20px, 4vw, 56px);
  padding-right: clamp(20px, 4vw, 56px);
}

/* ============ FLUID ISLAND NAV ============ */
.nav-island {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
}
.nav-island > * { pointer-events: auto; }
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: saturate(170%) blur(20px);
  -webkit-backdrop-filter: saturate(170%) blur(20px);
  border: 1px solid var(--shell-ring);
  border-radius: var(--r-pill);
  box-shadow: inset 0 1px 0 var(--inner-highlight), var(--shadow-soft);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 6px;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: var(--t-sm);
  letter-spacing: -0.02em;
  border-radius: var(--r-pill);
  color: var(--ink);
}
.nav-brand-mark {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: url('/logo.png') center/cover no-repeat;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
  transition: transform var(--d) var(--e-spring);
}
.nav-brand:hover .nav-brand-mark { transform: rotate(45deg) scale(1.08); }
.nav-brand-name {
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
  gap: 1px;
}
.nav-brand-name strong {
  font-weight: 600;
  font-family: var(--f-display);
  letter-spacing: -0.02em;
  font-size: 14.5px;
}
.nav-brand-name span {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 400;
}
.nav-links { display: flex; gap: 2px; }
.nav-link {
  display: inline-block;
  padding: 8px 16px;
  font-size: var(--t-sm);
  color: var(--ink-2);
  border-radius: var(--r-pill);
  transition: background var(--d-fast) var(--e-out), color var(--d-fast) var(--e-out);
}
.nav-link:hover { color: var(--ink); background: var(--shell); }
.nav-link[aria-current='page'] { color: var(--ink); background: var(--shell); }
.nav-controls {
  display: flex; gap: 2px;
  padding-left: 6px; margin-left: 4px;
  border-left: 1px solid var(--shell-ring);
}
.nav-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  transition: all var(--d-fast) var(--e-out);
}
.nav-icon:hover { color: var(--ink); background: var(--shell); }
.nav-icon svg { width: 15px; height: 15px; }
.nav-lang {
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 12px;
  height: 36px;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  display: inline-flex; align-items: center;
  transition: all var(--d-fast) var(--e-out);
}
.nav-lang:hover { color: var(--ink); background: var(--shell); }

/* ============ WORKSPACE (Coolors-style) ============ */
.workspace {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 0 100px; /* reserve room for floating dock at bottom */
}

.palette-strip {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--strip-count, 6), 1fr);
  gap: 0;
  min-height: calc(100dvh - 100px);
}

.swatch {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: flex-grow var(--d) var(--e-out);
}

.swatch input[type='color'] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}

/* Action stack — bottom of swatch, centered (Coolors style) */
.sw-actions {
  position: absolute;
  left: 50%;
  bottom: 180px;
  transform: translate(-50%, 8px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transition: opacity var(--d-fast) var(--e-out), transform var(--d-fast) var(--e-out);
}
.swatch:hover .sw-actions { opacity: 1; transform: translate(-50%, 0); }
.swatch.locked .sw-actions { opacity: 1; transform: translate(-50%, 0); }
.swatch.locked .sw-actions .sw-lock { background: rgba(0,0,0,0.4); }

.sw-btn {
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  color: var(--swatch-ink, white);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background var(--d-fast) var(--e-out), transform var(--d-fast) var(--e-out);
}
.sw-btn:hover { background: rgba(255,255,255,0.32); transform: scale(1.08); }
.sw-btn:active { transform: scale(0.95); }
.sw-btn svg { width: 16px; height: 16px; stroke-width: 1.6; }
.sw-btn.sw-lock { background: rgba(0,0,0,0.22); }
.swatch.locked .sw-lock svg { stroke-width: 2.2; }

/* Always-visible lock indicator when swatch is locked */
.lock-indicator {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  color: var(--swatch-ink, white);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.swatch.locked .lock-indicator { display: inline-flex; }
.lock-indicator svg { width: 12px; height: 12px; stroke-width: 2.4; }

/* Bottom info block — centered, Coolors-style */
.sw-info {
  padding: 30px 22px 24px;
  position: relative;
  z-index: 1;
  text-align: center;
}
.sw-hex {
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: clamp(20px, 1.5vw, 26px);
  letter-spacing: 0.04em;
  color: var(--swatch-ink, white);
  margin: 0 0 8px;
  line-height: 1;
  text-transform: uppercase;
}
.sw-name {
  font-family: var(--f-sans);
  font-size: var(--t-tiny);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--swatch-ink, white);
  opacity: 0.55;
  margin: 0;
}

/* Insert button between swatches */
.swatch-insert {
  position: absolute;
  top: 50%;
  right: -16px;
  transform: translate(50%, -50%) scale(0);
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: inline-flex;
  align-items: center; justify-content: center;
  z-index: 5;
  transition: transform var(--d) var(--e-spring), opacity var(--d-fast) var(--e-out);
  opacity: 0;
  box-shadow: 0 6px 18px -6px rgba(0,0,0,0.3);
}
.swatch:not(:last-child):hover .swatch-insert { transform: translate(50%, -50%) scale(1); opacity: 1; }
.swatch-insert svg { width: 12px; height: 12px; }

/* ============ WORKSPACE BAR — floating dock at bottom ============ */
.workspace-bar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 6px;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: saturate(170%) blur(22px);
  -webkit-backdrop-filter: saturate(170%) blur(22px);
  border: 1px solid var(--shell-ring);
  border-radius: var(--r-pill);
  box-shadow: inset 0 1px 0 var(--inner-highlight), 0 14px 36px -16px rgba(0,0,0,0.25);
  flex-wrap: nowrap;
  max-width: calc(100vw - 32px);
}
.wb-left, .wb-right { display: flex; align-items: center; gap: 4px; }

.kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-size: var(--t-tiny);
  color: var(--ink-3);
}
.kbd {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 24px; height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--shell);
  border: 1px solid var(--shell-ring);
  font-size: 10px;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: var(--ink);
}

.wb-divider {
  width: 1px; height: 20px;
  background: var(--shell-ring);
  margin: 0 2px;
}

.wb-select-wrap { position: relative; }
.wb-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--f-sans);
  font-size: var(--t-sm);
  font-weight: 500;
  padding: 8px 30px 8px 14px;
  border-radius: var(--r-pill);
  background: transparent;
  border: none;
  color: var(--ink);
  cursor: pointer;
  transition: background var(--d-fast) var(--e-out);
}
.wb-select:hover { background: var(--shell); }
.wb-select-wrap::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--ink-2);
  border-bottom: 1.5px solid var(--ink-2);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.wb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: var(--f-sans);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink-2);
  border-radius: var(--r-pill);
  background: transparent;
  border: none;
  transition: all var(--d-fast) var(--e-out);
}
.wb-btn:hover { color: var(--ink); background: var(--shell); }
.wb-btn svg { width: 14px; height: 14px; stroke-width: 1.8; }

/* Icon-only buttons in dock */
.wb-btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wb-btn-icon svg { width: 16px; height: 16px; }

.wb-btn-primary {
  background: var(--ink);
  color: var(--bg);
  padding: 8px 6px 8px 16px;
  gap: 10px;
  border-radius: var(--r-pill);
}
.wb-btn-primary:hover { background: var(--ink); color: var(--bg); }
.wb-btn-primary .pb-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--bg) 18%, transparent);
  transition: transform var(--d) var(--e-spring), background var(--d) var(--e-out);
}
.wb-btn-primary:hover .pb-icon {
  transform: translate(2px, -2px);
  background: color-mix(in oklab, var(--bg) 28%, transparent);
}

/* ============ INSPECTOR — floating overlay ============ */
.inspector-floating {
  position: fixed;
  top: 50%;
  right: 24px;
  transform: translate(40px, -50%) scale(0.96);
  z-index: 95;
  width: 440px;
  max-width: calc(100vw - 48px);
  max-height: calc(100dvh - 140px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--shell-ring);
  border-radius: var(--r-shell);
  padding: 8px;
  display: none;
  grid-template-rows: 180px auto auto;
  gap: 10px;
  box-shadow:
    inset 0 1px 0 var(--inner-highlight),
    var(--shadow-card);
  opacity: 0;
  transition: opacity var(--d) var(--e-out), transform var(--d) var(--e-out);
}
.inspector-floating[data-open='true'] {
  display: grid;
  opacity: 1;
  transform: translate(0, -50%) scale(1);
}
.inspector-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--shell);
  border: 1px solid var(--shell-ring);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background var(--d-fast) var(--e-out), color var(--d-fast) var(--e-out);
}
.inspector-close:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.inspector-close svg { width: 14px; height: 14px; }

/* Hex code on preview top — leave room for close button */
.inspector-preview .ip-top {
  padding-right: 36px;
}
.inspector-preview {
  border-radius: calc(var(--r-shell) - 8px);
  background: var(--inspector-color, #b69adf);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  color: var(--inspector-ink, white);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
  position: relative;
}
.inspector-preview .ip-top {
  font-family: var(--f-mono);
  font-size: var(--t-eyebrow);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.7;
  display: flex; justify-content: space-between;
}
.inspector-preview .ip-name {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.025em;
  margin: 0;
}
/* HSL sliders inside inspector */
.inspector-sliders {
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.slider-row { display: flex; flex-direction: column; gap: 6px; }
.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--f-mono);
  font-size: var(--t-eyebrow);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.slider-head .slider-val {
  font-family: var(--f-mono);
  font-size: var(--t-tiny);
  color: var(--ink);
  letter-spacing: 0.04em;
}
.slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 14px;
  border-radius: 7px;
  cursor: pointer;
  background-color: var(--shell);
  border: 1px solid var(--shell-ring);
  outline: none;
}
.slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--ink);
  cursor: grab;
  transition: transform 120ms var(--e-out);
}
.slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.15); }
.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--ink);
  cursor: grab;
}
.slider.slider-h {
  background-image: linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
  border: none;
}
.slider.slider-s {
  background-image: linear-gradient(90deg, var(--slider-grey, #888), var(--slider-pure, #ff0000));
  border: none;
}
.slider.slider-l {
  background-image: linear-gradient(90deg, #000, var(--slider-pure, #ff0000), #fff);
  border: none;
}

.inspector-formats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 0 8px 8px;
}
.fmt-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--shell);
  border: 1px solid var(--shell-ring);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--d-fast) var(--e-out);
  text-align: left;
}
.fmt-cell:hover { border-color: var(--shell-ring); transform: translateY(-1px); }
.fmt-cell.copied { border-color: #6a9a4a; }
.fmt-cell .fmt-tag {
  font-family: var(--f-mono);
  font-size: var(--t-eyebrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.fmt-cell .fmt-value {
  font-family: var(--f-mono);
  font-size: var(--t-base);
  color: var(--ink);
}
.fmt-cell.fmt-cell-name .fmt-value {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: var(--t-lg);
  letter-spacing: -0.015em;
}

/* ============ DESIGN-SYSTEM PALETTES (compact) ============ */
.section-tools {
  padding: clamp(60px, 8vw, 100px) 0 clamp(48px, 6vw, 80px);
}
.section-head-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: var(--s-6);
  gap: var(--s-5);
  flex-wrap: wrap;
}
.section-h {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--ink);
}
.section-h em { font-style: normal; color: var(--ink-3); font-weight: 500; }
.section-sub {
  font-family: var(--f-mono);
  font-size: var(--t-eyebrow);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.preset-card {
  background: var(--shell);
  border: 1px solid var(--shell-ring);
  border-radius: var(--r-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all var(--d) var(--e-out);
  box-shadow: inset 0 1px 0 var(--inner-highlight);
}
.preset-card:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.preset-strip {
  height: 80px;
  border-radius: calc(var(--r-lg) - 6px);
  overflow: hidden;
  display: flex;
  margin-bottom: 12px;
}
.preset-swatch { flex: 1; }
.preset-meta {
  padding: 4px 12px 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.preset-name {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: var(--t-base);
  letter-spacing: -0.015em;
  color: var(--ink);
}
.preset-credit {
  font-family: var(--f-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.preset-cta {
  margin-top: var(--s-5);
  text-align: right;
}
.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-sans);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink-2);
  padding: 8px 8px 8px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--shell-ring);
  transition: all var(--d) var(--e-out);
}
.cta-link:hover { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.cta-link .arrow-mini {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--shell);
  transition: transform var(--d) var(--e-spring), background var(--d) var(--e-out);
}
.cta-link:hover .arrow-mini {
  transform: translate(3px, -3px);
  background: color-mix(in oklab, var(--bg) 20%, transparent);
}
.cta-link .arrow-mini svg { width: 12px; height: 12px; }

/* ============ THEME TOGGLE — sun ↔ moon morphing ============ */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  position: relative;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--d-fast) var(--e-out), color var(--d-fast) var(--e-out);
  overflow: hidden;
}
.theme-toggle:hover { color: var(--ink); background: var(--shell); }
.theme-toggle .ti {
  position: absolute;
  width: 16px;
  height: 16px;
  transition:
    opacity 350ms var(--e-out),
    transform 500ms var(--e-spring);
}
.theme-toggle .ti-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}
.theme-toggle .ti-moon {
  opacity: 0;
  transform: rotate(-120deg) scale(0.5);
}
[data-theme='dark'] .theme-toggle .ti-sun {
  opacity: 0;
  transform: rotate(120deg) scale(0.5);
}
[data-theme='dark'] .theme-toggle .ti-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .ti-sun {
    opacity: 0;
    transform: rotate(120deg) scale(0.5);
  }
  :root:not([data-theme]) .theme-toggle .ti-moon {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 30px);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 22px;
  border-radius: var(--r-pill);
  font-family: var(--f-mono);
  font-size: var(--t-sm);
  letter-spacing: 0.04em;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all var(--d) var(--e-spring);
  box-shadow: 0 16px 40px -16px rgba(0,0,0,0.4);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ FOOTER — minimal single row ============ */
.site-footer {
  padding: var(--s-7) 0;
  border-top: 1px solid var(--line);
  margin-top: var(--s-9);
  font-family: var(--f-sans);
  font-size: var(--t-sm);
  color: var(--ink-3);
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  flex-wrap: wrap;
}
.footer-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.footer-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: url('/logo.png') center/cover no-repeat;
}
.footer-brand-inline {
  font-family: var(--f-display);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-size: 15px;
}
.footer-right {
  display: inline-flex;
  align-items: center;
  gap: var(--s-5);
}
.footer-right a {
  color: var(--ink-3);
  transition: color var(--d-fast) var(--e-out);
}
.footer-right a:hover { color: var(--ink); }

/* ============ ABOUT PAGE — Editorial typography ============ */
.article-page {
  padding: clamp(80px, 12vw, 160px) 0 clamp(60px, 10vw, 120px);
  max-width: 780px;
  margin: 0 auto;
}
.article { max-width: 760px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-family: var(--f-mono);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--shell);
  border: 1px solid var(--shell-ring);
  border-radius: var(--r-pill);
  margin-bottom: var(--s-6);
}
.eyebrow .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); display: inline-block; }
.article h1 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 var(--s-5);
  color: var(--ink);
}
.article h1 em { font-style: normal; color: var(--ink-3); font-weight: 500; }
.article .lead {
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: clamp(18px, 1.5vw, 22px);
  color: var(--ink-2);
  line-height: 1.5;
  letter-spacing: -0.005em;
  margin: 0 0 var(--s-8);
  max-width: 50ch;
}
.article h2 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: var(--s-8) 0 var(--s-3);
  color: var(--ink);
}
.article p {
  font-family: var(--f-sans);
  font-size: var(--t-lg);
  color: var(--ink-2);
  line-height: 1.65;
  margin: 0 0 var(--s-4);
}
.article ul { list-style: none; padding: 0; margin: var(--s-5) 0; counter-reset: li-counter; }
.article ul li {
  padding: var(--s-4) 0;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: var(--t-lg);
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: var(--s-3);
  align-items: baseline;
}
.article ul li:last-child { border-bottom: 1px solid var(--line); }
.article ul li::before {
  content: counter(li-counter, decimal-leading-zero);
  counter-increment: li-counter;
  font-family: var(--f-mono);
  font-size: var(--t-tiny);
  letter-spacing: 0.06em;
  color: var(--ink-4);
  align-self: start; padding-top: 4px;
}
.article code {
  background: var(--shell);
  border: 1px solid var(--shell-ring);
  padding: 2px 8px;
  border-radius: var(--r-xs);
  font-size: 0.88em;
}

/* ============ PALETTES PAGE ============ */
.palettes-page { padding: clamp(80px, 12vw, 160px) 0 clamp(60px, 10vw, 120px); }
.palettes-head {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(32px, 6vw, 100px);
  align-items: end;
  margin-bottom: clamp(48px, 8vw, 80px);
}
.palettes-head h1 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.0;
  letter-spacing: -0.035em;
  margin: 0;
}
.palettes-head h1 em { font-style: normal; color: var(--ink-3); font-weight: 500; }
.palettes-head .lead {
  font-size: var(--t-lg);
  color: var(--ink-2);
  max-width: 44ch;
  margin: 0;
}
.palette-filters { display: flex; gap: 6px; margin-bottom: var(--s-7); flex-wrap: wrap; }
.palette-filter {
  font-family: var(--f-sans);
  font-size: var(--t-sm);
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--shell-ring);
  transition: all var(--d-fast) var(--e-out);
}
.palette-filter:hover { color: var(--ink); background: var(--shell); }
.palette-filter[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.palette-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.palette-card {
  background: var(--shell);
  border: 1px solid var(--shell-ring);
  border-radius: var(--r-shell);
  padding: 6px;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 1px 0 var(--inner-highlight), var(--shadow-soft);
  transition: transform var(--d) var(--e-out);
}
.palette-card:hover { transform: translateY(-3px); }
.palette-card .pc-inner {
  background: var(--panel);
  border-radius: calc(var(--r-shell) - 6px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  flex: 1;
}
.palette-card.pc-6 { grid-column: span 6; }
.palette-card.pc-4 { grid-column: span 4; }
.palette-card.pc-8 { grid-column: span 8; }
.palette-card.pc-5 { grid-column: span 5; }
.palette-card.pc-7 { grid-column: span 7; }
.pal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); }
.pal-name {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: var(--t-lg);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}
.pal-credit {
  font-family: var(--f-mono);
  font-size: var(--t-eyebrow);
  letter-spacing: 0.1em;
  color: var(--ink-3);
  text-transform: uppercase;
  white-space: nowrap;
}
.pc-strip {
  display: flex;
  border-radius: var(--r-md);
  overflow: hidden;
  height: 84px;
  flex: 1;
  min-height: 84px;
}
.pal-swatch {
  flex: 1;
  cursor: pointer;
  position: relative;
  transition: flex var(--d) var(--e-out);
}
.pal-swatch:hover { flex: 2.4; }
.pal-swatch::after {
  content: attr(data-hex);
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--swatch-ink, white);
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity var(--d-fast) var(--e-out);
}
.pal-swatch:hover::after { opacity: 0.9; }
.pal-swatch.copied::after { content: 'COPIED'; opacity: 1; }
.pal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pal-tags { display: flex; gap: 8px; }
.pal-tags span:not(:last-child)::after { content: '·'; margin-left: 8px; color: var(--ink-4); }
.pal-load {
  background: var(--shell);
  border: 1px solid var(--shell-ring);
  color: var(--ink);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-family: var(--f-sans);
  font-size: var(--t-tiny);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--d-fast) var(--e-out);
}
.pal-load:hover { background: var(--ink); color: var(--bg); }

/* ============ REVEAL ============ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  transition:
    opacity var(--d-slow) var(--e-out),
    transform var(--d-slow) var(--e-out),
    filter var(--d-slow) var(--e-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.in { opacity: 1; transform: translateY(0); filter: blur(0); }

/* ============ MOBILE ============ */
@media (max-width: 880px) {
  .palette-strip {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(100px, auto);
    min-height: auto;
  }
  .swatch { flex-direction: row; align-items: center; justify-content: space-between; padding: 18px; }
  .swatch .sw-info { padding: 0; }
  .sw-actions {
    position: static;
    opacity: 1;
    transform: none;
    flex-direction: row;
  }
  .swatch-insert { display: none; }
  .inspector { grid-template-columns: 1fr; }
  .preset-grid { grid-template-columns: 1fr; }
  .palette-grid { grid-template-columns: 1fr; }
  .palette-card.pc-6, .palette-card.pc-4, .palette-card.pc-8,
  .palette-card.pc-5, .palette-card.pc-7 { grid-column: span 1; }
  .palettes-head { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand-big { grid-column: span 1; font-size: clamp(60px, 22vw, 110px); }
  .nav-links { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; filter: none; }
}
