/* ============================================================
   Hueflow — design tokens, reset and page layout
   ============================================================ */

/* Neumorphic dark/blue system — see styleguide.md.
   Three depth states only: RAISED (drop shadow + top highlight),
   INSET (inner shadow, never a drop shadow) and SCREEN (recessed display).
   One light source, always from above. Borders are near-black. */

:root {
  /* ---------- surfaces ---------- */
  --bg: #08090b;
  --bg-2: #0d0f12;        /* the fill of anything inset */
  --panel: #121418;       /* bottom of a card gradient */
  --panel-2: #171a1f;     /* top of a card gradient */
  --panel-3: #1c2028;     /* popovers and raised chrome */
  --stroke: #23272e;      /* card border */
  --stroke-2: #2d323a;    /* border on flat controls */
  --edge: #030405;        /* near-black: borders + shadows of 3D pieces */

  /* older names kept so every rule keeps resolving */
  --line: var(--stroke);
  --line-strong: var(--stroke-2);

  /* ---------- ink ---------- */
  --text: #e9edf5;
  --text-2: #868fa0;
  --text-3: #677080;

  /* ---------- accent ---------- */
  --accent: #3f7bff;
  --accent-2: #82aeff;
  --accent-hi: #5a8ef0;   /* top of the blue 3D gradient */
  --accent-lo: #3058a3;   /* bottom of it */
  --accent-soft: rgba(92, 149, 255, 0.16);

  --good: #4ad9b4;
  --warn: #ffb648;
  --bad: #ff6b7d;

  /* ---------- depth recipes ---------- */
  --face: linear-gradient(180deg, #23272e, #0b0d10);
  --face-accent: linear-gradient(180deg, var(--accent-hi), var(--accent-lo));
  --raise: 0 2px 4px rgba(3, 4, 5, 0.55), inset 0 2px 3px rgba(255, 255, 255, 0.2);
  --raise-accent: 0 3px 5px rgba(3, 4, 5, 0.55), inset 0 2px 3px rgba(255, 255, 255, 0.3);
  --press: 0 1px 1px rgba(3, 4, 5, 0.55), inset 0 2px 4px rgba(0, 0, 0, 0.4);
  --sink: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  --sink-deep: inset 0 2px 4px rgba(0, 0, 0, 0.75), inset 0 -1px 1px rgba(255, 255, 255, 0.04);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 16px;
  --r-xl: 18px;

  --shadow-1: 0 1px 2px rgba(3, 4, 5, 0.5);
  --shadow-2: 0 10px 28px rgba(0, 0, 0, 0.55);
  --shadow-3: 0 18px 44px rgba(0, 0, 0, 0.6);
  --glow: 0 3px 5px rgba(3, 4, 5, 0.55), inset 0 2px 3px rgba(255, 255, 255, 0.3);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --fast: 140ms;
  --med: 260ms;
  --slow: 460ms;

  --nav-h: 74px;
  --sidebar-w: 320px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  caret-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100%;
}

h1, h2, h3, p { margin: 0; }

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

/* real text entry is the only place a caret belongs */
input[type="text"],
textarea { caret-color: var(--accent-2); }

button {
  background: none;
  border: 0;
  cursor: pointer;
}

/* a key is a tiny raised cap */
kbd {
  /* the UA stylesheet defaults kbd to monospace; the app never uses it */
  font-family: inherit;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--face);
  border: 1px solid var(--edge);
  box-shadow: var(--raise);
  color: var(--text-2);
}

pre {
  /* deliberately not monospace: the app uses a single type family */
  font-family: inherit;
  margin: 0;
}

[hidden] { display: none !important; }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--stroke-2);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #393e47; background-clip: content-box; }

/* ---------- icons ---------- */

.i {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: none;
}
.i svg { width: 100%; height: 100%; display: block; }
.i-sm { width: 14px; height: 14px; }
.i-lg { width: 30px; height: 30px; }
.i.accent { color: var(--accent-2); }

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  gap: 22px;
  align-items: start;
  /* no bottom padding: the toolbar dock is meant to sit on the viewport
     floor, and any padding here just parks empty space beneath it */
  padding: 20px 26px 0;
  max-width: 1640px;
  margin: 0 auto;
  transition: grid-template-columns var(--slow) var(--ease-out);
}

/* Collapsing the assistant hands its width to the palette. */
.layout.sidebar-collapsed { --sidebar-w: 54px; }

/* Full-height column: the swatch row takes the slack, so collapsing the
   editor hands its space straight to the colours. */
.main-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - var(--nav-h) - 20px);
}

/* the palettes grid is a scrolling page, so it keeps its breathing room */
#palettesView { padding-bottom: 40px; }

.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--stroke);
  border-radius: var(--r-xl);
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 16px 0;
  }
  :root { --sidebar-w: auto; }
}
