/* ============================================================
   Hamza Industries — Design System
   Palette derived from the company logo:
     orange #F07E00 (monogram) · navy #00306F (wordmark)
   Ground is a warm, hide-toned paper rather than sterile white,
   as a nod to untreated leather.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Serif:ital,wght@0,300;0,400;0,600;1,300&display=swap');

:root {
  /* Brand */
  --navy:        #00306F;
  --navy-deep:   #001B3F;
  --navy-soft:   #0A4488;
  --orange:      #F07E00;
  --orange-dark: #A34F00;

  /* Ground + ink */
  --paper:       #FAF7F2;
  --paper-2:     #F1EBE1;
  --paper-3:     #E5DCCD;
  --ink:         #0F1B2A;
  --ink-muted:   #55606E;
  --ink-faint:   #5E6876;
  --white:       #FFFFFF;
  --line:        #DDD4C6;
  --line-dark:   rgba(255,255,255,.16);

  /* Fluid type scale */
  --t--1: clamp(0.8125rem, 0.79rem + 0.11vw, 0.875rem);
  --t-0:  clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --t-1:  clamp(1.125rem, 1.06rem + 0.32vw, 1.3125rem);
  --t-2:  clamp(1.375rem, 1.24rem + 0.68vw, 1.75rem);
  --t-3:  clamp(1.75rem, 1.47rem + 1.4vw, 2.5rem);
  --t-4:  clamp(2.25rem, 1.7rem + 2.7vw, 3.75rem);
  --t-5:  clamp(2.375rem, 1.35rem + 5.1vw, 6rem);

  /* Spacious rhythm */
  --s-1: 0.5rem;  --s-2: 1rem;   --s-3: 1.5rem;  --s-4: 2rem;
  --s-5: 3rem;    --s-6: 4rem;   --s-7: 6rem;    --s-8: 8rem;
  --s-9: 10rem;

  --wrap: 1120px;
  --wrap-narrow: 720px;
  --radius: 14px;
  --radius-lg: 22px;

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

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--t-0);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.012em;
  margin: 0 0 var(--s-3);
  text-wrap: balance;
}
h1 { font-size: var(--t-5); }
h2 { font-size: var(--t-4); }
h3 { font-size: var(--t-2); }
h4 { font-size: var(--t-1); }
p  { margin: 0 0 var(--s-3); max-width: 68ch; }

a { color: var(--navy); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--orange-dark); }

/* Focus — never removed, always visible */
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-dark :focus-visible { outline-color: var(--orange); }

.skip-link {
  position: absolute; left: var(--s-2); top: -100px; z-index: 200;
  background: var(--navy); color: #fff; padding: .75rem 1.25rem;
  border-radius: 0 0 var(--radius) var(--radius); font-weight: 600;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------- Layout ---------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, var(--wrap-narrow)); margin-inline: auto; }
.section { padding-block: clamp(4rem, 9vw, 9rem); }
.section-tight { padding-block: clamp(3rem, 6vw, 5.5rem); }

.on-dark { background: var(--navy-deep); color: #EAF0F8; }
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4,
.on-navy h1, .on-navy h2, .on-navy h3, .on-navy h4 { color: #fff; }
.on-dark a, .on-navy a { color: #fff; }
.on-dark .eyebrow, .on-navy .eyebrow { color: var(--orange); }
.on-dark .lede, .on-dark .muted,
.on-navy .lede, .on-navy .muted { color: #C6D3E6; }
.on-navy { background: var(--navy); color: #EAF0F8; }
.on-paper-2 { background: var(--paper-2); }

.eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: var(--t--1);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--orange-dark);
  margin: 0 0 var(--s-3);
  display: block;
}
.lede { font-size: var(--t-1); color: var(--ink-muted); line-height: 1.55; max-width: 60ch; }
.muted { color: var(--ink-muted); }
.center { text-align: center; }
.center p, .center .lede { margin-inline: auto; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.on-dark .rule, .on-navy .rule { background: var(--line-dark); }

/* ---------- Buttons ----------
   Note: brand orange (#F07E00) is only 2.7:1 against white, so it never
   carries white text. Orange fills take navy text (4.65:1); on dark
   grounds orange is used as text on navy (6.86:1).                     */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  min-height: 48px; padding: .75rem 1.65rem;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: var(--t-0); font-weight: 500; line-height: 1;
  border-radius: 999px; border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-soft); color: #fff; }
.btn-accent { background: var(--orange); color: var(--navy-deep); font-weight: 600; }
.btn-accent:hover { background: #FF9422; color: var(--navy-deep); }
.btn-ghost { border-color: var(--navy); color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.on-dark .btn-ghost, .on-navy .btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.on-dark .btn-accent, .on-navy .btn-accent { color: var(--navy-deep); }
.on-dark .btn-accent:hover, .on-navy .btn-accent:hover { color: var(--navy-deep); }
.on-dark .btn-primary, .on-navy .btn-primary { color: #fff; }
.on-dark .btn-ghost:hover, .on-navy .btn-ghost:hover { background: #fff; color: var(--navy-deep); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.center .btn-row { justify-content: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,247,242,.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--navy); }
.brand img { width: 30px; height: 30px; }
.brand-name {
  font-family: 'IBM Plex Serif', serif; font-size: 1.0625rem;
  font-weight: 600; letter-spacing: .02em; color: var(--navy); line-height: 1;
}
.brand-name span {
  display: block; font-family: 'IBM Plex Mono', monospace;
  font-size: .5625rem; letter-spacing: .28em; font-weight: 400;
  color: var(--ink-faint); margin-top: 3px;
}
.nav-links { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.25rem); list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-size: .8125rem; font-weight: 500; letter-spacing: .04em;
  color: var(--ink); text-decoration: none; padding: .5rem 0;
  position: relative; white-space: nowrap;
  display: inline-flex; align-items: center; min-height: 34px;
}
.nav-links a:hover { color: var(--navy); }
.nav-links a[aria-current="page"] { color: var(--navy); }
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--orange); border-radius: 2px;
}
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 48px; height: 48px; align-items: center; justify-content: center;
  color: var(--navy); margin-right: -12px;
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; inset: 60px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: var(--s-2) 1.25rem var(--s-4);
    max-height: calc(100dvh - 60px); overflow-y: auto;
  }
  .nav-links[hidden] { display: none; }
  .nav-links a { padding: 1rem 0; font-size: 1.0625rem; border-bottom: 1px solid var(--line); }
  .nav-links a[aria-current="page"]::after { display: none; }
  .nav-links a[aria-current="page"] { color: var(--orange-dark); }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(4.5rem, 12vw, 9.5rem) clamp(3.5rem, 8vw, 7rem); text-align: center; position: relative; overflow: hidden; }
.hero h1 { max-width: 16ch; margin-inline: auto; }
.hero .lede { margin-inline: auto; margin-top: var(--s-4); }
.hero .btn-row { margin-top: var(--s-5); justify-content: center; }
.hero-figure { margin-top: clamp(3rem, 7vw, 5.5rem); }

/* Fine hairline grid — an engineering-drawing texture, no photography */
.grid-field {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(to right, rgba(0,48,111,.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,48,111,.10) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 20%, transparent 78%);
}
.hero > .wrap { position: relative; z-index: 1; }

/* ---------- Process line (signature element) ---------- */
.process { list-style: none; margin: 0; padding: 0; counter-reset: stage; }
@media (min-width: 900px) {
  .process { display: grid; grid-template-columns: repeat(var(--stages, 7), 1fr); gap: 0; position: relative; }
  .process::before {
    content: ""; position: absolute; left: 0; right: 0; top: 13px;
    height: 2px; background: linear-gradient(to right, var(--orange), rgba(240,126,0,.25));
  }
}
.stage { position: relative; padding: 0 0 0 2.25rem; margin-bottom: var(--s-4); }
.stage::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 4px var(--navy-deep);
}
@media (min-width: 900px) {
  .stage { padding: 2.75rem 1rem 0 0; margin-bottom: 0; }
  .stage::before { left: 0; top: 7px; }
}
.stage-n {
  font-family: 'IBM Plex Mono', monospace; font-size: .6875rem;
  letter-spacing: .18em; color: var(--orange); display: block; margin-bottom: .35rem;
}
.stage a { font-family: 'IBM Plex Serif', serif; font-size: var(--t-1); color: #fff; text-decoration: none; display: inline-block; }
@media (min-width: 900px) { .stage a { min-height: 2.4em; } }
.stage a:hover { color: var(--orange); }
.stage p { font-size: var(--t--1); color: #A9BAD2; margin: .5rem 0 0; max-width: 22ch; }

/* ---------- Stats ---------- */
.stats { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat-n {
  font-family: 'IBM Plex Serif', serif; font-size: var(--t-4);
  line-height: 1; color: var(--navy); display: block; letter-spacing: -0.02em;
}
.on-dark .stat-n, .on-navy .stat-n { color: var(--orange); }
.stat-l {
  font-family: 'IBM Plex Mono', monospace; font-size: var(--t--1);
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted);
  margin-top: var(--s-2); display: block; max-width: 24ch;
}
.on-dark .stat-l, .on-navy .stat-l { color: #C6D3E6; }

/* ---------- Tiles ---------- */
.tiles { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--s-4);
  min-height: 260px; overflow: hidden;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.tile:hover { border-color: var(--navy); transform: translateY(-3px); box-shadow: 0 14px 40px -22px rgba(0,48,111,.5); }
.tile:focus-within { border-color: var(--navy); }
.tile-n { font-family: 'IBM Plex Mono', monospace; font-size: .6875rem; letter-spacing: .18em; color: var(--orange-dark); }
.tile h2, .tile h3 { margin: var(--s-2) 0 var(--s-2); font-size: var(--t-2); }
.tile p { font-size: var(--t--1); color: var(--ink-muted); margin: 0; }
.tile .tile-link::after { content: ""; position: absolute; inset: 0; }
.tile-link { text-decoration: none; color: inherit; }
.tile-foot { margin-top: auto; padding-top: var(--s-3); display: flex; align-items: center; gap: .4rem;
  font-size: var(--t--1); font-weight: 500; color: var(--navy); }
.tile-count { font-family: 'IBM Plex Mono', monospace; color: var(--ink-faint); font-size: .75rem; }
.tile-bar { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--orange); opacity: 0; transition: opacity var(--dur) var(--ease); }
.tile:hover .tile-bar, .tile:focus-within .tile-bar { opacity: 1; }

/* ---------- Cards / prose blocks ---------- */
.blocks { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* Keep the mark / heading / body of every block in a row on shared baselines,
   however many lines each heading takes. Each block spans three parent rows and
   inherits them, so the paragraphs always start at the same height. */
@media (min-width: 700px) {
  @supports (grid-template-rows: subgrid) {
    .blocks > .block, .offices > .office {
      display: grid; grid-row: span 3; grid-template-rows: subgrid; gap: 0;
    }
  }
  /* Fallback for browsers without subgrid: reserve two lines for the heading. */
  @supports not (grid-template-rows: subgrid) {
    .block h2, .block h3, .office h2, .office h3 { min-height: 2.1em; }
  }
}

/* A line break that only takes effect once blocks are side by side. On a
   single-column phone layout it collapses and the heading wraps naturally. */
.wrap-lg { display: none; }
@media (min-width: 700px) { .wrap-lg { display: inline; } }
.block h2, .block h3 { font-size: var(--t-2); margin-bottom: var(--s-2); }
.block p { font-size: var(--t-0); color: var(--ink-muted); margin-bottom: 0; }
.block-mark { width: 34px; height: 3px; background: var(--orange); border-radius: 2px; margin-bottom: var(--s-3); }

/* ---------- Product list ---------- */
.plist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.plist li {
  padding: 1.1rem 0 1.1rem 3.25rem; border-bottom: 1px solid var(--line);
  position: relative; font-size: var(--t-0); max-width: 62ch;
}
.plist li strong { font-weight: 600; color: var(--navy); }
.plist li::before {
  content: counter(item, decimal-leading-zero); counter-increment: item;
  position: absolute; left: 0; top: 1.25rem;
  font-family: 'IBM Plex Mono', monospace; font-size: .75rem;
  color: var(--ink-faint); letter-spacing: .06em;
}
.plist { counter-reset: item; }

/* ---------- Pigment swatches ---------- */
.swatches { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); list-style: none; margin: 0; padding: 0; }
.swatch { border-radius: var(--radius); overflow: hidden; background: var(--white); border: 1px solid var(--line); }
.on-dark .swatch, .on-navy .swatch { background: rgba(255,255,255,.06); border-color: var(--line-dark); }
.swatch-chip { aspect-ratio: 3 / 2; display: block; }
.swatch-name {
  display: block; padding: .7rem .8rem;
  font-family: 'IBM Plex Mono', monospace; font-size: .6875rem;
  line-height: 1.4; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink);
}
.swatches-detail .swatch-name { padding-bottom: 0; }
.swatch-desc {
  display: block; padding: .35rem .8rem .8rem; font-size: .6875rem; line-height: 1.45;
  color: var(--ink-muted); font-family: 'IBM Plex Sans', sans-serif;
  letter-spacing: 0; text-transform: none;
}
.on-dark .swatch-desc, .on-navy .swatch-desc { color: #B9C7DB; }

/* Every swatch shares the grid's rows, so the chip, the product name and the
   description sit on the same baselines across a row however many lines a
   name happens to take. */
@supports (grid-template-rows: subgrid) {
  .swatches > .swatch { display: grid; grid-template-rows: subgrid; grid-row: span 2; }
  .swatches-detail > .swatch { grid-row: span 3; }
}
@supports not (grid-template-rows: subgrid) {
  .swatch-name { min-height: 2.8em; }
}
.on-dark .swatch-name, .on-navy .swatch-name { color: #EAF0F8; }

/* ---------- Contact ---------- */
.offices { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.office h2, .office h3 { font-size: var(--t-2); }
.office dl { margin: 0; display: grid; gap: var(--s-3); }
.office dt {
  font-family: 'IBM Plex Mono', monospace; font-size: .6875rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .3rem;
}
.office dd { margin: 0; font-size: var(--t-0); }
.office dd a { text-decoration: none; font-weight: 500;
  display: inline-flex; align-items: center; min-height: 26px; }
.office dd a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #C6D3E6; padding-block: var(--s-6) var(--s-4); }
.footer-top { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer img { width: 150px; }
.footer-h {
  font-family: 'IBM Plex Mono', monospace; font-size: .6875rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--orange);
  margin: 0 0 var(--s-3);
}
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem;
  font-size: var(--t--1); line-height: 1.55; }
.footer-list a { color: #C6D3E6; text-decoration: none; font-size: inherit;
  display: inline-flex; align-items: center; min-height: 26px; }
.footer-list a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  margin-top: var(--s-6); padding-top: var(--s-3); border-top: 1px solid var(--line-dark);
  display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: space-between;
  font-size: .75rem; color: #8FA3BF;
}

/* ---------- Page head ---------- */
.page-head { padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(2rem, 4vw, 3rem); }
.page-head h1 { font-size: var(--t-4); max-width: 18ch; }
.breadcrumb { font-family: 'IBM Plex Mono', monospace; font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: var(--s-3); color: var(--ink-faint); }
.breadcrumb a { color: var(--ink-muted); text-decoration: none;
  display: inline-block; padding-block: .3rem; }
.breadcrumb a:hover { color: var(--orange-dark); text-decoration: underline; }

/* ---------- Motion ---------- */
/* Content is visible by default. Only a page that has confirmed JS is running
   (html.js, set by an inline script in <head>) hides it to animate it in, so a
   JS failure can never leave the page blank. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 620ms var(--ease), transform 620ms var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal.is-in { opacity: 1; transform: none; transition: none; }
  .btn:hover, .tile:hover { transform: none; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================
   THE TRANSFORMATION — scroll-driven tannery sequence
   The hide on the left is a decorative SVG; every word of the
   sequence lives in normal flow on the right so it is readable
   and keyboard-reachable with or without the animation.
   ============================================================ */

:root { --leather-dyed: #7A4A28; }

.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.tannery {
  --hide: #8C7A66;      /* raw */
  --hair: .8;
  --grain: 0;
  padding-block: clamp(3rem, 6vw, 5rem) 0;
  position: relative;
}
.t-layout { display: grid; gap: 2rem; grid-template-columns: 1fr; }

/* ---- the hide ---- */
.t-visual { position: sticky; z-index: 2; }
.t-visual-inner { width: 100%; }
.hide {
  width: 100%; max-width: 460px; margin-inline: auto; display: block;
  filter: drop-shadow(0 22px 36px rgba(0,0,0,.5));
}
.hide-shadow { display: none; }
.hide-body  { fill: var(--hide); transition: fill 850ms var(--ease); }
.hide-edge  { fill: none; stroke: rgba(0,0,0,.28); stroke-width: 2.5; }
.hide-hair  {
  stroke: rgba(58,42,28,.55); stroke-width: 1.1; stroke-linecap: round;
  opacity: var(--hair); transition: opacity 700ms var(--ease);
}
.hide-grain { fill: rgba(0,0,0,.16); opacity: var(--grain); transition: opacity 700ms var(--ease); }
.hide-sheen { opacity: 0; transform: translateX(-460px) skewX(-12deg); }
/* The topcoat gleam is a single pass that finishes invisible, so it can never
   park a bright wedge on the leather. */
.tannery[data-stage="8"] .hide-sheen { animation: sweep 1600ms var(--ease) both; }
@keyframes sweep {
  from { transform: translateX(-460px) skewX(-12deg); opacity: 0; }
  35%  { opacity: 1; }
  to   { transform: translateX(880px) skewX(-12deg); opacity: 0; }
}

/* Stage states. Steps 5 onward take whatever shade the visitor picked. */
.tannery[data-stage="1"] { --hide: #DAD4C9; --hair: 0; }
.tannery[data-stage="2"] { --hide: #CBB08D; --hair: 0; }
.tannery[data-stage="3"] { --hide: #C5A67E; --hair: 0; }
.tannery[data-stage="4"] { --hide: #BB9161; --hair: 0; }
.tannery[data-stage="5"] { --hide: var(--leather-dyed); --hair: 0; }
.tannery[data-stage="6"] { --hide: var(--leather-dyed); --hair: 0; --grain: 1; }
.tannery[data-stage="7"] { --hide: var(--leather-dyed); --hair: 0; --grain: .8; }
.tannery[data-stage="8"] { --hide: var(--leather-dyed); --hair: 0; --grain: .6; }
.tannery[data-stage="9"] { --hide: var(--leather-dyed); --hair: 0; --grain: .5; }

/* ---- stage readout ---- */
.t-readout {
  display: flex; align-items: center; gap: .9rem;
  max-width: 460px; margin: 1.5rem auto 0;
  font-family: 'IBM Plex Mono', monospace; font-size: .75rem;
  letter-spacing: .16em; color: var(--orange);
}
.t-readout-bar { flex: 1; height: 2px; background: rgba(255,255,255,.18); border-radius: 2px; overflow: hidden; }
.t-readout-bar > span {
  display: block; height: 100%; width: 0%; background: var(--orange);
  transition: width 550ms var(--ease);
}

/* ---- dye picker ---- */
.dye { max-width: 460px; margin: 1.5rem auto 0; }
.dye-label {
  font-family: 'IBM Plex Mono', monospace; font-size: .6875rem;
  letter-spacing: .18em; text-transform: uppercase; color: #B9C7DB; margin: 0 0 .7rem;
}
.dye-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.shade {
  width: 40px; height: 40px; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--sw); border: 2px solid rgba(255,255,255,.3);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease),
              box-shadow 180ms var(--ease);
}
.shade:hover { transform: scale(1.08); border-color: rgba(255,255,255,.75); }
.shade[aria-pressed="true"] {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(240,126,0,.3);
}

/* ---- the steps ---- */
.t-intro { padding-block: clamp(2rem, 5vw, 4rem) 1rem; }
.t-step { padding-block: clamp(2.5rem, 6vw, 4rem); }
.t-step:last-child { padding-bottom: clamp(4rem, 9vw, 8rem); }
.t-step h3 { font-size: var(--t-3); margin: .35rem 0 .3rem; }
.t-step p { color: #B9C7DB; }
.t-step-n {
  font-family: 'IBM Plex Mono', monospace; font-size: .75rem;
  letter-spacing: .18em; color: var(--orange);
}
.t-step-n span { color: #7E93B4; }
.t-step-sub {
  font-family: 'IBM Plex Mono', monospace; font-size: .6875rem;
  letter-spacing: .14em; text-transform: uppercase; color: #8FA3BF !important;
  margin-bottom: 1rem;
}
.t-link {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 34px;
  font-size: var(--t--1); font-weight: 500; color: #fff; text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.35);
}
.t-link:hover { color: var(--orange); border-color: var(--orange); }

@media (min-width: 900px) {
  .t-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5rem; align-items: start; }
  .t-visual { top: 0; height: 100vh; height: 100dvh; display: flex; align-items: center; }
  .t-step { min-height: 74vh; display: flex; flex-direction: column; justify-content: center; padding-block: 2rem; }
  .t-intro { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; }
}
@media (max-width: 899px) {
  .tannery { padding-top: 0; }
  .t-visual {
    top: 60px; padding: 1.5rem 0 1rem;
    background: var(--navy-deep);
    box-shadow: 0 18px 24px -12px var(--navy-deep);
  }
  .hide { max-width: 260px; }
  .t-readout, .dye { max-width: 320px; }
  .shade { width: 44px; height: 44px; }   /* comfortable touch target */
  .dye-label { margin-bottom: .5rem; }
}

/* ============================================================
   WHAT IT BECOMES
   ============================================================ */
.goods { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.good-art {
  display: flex; align-items: flex-end; justify-content: flex-start;
  height: 156px; margin-bottom: var(--s-3);
}
.good-art svg { max-height: 100%; max-width: 100%; height: auto; width: auto; overflow: visible; }
.good-art svg path { fill: var(--leather-dyed); transition: fill 600ms var(--ease); }
.good-art svg .g-line {
  fill: none; stroke: rgba(255,255,255,.5); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.good-art svg .g-hole { fill: var(--paper); }
/* Straps that fall outside the body of the product are drawn in the leather
   itself, not the white detail stroke. */
.good-art svg .g-strap {
  fill: none; stroke: var(--leather-dyed); stroke-width: 7;
  stroke-linecap: round; transition: stroke 600ms var(--ease);
}
.good h3 { font-size: var(--t-2); margin-bottom: .4rem; }
.good p { font-size: var(--t--1); color: var(--ink-muted); margin: 0; }

@media (min-width: 700px) {
  @supports (grid-template-rows: subgrid) {
    .goods > .good { display: grid; grid-row: span 3; grid-template-rows: subgrid; gap: 0; }
  }
}

/* ---- motion preferences ---- */
@media (prefers-reduced-motion: reduce) {
  .hide-body, .hide-hair, .hide-grain, .hide-sheen,
  .good-art svg path, .t-readout-bar > span { transition: none; }
  .hide-sheen, .tannery[data-stage="8"] .hide-sheen { display: none; animation: none; }
  .shade:hover { transform: none; }
}

/* ---- 3D stage --------------------------------------------------------
   The canvas only appears once the scene has actually initialised, so a
   missing CDN, no WebGL, or JavaScript off all fall back to the flat hide. */
.t-canvas { display: none; }
.tannery.has-3d .t-canvas {
  display: block; width: 100%; height: min(56vh, 440px);
  cursor: grab; touch-action: pan-y;
}
.tannery.has-3d .t-canvas.is-grabbing { cursor: grabbing; }
.tannery.has-3d .t-canvas canvas { display: block; width: 100%; height: 100%; }
.tannery.has-3d .hide { display: none; }

.t-hint {
  display: none; max-width: 460px; margin: .9rem auto 0;
  font-family: 'IBM Plex Mono', monospace; font-size: .625rem;
  letter-spacing: .18em; text-transform: uppercase; color: #7E93B4;
  text-align: center;
}
.tannery.has-3d .t-hint { display: block; }

@media (max-width: 899px) {
  .tannery.has-3d .t-canvas { height: 34vh; }
}
@media (prefers-reduced-motion: reduce) {
  .t-canvas { cursor: default; }
}
