/* ==========================================================================
   Sidequest visual identity — the ONE shared stylesheet.
   Source of truth: Brand identity Vs 02 "The creatives" (Nov 30, 2026).

   Rules every page follows (see the flask_skills `visual-identity` skill):
   - Colors only through the --sq-* tokens below. No new hex values in templates.
   - Violet does the work of black. Lilac is home. Cream is paper and cloth.
   - Poppy is the interruption: ONE poppy element per view, never small text,
     never on lilac or pink (contrast 2.68 / 2.44 fails).
   - Lime and pink are seasons: use one at a time, never both on one page section.
   - Type: one loud voice (Inter Tight 800, CAPITALS) + one warm voice
     (Fraunces soft italic, lowercase) per piece. Marker only for a number
     or a signature, never for paragraphs.
   - The logo is the woven label (deck option 07). The round stamp is its seal.
   ========================================================================== */

/* Fonts: load once in <head> (the skill has the exact <link>):
   Inter 400–700, Inter Tight 500–900, Fraunces italic (SOFT/WONK), Permanent Marker. */

:root {
  /* Palette */
  --sq-lilac: #DBC4E8;        /* home field: backgrounds, bags, tissue */
  --sq-lilac-soft: #EDE1F4;   /* lighter lilac for cards on lilac */
  --sq-violet: #35195A;       /* the dark: type, labels, dark garments */
  --sq-violet-deep: #1F0D38;  /* hover / pressed violet */
  --sq-violet-mid: #7A5FA6;   /* seams, secondary strokes (never body text on lilac) */
  --sq-violet-muted: #6B5585; /* placeholders on cream (5.9:1) */
  --sq-cream: #ECDCCB;        /* paper and cloth */
  --sq-cream-soft: #F6EEE2;   /* card paper */
  --sq-cloth: #F8F2E9;        /* undyed tee cloth in the goods drawings */
  --sq-lime: #DDE3A5;         /* season A */
  --sq-pink: #EEB3C7;         /* season B */
  --sq-poppy: #D9472B;        /* the interruption */
  --sq-ink: #1A1A1A;          /* production only: care labels, one-color jobs */

  /* Semantic roles (prefer these in components) */
  --sq-bg: var(--sq-lilac);
  --sq-surface: var(--sq-lilac-soft);
  --sq-paper: var(--sq-cream-soft);
  --sq-text: var(--sq-violet);
  --sq-text-on-dark: var(--sq-lilac);
  --sq-line: var(--sq-violet);
  --sq-accent: var(--sq-poppy);
  --sq-focus: var(--sq-poppy);

  /* Type */
  --sq-font-loud: "Inter Tight", "Inter", system-ui, sans-serif;
  --sq-font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sq-font-warm: "Fraunces", Georgia, serif;
  --sq-font-mark: "Permanent Marker", "Comic Sans MS", cursive;

  /* Scale (fluid) */
  --sq-step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.88rem);
  --sq-step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --sq-step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --sq-step-2: clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --sq-step-3: clamp(2rem, 1.6rem + 2vw, 3.4rem);
  --sq-step-4: clamp(2.6rem, 1.8rem + 4vw, 5.6rem);
  --sq-step-5: clamp(3.2rem, 2rem + 6.5vw, 8.4rem);

  /* Lines, radius, spacing */
  --sq-rule: 3px;             /* section rules, the deck's heavy line */
  --sq-hair: 1.5px;           /* card borders, dividers */
  --sq-radius: 0;             /* the brand is square-cornered: labels, tags, paper */
  --sq-radius-pill: 999px;    /* only for chips */
  --sq-space-1: 4px;
  --sq-space-2: 8px;
  --sq-space-3: 12px;
  --sq-space-4: 16px;
  --sq-space-5: 24px;
  --sq-space-6: 32px;
  --sq-space-7: 48px;
  --sq-space-8: 72px;
  --sq-space-9: 112px;
  --sq-gutter: clamp(16px, 4vw, 84px);
  --sq-max: 1320px;

  /* Motion */
  --sq-ease: cubic-bezier(.2, .8, .2, 1);
  --sq-ease-stamp: cubic-bezier(.5, 0, .2, 1.4);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body.sq {
  margin: 0;
  background: var(--sq-bg);
  color: var(--sq-text);
  font: 400 var(--sq-step-0)/1.5 var(--sq-font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
.sq img, .sq svg { display: block; max-width: 100%; }
.sq a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.sq a:hover { color: var(--sq-violet-deep); }
.sq :focus-visible { outline: 3px solid var(--sq-focus); outline-offset: 3px; }
.sq ::selection { background: var(--sq-violet); color: var(--sq-lilac); }
.sq-skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--sq-violet); color: var(--sq-lilac); padding: 12px 16px; }
.sq-skip:focus { left: 16px; top: 16px; }
.sq-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Fields (backgrounds) ---------- */
.sq-field-home   { background: var(--sq-lilac); color: var(--sq-violet); }
.sq-field-night  { background: var(--sq-violet); color: var(--sq-lilac); }
.sq-field-paper  { background: var(--sq-cream); color: var(--sq-violet); }
.sq-field-lime   { background: var(--sq-lime); color: var(--sq-violet); }
.sq-field-pink   { background: var(--sq-pink); color: var(--sq-violet); }
.sq-field-night a:hover { color: var(--sq-cream); }

/* ---------- Layout ---------- */
.sq-wrap { width: min(100% - 2 * var(--sq-gutter), var(--sq-max)); margin-inline: auto; }
.sq-section { padding-block: var(--sq-space-9); }
.sq-section + .sq-section { border-top: var(--sq-rule) solid currentColor; }
.sq-grid { display: grid; gap: var(--sq-space-6); }
.sq-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

/* ---------- Type ---------- */
.sq-loud {
  font-family: var(--sq-font-loud);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.012em;
  line-height: 0.96;
  margin: 0;
}
.sq-display { font-size: var(--sq-step-5); }
.sq-h1 { font-size: var(--sq-step-4); }
.sq-h2 { font-size: var(--sq-step-3); }
.sq-h3 { font-size: var(--sq-step-1); line-height: 1.1; }
.sq-warm {
  font-family: var(--sq-font-warm);
  font-style: italic;
  font-weight: 700;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  text-transform: none;
  letter-spacing: 0;
}
.sq-mark { font-family: var(--sq-font-mark); font-weight: 400; }
.sq-kicker {
  font: 600 var(--sq-step--1)/1.2 var(--sq-font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
}
.sq-lead { font-size: var(--sq-step-1); line-height: 1.42; max-width: 46ch; }
.sq-body { max-width: 62ch; }
.sq-small { font-size: var(--sq-step--1); }

/* ---------- Buttons ----------
   Selectors are prefixed with .sq so they win over `.sq a { color: inherit }`. */
.sq .sq-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  font: 700 var(--sq-step--1)/1 var(--sq-font-body);
  letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  border: var(--sq-hair) solid var(--sq-violet);
  border-radius: var(--sq-radius);
  background: var(--sq-violet); color: var(--sq-lilac);
  cursor: pointer;
  transition: transform .18s var(--sq-ease), background-color .18s, color .18s;
}
.sq .sq-btn:hover { background: var(--sq-violet-deep); color: var(--sq-lilac); transform: translateY(-2px); }
.sq .sq-btn:active { transform: translateY(0); }
.sq .sq-btn-ghost { background: transparent; color: var(--sq-violet); }
.sq .sq-btn-ghost:hover { background: var(--sq-violet); color: var(--sq-lilac); }
.sq .sq-field-night .sq-btn { background: var(--sq-lilac); color: var(--sq-violet); border-color: var(--sq-lilac); }
.sq .sq-field-night .sq-btn:hover { background: var(--sq-cream); color: var(--sq-violet); }
.sq .sq-field-night .sq-btn-ghost { background: transparent; color: var(--sq-lilac); }
.sq .sq-field-night .sq-btn-ghost:hover { background: var(--sq-lilac); color: var(--sq-violet); }
/* No poppy button: poppy behind small text fails contrast (3.2 to 1). Poppy stays a mark. */

/* ---------- Cards, tags, chips ---------- */
.sq-card {
  background: var(--sq-surface);
  border: var(--sq-hair) solid var(--sq-line);
  border-radius: var(--sq-radius);
  padding: var(--sq-space-5);
}
.sq-card-paper { background: var(--sq-paper); }
.sq-rule-top { border-top: var(--sq-rule) solid currentColor; padding-top: var(--sq-space-3); }
.sq-hair-top { border-top: var(--sq-hair) solid currentColor; padding-top: var(--sq-space-3); }
.sq-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: var(--sq-hair) solid currentColor; border-radius: var(--sq-radius-pill);
  font: 600 var(--sq-step--1)/1 var(--sq-font-body); letter-spacing: .06em; text-transform: uppercase;
}
.sq-hemtag { /* the little poppy tag at the hem: decorative */
  display: inline-block; width: 44px; height: 12px; background: var(--sq-poppy);
}

/* ---------- Forms ---------- */
.sq-label { display: block; font: 700 var(--sq-step--1)/1.2 var(--sq-font-body); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }
.sq-input, .sq-textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  font: 400 var(--sq-step-0)/1.4 var(--sq-font-body); color: var(--sq-violet);
  background: var(--sq-cream-soft); border: var(--sq-hair) solid var(--sq-violet); border-radius: var(--sq-radius);
}
.sq-textarea { min-height: 110px; resize: vertical; }
.sq-input::placeholder, .sq-textarea::placeholder { color: var(--sq-violet-muted); }
.sq-field-night .sq-input, .sq-field-night .sq-textarea { border-color: var(--sq-lilac); }

/* ---------- Logo ---------- */
.sq-logo { display: inline-block; line-height: 0; }
.sq-logo img { height: 44px; width: auto; }
.sq-logo-lg img { height: auto; width: min(100%, 520px); }

/* ---------- Header / footer ---------- */
.sq-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--sq-lilac) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: var(--sq-hair) solid var(--sq-violet);
}
.sq-header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sq-space-5); min-height: 72px; }
.sq-nav { display: flex; align-items: center; gap: var(--sq-space-5); flex-wrap: wrap; }
.sq-nav a { font: 600 var(--sq-step--1)/1 var(--sq-font-body); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; padding: 12px 0; }
.sq-nav a:hover { text-decoration: underline; }
.sq-footer { padding-block: var(--sq-space-7); }
.sq-footer-inner { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sq-space-5); flex-wrap: wrap; }

@media (max-width: 760px) {
  .sq-nav .sq-nav-text { display: none; }
  .sq-logo img { height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .sq *, .sq *::before, .sq *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
