/* ==========================================================================
   Kasbah Brass — design tokens
   Direction A: "Gallery". Warm near-black ground, brass as the only colour,
   editorial asymmetric grid. Built to make a $200 hook feel inevitable.
   ========================================================================== */

/* ── Theme: Sage (light) / Olive (dark) ───────────────────────────────
   Light is the default. Dark applies when the OS asks for it, unless the
   visitor has explicitly chosen light; the [data-theme] blocks let the
   toggle override in both directions. Only tokens are redefined here —
   no component ever hard-codes a colour.                                */
:root{
  --ink-900:#E7EAE3; --ink-850:#E1E5D9; --ink-800:#D9DED1; --ink-700:#D0D6C7;
  --ink-600:#BCC4B1; --line:#CCD3C2;    --line-2:#AAB49D;
  --paper:#15180F;   --paper-dim:#505646; --paper-faint:#7A8070;
  --brass:#846518;   --brass-bright:#A5812C; --brass-deep:#634B12;
  --patina:#5E7158;
  --scrim:rgba(231,234,227,.94);
  --gold:#8A6A22;    --green:#5E7158;
  color-scheme:light;

  /* --- type --- */
  --display:'Zodiak','Hoefler Text',Georgia,'Times New Roman',serif;
  --body:'Switzer',-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;

  --step--1:clamp(.78rem,.76rem + .1vw,.84rem);
  --step-0: clamp(.95rem,.92rem + .16vw,1.05rem);
  --step-1: clamp(1.15rem,1.05rem + .5vw,1.4rem);
  --step-2: clamp(1.5rem,1.25rem + 1.2vw,2.2rem);
  --step-3: clamp(2.1rem,1.5rem + 2.8vw,3.8rem);
  --step-4: clamp(2.8rem,1.6rem + 5.6vw,6.4rem);

  /* --- rhythm --- */
  --gutter:clamp(1.25rem,4vw,5rem);
  --bay:clamp(4.5rem,9vw,10rem);   /* vertical section spacing */
  --maxw:1560px;
  --measure:62ch;

  --ease:cubic-bezier(.22,.61,.36,1);
}

/* ── type on a large screen ───────────────────────────────────────────
   Every step above hit its ceiling at about 1371px, so the headline was
   102px on a 13" laptop and the same 102px on a 27" monitor — which is
   why the page read as a laptop layout centred on a big screen rather
   than as something built for it.

   These take over only above 1440px and start exactly where the clamps
   above stop, so nothing below that width moves by a pixel. Each is
   `clamp(<the old ceiling>, A + Bvw, <new ceiling>)`, with A and B
   solved so the value at 1440px is unchanged.

   Body and UI text barely grow — line length is governed by --measure,
   and 62ch of 18px is already a long line. The display steps carry the
   scale, because that is what reads as "made for this screen". */
@media (min-width:1440px){
  :root{
    --step--1:clamp(.84rem,.79rem + .035vw,.9rem);
    --step-0: clamp(1.05rem,.92rem + .14vw,1.15rem);
    --step-1: clamp(1.4rem,1.14rem + .29vw,1.6rem);
    --step-2: clamp(2.2rem,1.56rem + .71vw,2.7rem);
    --step-3: clamp(3.8rem,2.39rem + 1.57vw,4.9rem);
    --step-4: clamp(6.4rem,3.57rem + 3.14vw,8.6rem);
  }
}


/* dark values, defined once and applied twice */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --ink-900:#0D1110; --ink-850:#111614; --ink-800:#161C19; --ink-700:#1E2622;
    --ink-600:#2A332D; --line:#2C3832;    --line-2:#3E4C43;
    --paper:#EFF0E7;   --paper-dim:#A6AC9C; --paper-faint:#6E7568;
    --brass:#C9A144;   --brass-bright:#E8CB84; --brass-deep:#8C6B26;
    --patina:#7D9176;
    --scrim:rgba(13,17,16,.93);
    --gold:#C9A144;    --green:#8FA287;
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --ink-900:#0D1110; --ink-850:#111614; --ink-800:#161C19; --ink-700:#1E2622;
  --ink-600:#2A332D; --line:#2C3832;    --line-2:#3E4C43;
  --paper:#EFF0E7;   --paper-dim:#A6AC9C; --paper-faint:#6E7568;
  --brass:#C9A144;   --brass-bright:#E8CB84; --brass-deep:#8C6B26;
  --patina:#7D9176;
  --scrim:rgba(13,17,16,.93);
  --gold:#C9A144;    --green:#8FA287;
  color-scheme:dark;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:var(--ink-900);
  color:var(--paper);
  font-family:var(--body);
  font-size:var(--step-0);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
img{max-width:100%;display:block}
h1,h2,h3,h4{margin:0;font-family:var(--display);font-weight:400;line-height:1.02;letter-spacing:-.018em;text-wrap:balance}
p{margin:0}
a{color:inherit;text-decoration:none}

/* --- shared primitives --- */
.shell{max-width:var(--maxw);margin-inline:auto;padding-inline:var(--gutter)}
.bay{padding-block:var(--bay)}

.eyebrow{
  font-size:var(--step--1);
  letter-spacing:.22em;
  text-transform:uppercase;
  color:var(--brass);
  font-weight:500;
}
.lede{color:var(--paper-dim);max-width:var(--measure);font-size:var(--step-1);line-height:1.5}
.rule{height:1px;background:var(--line);border:0;margin:0}

.btn{
  display:inline-flex;align-items:center;gap:.7em;
  padding:1.05em 2.1em;
  border:1px solid var(--brass);
  color:var(--brass);
  font-size:var(--step--1);
  letter-spacing:.14em;text-transform:uppercase;font-weight:500;
  background:transparent;cursor:pointer;
  transition:color .5s var(--ease),background .5s var(--ease);
  position:relative;overflow:hidden;
}
.btn::after{
  content:"";position:absolute;inset:0;background:var(--brass);
  transform:scaleX(0);transform-origin:left;z-index:-1;
  transition:transform .55s var(--ease);
}
.btn:hover{color:var(--ink-900)}
.btn:hover::after{transform:scaleX(1)}
.btn:focus-visible{outline:2px solid var(--brass-bright);outline-offset:3px}

/* reveal-on-scroll — resting state is VISIBLE, animation is an enhancement */
.reveal{opacity:1;transform:none}
@media (prefers-reduced-motion:no-preference){
  .js .reveal{opacity:0;transform:translateY(22px);transition:opacity .9s var(--ease),transform .9s var(--ease)}
  .js .reveal.in{opacity:1;transform:none}
}


/* ── currency switcher ────────────────────────────────────────────────
   Lives here, not in store.css: the home and workshop pages never load
   store.css, so the control sat in the masthead completely unstyled —
   a raw browser select with its label showing.
   Display only; the store charges USD, which .cur-note says wherever a
   converted price appears. */
.u-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip-path:inset(50%);white-space:nowrap;border:0}

.cursel{position:relative;display:inline-flex;align-items:center}
.cursel__in{appearance:none;-webkit-appearance:none;-moz-appearance:none;
  background:none;border:0;border-radius:0;margin:0;cursor:pointer;
  padding:.4rem 1.05rem .4rem 0;line-height:1;
  color:var(--paper-dim);font-family:var(--body);font-size:var(--step--1);
  letter-spacing:.13em;text-transform:uppercase;
  transition:color .3s var(--ease)}
.cursel__in::-ms-expand{display:none}
/* the caret, drawn so it inherits the type colour instead of the OS one */
.cursel::after{content:"";position:absolute;right:.1rem;top:50%;
  width:.34em;height:.34em;margin-top:-.26em;pointer-events:none;
  border-right:1px solid currentColor;border-bottom:1px solid currentColor;
  rotate:45deg;color:var(--paper-faint);transition:color .3s var(--ease)}
.cursel:hover .cursel__in,.cursel:hover::after{color:var(--brass)}
.cursel__in:focus-visible{outline:2px solid var(--brass);outline-offset:3px}
/* the open list is drawn by the OS; this is as far as styling reaches */
.cursel__in option{background:var(--ink-900);color:var(--paper);letter-spacing:0}

.cur-note{margin:-.35rem 0 0;font-family:var(--body);font-size:var(--step--1);
  color:var(--paper-faint);letter-spacing:.02em}
.cur-note[hidden]{display:none}

/* ── the masthead on a narrow phone ───────────────────────────────────
   Wordmark 191px + the right-hand group 146px is 17px MORE than a 320px
   screen has. Nothing overflows, because flex squeezes it, but it reads
   as cramped. The wordmark's own .34em tracking is most of its width, so
   tightening that buys the room back before anything has to be hidden. */
/* The language control added ~60px to the right-hand group, which left
   7px of clearance at 360px and 22px at 430px — not overflowing, but
   visibly touching. The wordmark's tracking is the cheapest thing to give
   back, so it tightens earlier now. */
@media(max-width:520px){
  .masthead .wordmark__txt{font-size:.68rem;letter-spacing:.17em}
  .masthead .wordmark{gap:.5em}
  .masthead__right{gap:.95rem}
  .cursel__in{padding-right:.9rem;letter-spacing:.08em}
}
/* below this the mark carries the name on its own, and the controls get
   the whole right half to themselves */
@media(max-width:385px){
  .masthead .wordmark__txt{display:none}
}

/* ── language switcher ────────────────────────────────────────────────
   Shares .cursel's look so the two controls read as one pair. A hairline
   between them stops "EN USD" running together as one word. */
.langsel__in{appearance:none;-webkit-appearance:none;-moz-appearance:none;
  background:none;border:0;border-radius:0;margin:0;cursor:pointer;
  padding:.4rem 1.05rem .4rem 0;line-height:1;
  color:var(--paper-dim);font-family:var(--body);font-size:var(--step--1);
  letter-spacing:.13em;text-transform:uppercase;
  transition:color .3s var(--ease)}
.langsel__in::-ms-expand{display:none}
.langsel:hover .langsel__in,.langsel:hover::after{color:var(--brass)}
.langsel__in:focus-visible{outline:2px solid var(--brass);outline-offset:3px}
.langsel__in option{background:var(--ink-900);color:var(--paper);letter-spacing:0}
/* No separator between EN and USD. The rule that drew one also padded the
   label, and .cursel's caret is positioned from the label's right edge —
   so the caret detached from "EN" and floated against the divider. The
   masthead's own gap already keeps the two controls apart. */

@media(max-width:420px){
  .langsel__in{padding-right:.9rem;letter-spacing:.08em}
}
