/* THE SITE'S PAGE CSS, IN ONE FILE.
 *
 * It used to be pasted inline into every page, which worked until a page was built from a
 * different template: the seventy pages under /lines/ carried a product-detail block instead and
 * never defined .hero-copy, .cat-head, .prose, .onward, .links, .btn-primary or .toast. Inside a
 * twelve-column .grid an undefined child takes ONE column, so the hero on /lines/ came out about
 * fifty pixels wide and wrapped one word per line. Nothing 404'd and no rule was wrong; the rule
 * simply was not there, which is why the markup gate passed it.
 *
 * Everything here is in @layer components, so a page that needs its own version of a name -- the
 * size chips on a product page are not the jump chips on an index -- overrides it simply by
 * declaring it unlayered in its own <style>, with no specificity fight.
 *
 * Lifted verbatim from products/index.html, which was the most complete copy.
 */
/* SCOPED TO THE ELEMENT THEY WERE WRITTEN FOR.
 *
 * Two names are used twice on this site for two different things, and this file is shared now:
 * `spec` is a <dl> of key/value pairs on an index page and a <table> of sizes on a product page,
 * and `chips` is a <nav> of jump links on one and a <div> of size buttons on the other. The <dl>
 * rule sets display:grid; the table's own rule never sets display, so the grid came through and
 * turned <thead> and <tbody> into two columns side by side. Naming the element in the selector
 * is enough -- neither page has to change, and a third use of the name cannot be caught by it.
 */
@layer components {
  h1,h2,h3,h4,.wordmark{font-weight:var(--w-display);font-variation-settings:var(--vf-display)}

  .wordmark{font-family:var(--font-display);font-size:var(--t-h4);line-height:var(--lh-h4);
            letter-spacing:0.01em;text-decoration:none;color:var(--ink)}
  .wordmark span{color:var(--ink-3);font-weight:var(--w-regular)}

  .hero{padding-block:var(--sp-8) var(--sp-6)}
  .hero-copy{grid-column:1/-1}
  @media(min-width:1024px){.hero-copy{grid-column:1/9}}
  .slogan{font-family:var(--font-display);font-variation-settings:var(--vf-display);
          font-size:var(--t-h4);line-height:var(--lh-h4);color:var(--accent);letter-spacing:0.01em}
  .crumb{font-size:var(--t-caption);color:var(--ink-3)}
  .crumb a{color:var(--ink-2)}
  .hero h1{margin-top:var(--sp-4);max-width:20ch}
  .hero p.sub{margin-top:var(--sp-5);color:var(--ink-2);max-width:54ch}

  /* The jump row. Chips wrap; nothing in here is nowrap except a chip itself,
     which is two or three words and narrower than a 320px viewport. */
  nav.chips{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:var(--sp-3);margin-top:var(--sp-7)}
  nav.chips a{font-size:var(--t-caption);letter-spacing:0.04em;color:var(--ink-2);
           text-decoration:none;border:1px solid var(--rule);border-radius:var(--r-pill);
           padding:var(--sp-2) var(--sp-4);
           transition:border-color var(--dur-1) var(--ease-standard),color var(--dur-1) var(--ease-standard)}
  nav.chips a:hover{border-color:var(--ink-4);color:var(--accent)}

  /* THE HOUSE .grid SETS column-gap ONLY, so two full-width children touch at zero.
     A section heading whose block is just an <h2> then sits directly on the cards
     below it, and the display face's descenders -- the g in "In the range" -- paint
     outside their line box and land inside the first card. The space belongs to the
     heading rather than to the grid: a cat-head that carries a paragraph got its gap
     from the paragraph by accident, and one that does not got none at all. */
  .cat-head{grid-column:1/-1;max-width:var(--max-text);margin-bottom:var(--sp-6)}
  .cat-head h2{margin-top:var(--sp-3);max-width:22ch}
  .cat-head p{margin-top:var(--sp-4);color:var(--ink-2)}
  .sub-head{grid-column:1/-1;max-width:var(--max-text);margin-top:var(--sp-8)}
  .sub-head h3{font-size:var(--t-h4);line-height:var(--lh-h4)}
  .sub-head p{margin-top:var(--sp-3);color:var(--ink-2);font-size:var(--t-sm);line-height:1.6rem}

  /* The index is a grid of invitations. min() on the floor: a fixed 260px track cannot
     shrink inside a 320px viewport. */
  .cards{grid-column:1/-1;display:grid;gap:var(--sp-7) var(--gutter);margin-top:var(--sp-7);
         grid-template-columns:repeat(auto-fill,minmax(min(260px,100%),1fr))}
  .card{display:flex;flex-direction:column;min-width:0}
  /* position:relative is load-bearing. The shared .ph placeholder is position:absolute;
     inset:0, drawn for the banner, and in a frame that is not a containing block it escapes
     to the viewport and covers the whole page. It did, once. */
  .card .frame{display:block;position:relative;border:1px solid var(--rule);
               border-radius:var(--r-2);overflow:hidden;aspect-ratio:4/3}
  .card .frame img{width:100%;height:100%;object-fit:cover;display:block}
  .card-copy{padding-top:var(--sp-4);min-width:0}
  .card h3{font-size:var(--t-h4);line-height:var(--lh-h4)}
  .card h3 a{color:var(--ink);text-decoration:none}
  .card h3 a:hover{color:var(--accent)}
  .card .why{margin-top:var(--sp-4);color:var(--ink-2);font-size:var(--t-sm);line-height:1.6rem}
  .card .dims{margin-top:var(--sp-3);color:var(--ink-3);font-size:var(--t-caption);line-height:1.45rem}
  .card-cta{margin-top:var(--sp-4)}

  /* A card whose picture is a pot rather than a scene. The renders are 4:5 on a plain
     ground, so the frame is 4:5 too and object-fit:cover never has anything to crop --
     which is what makes a grid of them read as one collection rather than a search result. */
  .card-tall .frame{aspect-ratio:4/5}

  /* ---------------------------------------------------------------- the design-line banner
     It is a SCROLLER. The track snaps and swipes with no script at all, and the script drives
     the same scroll position rather than hiding and revealing slides, so every line is in the
     document and reachable however you are reading. flex:0 0 100% on a track that is itself
     overflow-x:auto keeps the whole thing inside a 320px viewport: the scrolling happens in
     the track, never on the page. */
  .banner{grid-column:1/-1;min-width:0;position:relative;margin-top:var(--sp-7)}
  .btrack{display:flex;gap:var(--gutter);margin:0;padding:0;list-style:none;min-width:0;
          overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;
          scrollbar-width:none}
  .btrack::-webkit-scrollbar{display:none}
  .btrack:focus-visible{outline:2px solid var(--accent);outline-offset:6px;border-radius:var(--r-2)}
  .bslide{flex:0 0 100%;min-width:0;scroll-snap-align:start;display:grid;gap:var(--sp-5);
          align-content:start}
  @media(min-width:760px){
    .bslide{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--sp-8);
            align-items:center;align-content:center}
  }
  .bmedia{position:relative;min-width:0;overflow:hidden;aspect-ratio:1;
          border-radius:var(--r-3)}
  .bshot{display:block;position:absolute;inset:0;min-width:0;overflow:hidden;
         border:1px solid var(--rule);border-radius:inherit;background:var(--surface)}
  .bshot img{width:100%;height:100%;object-fit:cover;display:block}
  .bcopy{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;
         grid-template-areas:"label label" "title cta" "tag tag";
         align-items:center;gap:var(--sp-3) var(--sp-4)}
  .bcopy>.label{grid-area:label}
  .bcopy h3{grid-area:title;margin:0;font-size:var(--t-h3);line-height:var(--lh-h3);max-width:14ch}
  .bcopy h3 a{color:var(--ink);text-decoration:none}
  .bcopy h3 a:hover{color:var(--accent)}
  .bcopy .btag{grid-area:tag;margin:0;color:var(--ink-2);max-width:40ch}
  .bcta{grid-area:cta;margin:0}
  .bcta .btn{padding:var(--sp-3) var(--sp-5);white-space:nowrap}
  @media(min-width:760px){
    .bcopy{display:block}
    .bcopy h3{margin-top:var(--sp-3)}
    .bcopy .btag{margin-top:var(--sp-4)}
    .bcta{margin-top:var(--sp-6)}
  }
  /* Built by the script, so nothing dead is ever on the page. */
  .bctl{position:absolute;z-index:2;
        display:flex;align-items:center;flex-wrap:nowrap;gap:6px;padding:6px;
        border:1px solid color-mix(in oklab,var(--rule) 72%,transparent);
        border-radius:var(--r-pill);background:color-mix(in oklab,var(--surface-2) 88%,transparent);
        box-shadow:0 8px 28px rgba(30,29,24,.12);backdrop-filter:blur(12px)}
  .bnav,.bplay{display:inline-flex;align-items:center;justify-content:center;width:32px;
               height:32px;flex:0 0 32px;padding:0;border:1px solid var(--rule);border-radius:50%;
               background:var(--surface-2);color:var(--ink-2);font:inherit;font-size:var(--t-sm);
               line-height:1;cursor:pointer;
               transition:border-color var(--dur-1) var(--ease-standard),
                          color var(--dur-1) var(--ease-standard)}
  .bnav:hover,.bplay:hover{border-color:var(--ink-4);color:var(--accent)}
  .bdots{display:flex;flex:1;min-width:0;align-items:center;gap:2px;margin:0;padding:0;list-style:none}
  .bdots li{display:flex;flex:1;min-width:0}
  .bdot{display:block;width:100%;height:32px;padding:0;border:0;background:transparent;
        cursor:pointer;position:relative}
  .bdot::after{content:"";position:absolute;inset:15px 1px auto;height:2px;
               background:var(--ink-4);transition:background var(--dur-1) var(--ease-standard)}
  .bdot:hover::after{background:var(--ink-2)}
  .bdot[aria-current=true]::after{background:var(--accent)}
  .bdot:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:var(--r-1)}
  @media(hover:hover) and (pointer:fine){
    .bctl{opacity:0;transform:translateY(4px);transition:opacity var(--dur-1) var(--ease-standard),
          transform var(--dur-1) var(--ease-standard)}
    .banner:has(.bmedia:hover)>.bctl,.banner>.bctl:hover,.banner>.bctl:focus-within{
      opacity:1;transform:none
    }
  }

  .sku{margin-top:var(--sp-3)}
  .code{display:inline-block;font-family:var(--font-mono);font-size:var(--t-caption);
        letter-spacing:0.08em;border:1px solid var(--rule);border-radius:var(--r-1);
        background:transparent;color:var(--ink-2);padding:var(--sp-2) var(--sp-4);
        transition:border-color var(--dur-1) var(--ease-standard)}
  button.code{cursor:pointer}
  .code:hover{border-color:var(--ink-4)}

  /* The product page. The slider is the showcase, so it gets the hero's other half. */
  .prod-media{grid-column:1/-1;min-width:0;margin-top:var(--sp-6)}
  @media(min-width:1024px){
    .hero-copy{grid-column:1/6}
    .prod-media{grid-column:6/13;margin-top:0}
  }

  .make{grid-column:1/-1;max-width:var(--max-text);border:1px solid var(--rule);
        border-radius:var(--r-2);padding:var(--sp-6)}
  .make h2{margin-top:var(--sp-3);max-width:24ch}
  .make p{margin-top:var(--sp-4);color:var(--ink-2)}
  .make-cta{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sp-4);margin-top:var(--sp-6)}
  .plain{font-size:var(--t-caption);letter-spacing:0.04em;color:var(--ink-2)}

  .prose{grid-column:1/-1;max-width:var(--max-text)}
  .prose h2{max-width:26ch}
  .prose h2.second{margin-top:var(--sp-8)}
  .prose p{margin-top:var(--sp-4);color:var(--ink-2)}
  .prose .fine{margin-top:var(--sp-5);font-size:var(--t-caption);line-height:1.5rem;color:var(--ink-3)}
  ul.links{margin-top:var(--sp-4);padding:0;list-style:none}
  ul.links li{border-top:1px solid var(--rule);padding:var(--sp-4) 0}
  ul.links li span{display:block;margin-top:var(--sp-2);font-size:var(--t-caption);
                   line-height:1.45rem;color:var(--ink-3)}

  dl.spec{display:grid;grid-template-columns:auto 1fr;gap:var(--sp-3) var(--sp-5);
        margin-top:var(--sp-6);font-size:var(--t-caption);line-height:1.45rem}
  dl.spec dt{font-family:var(--font-mono);font-size:10px;letter-spacing:0.06em;
           text-transform:uppercase;color:var(--ink-3)}
  dl.spec dd{margin:0;color:var(--ink-2)}
  .fit{display:grid;gap:var(--sp-5) var(--gutter);margin-top:var(--sp-6);
       grid-template-columns:repeat(auto-fit,minmax(min(200px,100%),1fr))}
  .fit ul{margin:var(--sp-3) 0 0;padding-left:1.1em;font-size:var(--t-caption);
          line-height:1.5rem;color:var(--ink-2)}
  .label{font-size:var(--t-micro);line-height:var(--lh-micro);letter-spacing:0.16em;
         text-transform:uppercase;color:var(--ink-3);font-weight:var(--w-medium)}

  .btn{display:inline-flex;align-items:center;border:1px solid var(--rule);background:transparent;
       color:var(--ink);font:inherit;font-size:var(--t-caption);letter-spacing:0.12em;
       padding:calc(var(--sp-3) + 1px) var(--sp-6) var(--sp-3);border-radius:var(--r-pill);
       text-decoration:none;cursor:pointer}
  .btn-primary{background:var(--fill);border-color:var(--fill);color:var(--on-fill)}
  .btn-primary:hover{background:var(--fill-h);border-color:var(--fill-h);color:var(--on-fill-h)}

  .ending{grid-column:1/-1;max-width:var(--max-text);margin-top:var(--sp-9)}
  .ending h2{max-width:24ch}
  .ending p{margin-top:var(--sp-4);color:var(--ink-2)}

  .toast{position:fixed;left:50%;bottom:var(--sp-7);translate:-50% 0;background:var(--surface-inv);
         color:var(--on-fill-h);padding:var(--sp-3) var(--sp-5);border-radius:var(--r-pill);
         font-size:var(--t-sm);opacity:0;pointer-events:none;
         transition:opacity var(--dur-2) var(--ease-out)}
  .toast[data-on]{opacity:1}

  /* THE COLOURS WE PRINT IN. Generated from stock.json by build-colours.py, so a filament that
     runs out is one edit to a JSON file and a rebuild -- nothing about availability lives here.
     Grouped by what is on the shelf, because a visitor choosing a colour is really asking how
     soon they can have it. */
  .swatches{grid-column:1/-1;margin-top:var(--sp-7);display:grid;gap:var(--sp-7)}
  .sw-group{min-width:0}
  .sw-head{font-size:var(--t-caption);letter-spacing:.06em;text-transform:uppercase;
           color:var(--ink);margin:0 0 var(--sp-4)}
  .sw-head span{display:block;margin-top:var(--sp-1);letter-spacing:0;text-transform:none;
                color:var(--ink-3)}
  .sw-list{list-style:none;margin:0;padding:0;display:grid;gap:var(--sp-5) var(--gutter);
           grid-template-columns:repeat(auto-fill,minmax(min(132px,100%),1fr))}
  .sw-item{min-width:0;display:flex;flex-direction:column;gap:var(--sp-2)}
  /* A ring rather than a bare square: the palest filaments are near-white and a white chip on a
     white page is not a swatch. */
  .sw-chip{display:block;aspect-ratio:1;border-radius:var(--r-2);background:var(--c);
           border:1px solid var(--rule);box-shadow:inset 0 -12px 20px -14px rgba(34,39,27,.35)}
  .sw-item b{font-size:var(--t-sm);font-weight:var(--w-medium);color:var(--ink)}
  .sw-series{font-size:var(--t-caption);line-height:1.4;color:var(--ink-3)}
}
