/* ==========================================================================
   AYAJ WOODS ECUADOR S.A.S. — shared stylesheet
   One file for every page. Division pages switch colour with
   <body data-division="teak|cacao|sea">.
   ========================================================================== */

/* --- Fonts (self-hosted, SIL Open Font License — see fonts/OFL.txt) ----- */
@font-face {
  font-family: "Besley";
  src: url("../fonts/besley-var.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* --- Design tokens -------------------------------------------------------- */
:root {
  /* Brand colour */
  --mangrove: #1b3324;      /* deep forest — dark surfaces */
  --canopy: #2c5d30;        /* logo green */
  --paper: #f5f1e6;         /* warm ivory — page */
  --paper-hi: #fffdf8;      /* raised light surface (form) */
  --linen: #e9e2d0;         /* quiet alternate surface */
  --ink: #1e2621;           /* text */
  --ink-2: #4e574f;         /* secondary text (6.6:1 on paper) */
  --rule: rgba(30, 38, 33, 0.16);
  --rule-strong: rgba(30, 38, 33, 0.34);
  --field-border: #8c877b;  /* 3.6:1 on white — form boundaries */
  --teak: #7a4619;          /* actions on light (6.8:1 with ivory text) */
  --teak-deep: #5e3511;
  --heartwood: #d9a465;     /* actions and marks on dark */
  --heartwood-hi: #e8bf8c;
  --on-dark: #f2eee3;
  --on-dark-2: #c9cfc4;
  --error: #a3261b;
  --error-bg: #fbecea;

  /* Theme slots (overridden per division) */
  --panel: var(--mangrove);
  --panel-ink: var(--on-dark);
  --panel-muted: var(--on-dark-2);
  --panel-line: rgba(242, 238, 227, 0.24);
  --accent: var(--teak);
  --accent-on-panel: var(--heartwood);
  --accent-on-panel-hi: var(--heartwood-hi);

  /* Type */
  --serif: "Besley", Rockwell, "Roboto Slab", Georgia, serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --step--1: 0.875rem;                                   /* 14 */
  --step-0: 1.0625rem;                                   /* 17 */
  --step-1: 1.1875rem;                                   /* 19 */
  --step-2: 1.3125rem;                                   /* 21 */
  --step-3: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);   /* 22–26 */
  --step-4: clamp(1.625rem, 1.25rem + 1.3vw, 2.25rem);   /* 26–36 */
  --step-5: clamp(2rem, 1.35rem + 2.3vw, 3rem);          /* 32–48 */
  --step-6: clamp(2.5rem, 1.4rem + 3.6vw, 4.25rem);      /* 40–68 */

  /* Layout */
  --wrap: 82.5rem;                              /* 1320px */
  --gutter: clamp(1.25rem, 3.6vw, 3.5rem);      /* page side padding */
  --gap: clamp(1.25rem, 2.4vw, 2rem);           /* grid gap */
  --section: clamp(4rem, 8vw, 7.5rem);          /* vertical section rhythm */
  --header-h: 76px;
  --radius: 2px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow-raise: 0 24px 48px -32px rgba(27, 51, 36, 0.45);
}

body[data-division="cacao"] {
  --panel: #2b1a12;
  --panel-ink: #f3ece2;
  --panel-muted: #d6c6b3;
  --panel-line: rgba(243, 236, 226, 0.22);
  --accent: #7a3a1b;
  --accent-on-panel: #dba26b;
  --accent-on-panel-hi: #ebc093;
}
body[data-division="sea"] {
  --panel: #0b3a3f;
  --panel-ink: #eef3f1;
  --panel-muted: #bdd2cf;
  --panel-line: rgba(238, 243, 241, 0.24);
  --accent: #0e5b60;
  --accent-on-panel: #8fcfd2;
  --accent-on-panel-hi: #b5e0e2;
}

/* --- Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; color: inherit; margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--heartwood); color: var(--mangrove); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}
.on-panel :focus-visible,
.site-footer :focus-visible { outline-color: var(--accent-on-panel); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1rem;
  text-decoration: none;
  font-weight: 500;
}
.skip-link:focus { top: 1rem; }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Photos: blurred preview (inline background) until the image arrives */
.ph {
  color: transparent; /* hide alt text over the blurred preview if a photo fails */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.ph-wrap { position: relative; overflow: hidden; background: var(--linen); }
.ph-wrap > img { width: 100%; height: 100%; object-fit: cover; }

figure { margin: 0; }
figcaption {
  font-size: var(--step--1);
  color: var(--ink-2);
  margin-top: 0.75rem;
}

/* --- Text links and buttons ----------------------------------------------- */
.link {
  color: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
  transition: text-decoration-thickness 0.2s, color 0.2s;
}
.link:hover { color: var(--accent); text-decoration-thickness: 2px; }
.on-panel .link { text-decoration-color: var(--accent-on-panel); }
.on-panel .link:hover { color: var(--accent-on-panel-hi); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 48px;
  padding: 0.8em 1.35em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 500 1rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn--primary { background: var(--teak); color: #fbf6ec; }
.btn--primary:hover { background: var(--teak-deep); }
.btn--secondary { border-color: var(--rule-strong); color: var(--ink); background: transparent; }
.btn--secondary:hover { border-color: var(--ink); background: rgba(30, 38, 33, 0.05); }
.on-panel .btn--primary { background: var(--accent-on-panel); color: var(--panel); }
.on-panel .btn--primary:hover { background: var(--accent-on-panel-hi); }
.on-panel .btn--secondary { border-color: var(--panel-line); color: var(--panel-ink); }
.on-panel .btn--secondary:hover { border-color: var(--panel-ink); background: rgba(255, 255, 255, 0.06); }
.btn--small { min-height: 42px; padding: 0.6em 1.05em; font-size: 0.9375rem; }
.btn[aria-busy="true"] { cursor: progress; opacity: 0.85; }

/* --- Header ----------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--paper);
  transition: box-shadow 0.25s var(--ease);
}
.site-header.is-scrolled {
  box-shadow: 0 1px 0 var(--rule), 0 10px 30px -24px rgba(27, 51, 36, 0.5);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--header-h);
}
.brand { display: block; flex: none; text-decoration: none; }
.brand svg { height: 46px; width: auto; }

.logo .lg-tree, .logo .lg-word { fill: var(--canopy); }
.logo .lg-log, .logo .lg-sub { fill: #683f11; }
.logo .lg-bark { stroke: #8a5a22; }
.logo .lg-face { fill: #fbf8f0; }
.logo .lg-rings { stroke: #683f11; }
.logo--light .lg-tree, .logo--light .lg-word { fill: #a7c4a2; }
.logo--light .lg-log { fill: #a8692c; }
.logo--light .lg-bark { stroke: var(--heartwood); }
.logo--light .lg-face { fill: var(--on-dark); }
.logo--light .lg-rings { stroke: #a8692c; }
.logo--light .lg-sub { fill: var(--heartwood); }

.site-nav { margin-left: auto; display: flex; align-items: center; }
.site-nav__list { display: flex; align-items: center; gap: 0.125rem; list-style: none; }
.site-nav__list a {
  position: relative;
  display: block;
  padding: 0.55rem 0.8rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.site-nav__list a::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.3rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.site-nav__list a:hover::after,
.site-nav__list a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav__list a[aria-current="page"] { color: var(--accent); }
.site-nav__cta { margin-left: 1rem; }
.site-nav__home { display: none; }

.menu-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: transparent;
  font-weight: 500;
  font-size: 0.9375rem;
  cursor: pointer;
}
.menu-toggle__icon { position: relative; width: 18px; height: 12px; }
.menu-toggle__icon::before,
.menu-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s var(--ease), top 0.25s var(--ease);
}
.menu-toggle__icon::before { top: 2px; }
.menu-toggle__icon::after { top: 9px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon::before { top: 5.5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon::after { top: 5.5px; transform: rotate(-45deg); }

/* --- Hero (split: text panel + photograph) --------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: clamp(560px, calc(100svh - var(--header-h) - 104px), 780px);
  background: var(--panel);
  color: var(--panel-ink);
}
.hero__text {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-block: clamp(3rem, 6vw, 6rem) clamp(3rem, 5vw, 5rem);
  padding-inline-start: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  padding-inline-end: clamp(1.5rem, 4vw, 4rem);
}
.hero__rings {
  position: absolute;
  z-index: -1;
  width: 640px;
  aspect-ratio: 1;
  left: -190px;
  bottom: -290px;
  background: var(--accent-on-panel);
  opacity: 0.16;
  -webkit-mask-image: url("../img/rings.svg");
  mask-image: url("../img/rings.svg");
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  pointer-events: none;
}
.hero h1 {
  font-size: var(--step-6);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 15ch;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
.hero--product h1 { font-size: clamp(2.375rem, 1.4rem + 3.1vw, 4rem); max-width: 16ch; }
.hero__lead {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--panel-muted);
  max-width: 40ch;
  margin-bottom: 2.25rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero__media { position: relative; overflow: hidden; background: var(--panel); }
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: settle 1.6s var(--ease) both;
}
.hero__caption {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  margin: 0;
  padding: 0.35rem 0.6rem;
  background: rgba(20, 24, 21, 0.55);
  color: #f4f1ea;
  font-size: 0.8125rem;
  border-radius: var(--radius);
}
@keyframes settle {
  from { transform: scale(1.045); }
  to { transform: none; }
}

.breadcrumb { margin-bottom: auto; padding-bottom: 2.5rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; list-style: none; font-size: var(--step--1); color: var(--panel-muted); }
.breadcrumb li + li::before { content: "/"; margin: 0 0.6rem; opacity: 0.6; }
.breadcrumb a { color: var(--panel-ink); text-underline-offset: 0.25em; }

/* --- Key facts strip ----------------------------------------------------------- */
.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-bottom: 1px solid var(--rule);
}
.facts > div { padding: 1.6rem var(--gap) 1.75rem 0; }
.facts > div + div { padding-left: var(--gap); border-left: 1px solid var(--rule); }
.facts dt { font-size: var(--step--1); color: var(--ink-2); margin-bottom: 0.35rem; }
.facts dd { margin: 0; font-weight: 500; line-height: 1.45; }

/* --- Sections ------------------------------------------------------------------ */
.section { padding-block: var(--section); }
.section--linen { background: var(--linen); }
.section--panel { background: var(--panel); color: var(--panel-ink); }
.section:not([class*="--"]) + .section:not([class*="--"]) { padding-top: 0; }
.section--flush-top { padding-top: 0; }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--gap);
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head--stack { grid-template-columns: minmax(0, 1fr); max-width: 52rem; }
.section-head h2,
.h2 {
  font-size: var(--step-5);
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 20ch;
  text-wrap: balance;
}
.section-head p { margin: 0; font-size: var(--step-1); color: var(--ink-2); max-width: 46ch; }
.section--panel .section-head p { color: var(--panel-muted); }

.prose p { max-width: 64ch; }
.lead { font-size: var(--step-1); line-height: 1.55; }

/* Key–value list (division facts, product facts) */
.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.6rem 1.5rem;
  margin: 0 0 1.75rem;
  font-size: 0.9688rem;
}
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }

/* --- Divisions on the home page ---------------------------------------------- */
.divisions { list-style: none; }
.division {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding-block: clamp(2rem, 4vw, 3.5rem);
  border-top: 1px solid var(--rule);
}
.division:last-child { border-bottom: 1px solid var(--rule); }
.division:nth-child(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.division:nth-child(even) .division__media { order: 2; }
.division__media { display: block; aspect-ratio: 3 / 2; }
.division__media img { transition: transform 0.9s var(--ease); }
.division:hover .division__media img { transform: scale(1.025); }
.division__body h3 { font-size: var(--step-4); line-height: 1.12; letter-spacing: -0.01em; margin-bottom: 1rem; }
.division__body h3 a { text-decoration: none; }
.division__body > p { max-width: 46ch; margin-bottom: 1.5rem; }
.division__tag {
  display: inline-block;
  margin-bottom: 0.9rem;
  font-size: var(--step--1);
  color: var(--ink-2);
}

/* --- About / company -------------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.about__media .ph-wrap { aspect-ratio: 4 / 5; }
.about__body h2 { margin-bottom: 1.5rem; }
.about__body .lead { margin-bottom: 1.25rem; }
.company {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--gap);
  margin: 2.5rem 0 0;
}
.company > div { padding: 1rem 0 1.1rem; border-top: 1px solid var(--rule); }
.company dt { font-size: var(--step--1); color: var(--ink-2); margin-bottom: 0.25rem; }
.company dd { margin: 0; font-weight: 500; }

/* --- Principles ("what buyers can hold us to") ------------------------------ */
.principles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  list-style: none;
}
.principle { border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.principle h3 { font-size: var(--step-2); font-weight: 600; line-height: 1.25; margin-bottom: 0.6rem; }
.principle p { margin: 0; color: var(--ink-2); }

/* --- Numbered steps (real sequences only) ------------------------------------ */
.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gap);
  list-style: none;
}
.step { border-top: 1px solid var(--rule-strong); padding-top: 1.25rem; }
.step__n {
  display: block;
  font: 500 2rem/1 var(--serif);
  color: var(--accent);
  margin-bottom: 1rem;
  font-variant-numeric: lining-nums;
}
.step h3 { font: 600 1.0625rem/1.35 var(--sans); margin-bottom: 0.5rem; }
.step p { margin: 0; font-size: 0.9688rem; color: var(--ink-2); }
.section--panel .step { border-top-color: var(--panel-line); }
.section--panel .step__n { color: var(--accent-on-panel); }
.section--panel .step p { color: var(--panel-muted); }

.band { position: relative; height: clamp(220px, 32vw, 440px); margin-bottom: clamp(3rem, 6vw, 5rem); }
.band::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to bottom, transparent, var(--panel));
  pointer-events: none;
}

/* --- Product pages ------------------------------------------------------------ */
.statement {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}
.statement .ph-wrap { aspect-ratio: 4 / 3; }
.statement h2 { margin-bottom: 1.25rem; }

.formats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 4rem);
  list-style: none;
}
.format .ph-wrap { aspect-ratio: 3 / 2; margin-bottom: 1.5rem; }
.format h3 { font-size: var(--step-3); line-height: 1.2; margin-bottom: 0.75rem; }
.format p { max-width: 52ch; }

/* Specification table */
.spec-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 0 0 1.5rem;
  font-size: var(--step--1);
  color: var(--ink-2);
}
.spec-legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.mark-req {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.spec { width: 100%; border-collapse: collapse; font-size: 1rem; }
.spec caption { text-align: left; }
.spec th, .spec td {
  text-align: left;
  vertical-align: top;
  padding: 0.95rem 1.5rem 0.95rem 0;
  border-bottom: 1px solid var(--rule);
}
.spec thead th,
.spec thead td {
  font: 600 var(--step-2)/1.2 var(--serif);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.9rem;
}
.spec tbody th { width: 24%; font-weight: 500; color: var(--ink-2); }
.spec td.req { color: var(--ink-2); }
.spec .both {
  display: inline-block;
  margin-right: 0.75rem;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-2);
  vertical-align: 0.1em;
}
.spec td.req .mark-req { margin-right: 0.55rem; transform: translateY(-1px); color: var(--accent); }
.spec--single tbody th { width: 30%; }
.spec-note { margin-top: 1.5rem; font-size: 0.9688rem; color: var(--ink-2); max-width: 70ch; }

/* Material / detail layout */
.detail {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.detail h2 { margin-bottom: 1.5rem; }
.traits { list-style: none; margin: 1.75rem 0 0; }
.traits li { padding: 0.8rem 0; border-top: 1px solid var(--rule); }
.traits li:last-child { border-bottom: 1px solid var(--rule); }
.detail__aside .ph-wrap { aspect-ratio: 4 / 5; margin-bottom: 1.5rem; }
.detail__aside h3 { font: 600 1rem/1.4 var(--sans); margin-bottom: 0.6rem; }
.plain-list { list-style: none; columns: 2; column-gap: 1.5rem; margin-bottom: 1.75rem; }
.plain-list li { padding: 0.2rem 0; break-inside: avoid; }

/* Checks / species grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 var(--gap);
  list-style: none;
}
.grid-3 > li { padding: 1.25rem 0 1.5rem; border-top: 1px solid var(--rule); }
.section--panel .grid-3 > li { border-top-color: var(--panel-line); }
.grid-3 h3 { font: 600 var(--step-2)/1.25 var(--serif); margin-bottom: 0.2rem; }
.grid-3 .sub { display: block; font-size: var(--step--1); color: var(--ink-2); margin-bottom: 0.6rem; }
.section--panel .grid-3 .sub,
.section--panel .grid-3 p { color: var(--panel-muted); }
.grid-3 p { margin: 0; font-size: 0.9688rem; color: var(--ink-2); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.split--reverse { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split .ph-wrap { aspect-ratio: 4 / 5; }
.split--wide-media .ph-wrap { aspect-ratio: 3 / 2; }

/* Ordering: three columns of practical information */
.ordering {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  list-style: none;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.ordering > li { border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.ordering h3 { font: 600 var(--step-2)/1.25 var(--serif); margin-bottom: 0.75rem; }
.ordering ul { list-style: none; }
.ordering ul li { padding: 0.35rem 0; border-bottom: 1px solid var(--rule); font-size: 0.9688rem; }
.ordering p { font-size: 0.9688rem; color: var(--ink-2); }

.markets {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 5rem);
  padding-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--rule);
}
.markets h3 { font: 600 var(--step-3)/1.2 var(--serif); margin-bottom: 0.75rem; }
.ports { list-style: none; columns: 3; column-gap: var(--gap); margin-top: 0.5rem; }
.ports li { padding: 0.45rem 0; border-top: 1px solid var(--rule); break-inside: avoid; }
.ports .main { font-weight: 600; }
.ports-key { font-size: var(--step--1); color: var(--ink-2); margin-top: 1rem; }

/* --- Contact and quote form ------------------------------------------------------ */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.quote {
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  padding: clamp(1.5rem, 3.2vw, 2.75rem);
  box-shadow: var(--shadow-raise);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}
.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field label { font-weight: 500; font-size: 0.9688rem; }
.field .opt { font-weight: 400; color: var(--ink-2); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231e2621' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink); }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--ink);
}
.field [aria-invalid="true"] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.field__hint { font-size: var(--step--1); color: var(--ink-2); }
.field__error { font-size: var(--step--1); color: var(--error); font-weight: 500; }
.field__error:empty { display: none; }

.form-summary {
  grid-column: 1 / -1;
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--error);
  background: var(--error-bg);
  color: var(--ink);
}
.form-summary h3 { font: 600 1rem/1.4 var(--sans); margin-bottom: 0.4rem; }
.form-summary ul { list-style: none; }
.form-summary a { color: var(--error); font-weight: 500; }
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 0.5rem;
}
.form-note { margin: 0; font-size: var(--step--1); color: var(--ink-2); max-width: 46ch; }
.form-done { display: grid; gap: 1rem; }
.form-done h3 { font-size: var(--step-3); line-height: 1.2; }
.form-done p { margin: 0; max-width: 56ch; }
.form-done textarea {
  width: 100%;
  min-height: 190px;
  padding: 0.9rem;
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  background: #fff;
  font: 0.9375rem/1.5 var(--sans);
  color: var(--ink);
  resize: vertical;
}
.form-done__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.form-status { font-size: var(--step--1); color: var(--ink-2); margin: 0; }
.form-actions .form-status { flex-basis: 100%; }
[hidden] { display: none !important; }

.contact-details dl { margin: 0; }
.contact-details dl > div { padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.contact-details dl > div:last-child { border-bottom: 1px solid var(--rule); }
.contact-details dt { font-size: var(--step--1); color: var(--ink-2); margin-bottom: 0.3rem; }
.contact-details dd { margin: 0; line-height: 1.55; }
.contact-details .email { font-weight: 500; overflow-wrap: anywhere; }
.contact-details h3 { font: 600 var(--step-2)/1.25 var(--serif); margin-bottom: 1rem; }

/* --- Footer ------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--mangrove);
  color: var(--on-dark-2);
  padding-block: clamp(3.5rem, 6vw, 5rem) 1.75rem;
  font-size: 0.9688rem;
}
.site-footer__rings {
  position: absolute;
  z-index: -1;
  width: 720px;
  aspect-ratio: 1;
  right: -260px;
  top: -200px;
  background: var(--heartwood);
  opacity: 0.08;
  -webkit-mask-image: url("../img/rings.svg");
  mask-image: url("../img/rings.svg");
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  pointer-events: none;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2.2fr));
  gap: var(--gap);
}
.footer-brand svg { height: 50px; width: auto; margin-bottom: 1.25rem; }
.footer-brand p { max-width: 40ch; margin: 0; }
.site-footer h2 { font: 600 0.9375rem/1.4 var(--sans); color: var(--on-dark); margin-bottom: 0.9rem; }
.site-footer ul { list-style: none; }
.site-footer li { padding: 0.25rem 0; }
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--heartwood); text-underline-offset: 0.25em; }
.site-footer address { font-style: normal; line-height: 1.6; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(242, 238, 227, 0.16);
  font-size: var(--step--1);
}
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.footer-bottom li { padding: 0; }

/* --- Legal page --------------------------------------------------------------------- */
.page-head { padding-block: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--rule); }
.page-head h1 { font-size: var(--step-5); line-height: 1.08; letter-spacing: -0.015em; margin-bottom: 1rem; }
.page-head p { color: var(--ink-2); max-width: 60ch; margin: 0; }
.legal { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); gap: clamp(2rem, 5vw, 5rem); }
.legal-toc { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; }
.legal-toc ul { list-style: none; }
.legal-toc li { padding: 0.35rem 0; border-top: 1px solid var(--rule); }
.legal-toc a { text-decoration: none; font-weight: 500; }
.legal-toc a:hover { color: var(--accent); }
.legal section + section { margin-top: clamp(3rem, 5vw, 4rem); padding-top: clamp(3rem, 5vw, 4rem); border-top: 1px solid var(--rule); }
.legal h2 { font-size: var(--step-4); line-height: 1.15; margin-bottom: 1.25rem; }
.legal h3 { font: 600 1.0625rem/1.4 var(--sans); margin: 1.75rem 0 0.5rem; }
.legal p, .legal li { max-width: 68ch; }
.legal a[href^="mailto"] { white-space: nowrap; }
.legal ul.bullets { padding-left: 1.2rem; }
.legal ul.bullets li { padding: 0.2rem 0; }
.legal dl > div { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 1rem; padding: 0.75rem 0; border-top: 1px solid var(--rule); }
.legal dl > div:last-child { border-bottom: 1px solid var(--rule); }
.legal dt { color: var(--ink-2); }
.legal dd { margin: 0; }
.credits { list-style: none; }
.credits li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; padding: 0.7rem 0; border-top: 1px solid var(--rule); font-size: 0.9688rem; }

/* --- Responsive ---------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .site-nav__list a { padding-inline: 0.6rem; }
  .site-nav__list a::after { left: 0.6rem; right: 0.6rem; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 2.25rem; }
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.25rem; }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; margin-bottom: 1rem; }
}

@media (max-width: 899px) {
  :root { --header-h: 64px; }
  .brand svg { height: 38px; }
  .menu-toggle { display: inline-flex; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 55;
    display: block;
    overflow-y: auto;
    padding: 1.5rem var(--gutter) 3rem;
    background: var(--paper);
    border-top: 1px solid var(--rule);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
  }
  .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s;
  }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav__home { display: block; }
  .site-nav__list a {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--rule);
    font: 500 var(--step-3)/1.2 var(--serif);
  }
  .site-nav__list a::after { display: none; }
  .site-nav__cta { margin: 1.75rem 0 0; width: 100%; }
  body.nav-open { overflow: hidden; }

  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero__media { order: -1; aspect-ratio: 4 / 3; max-height: 62svh; width: 100%; }
  .hero__text { padding: 2.75rem var(--gutter) 3rem; }
  .hero__rings { width: 520px; left: auto; right: -260px; bottom: -280px; }
  .breadcrumb { padding-bottom: 1.75rem; }

  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div,
  .facts > div + div { padding: 1.25rem 1rem 1.25rem 0; border-left: 0; border-top: 1px solid var(--rule); }
  .facts > div:nth-child(even) { padding-left: 1rem; border-left: 1px solid var(--rule); }
  .facts > div:nth-child(-n + 2) { border-top: 0; }

  .section-head,
  .division,
  .about,
  .statement,
  .detail,
  .split,
  .split--reverse,
  .markets,
  .contact,
  .legal { grid-template-columns: minmax(0, 1fr); }
  .division:nth-child(even) { grid-template-columns: minmax(0, 1fr); }
  .division:nth-child(even) .division__media { order: 0; }
  .about__media .ph-wrap { aspect-ratio: 3 / 2; }
  .split .ph-wrap { aspect-ratio: 3 / 2; }
  .detail__aside .ph-wrap { aspect-ratio: 3 / 2; }
  .formats { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ordering { grid-template-columns: minmax(0, 1fr); }
  .ports { columns: 2; }
  .legal-toc { position: static; }
}

@media (max-width: 720px) {
  .steps { grid-template-columns: minmax(0, 1fr); row-gap: 1.75rem; }
  .step { display: grid; grid-template-columns: 3rem minmax(0, 1fr); column-gap: 0.75rem; }
  .step__n { grid-row: span 2; font-size: 1.625rem; margin: 0; }
  .principles { grid-template-columns: minmax(0, 1fr); }
  .company { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal dl > div { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  .credits li { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }

  /* Specification table becomes stacked rows */
  .spec thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .spec, .spec tbody, .spec tr { display: block; }
  .spec tr { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
  .spec tbody th { display: block; width: auto; padding: 0 0 0.45rem; border: 0; color: var(--ink); font-weight: 600; }
  .spec td { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.2rem 0; border: 0; }
  .spec td::before { content: attr(data-label); color: var(--ink-2); font-size: var(--step--1); padding-top: 0.1rem; }
  .spec td.req { color: var(--ink-2); }
  .spec td .cell { display: block; }
  .spec .both { display: none; }
  .spec--single td { grid-template-columns: minmax(0, 1fr); }
  .spec--single td::before { display: none; }
}

@media (max-width: 480px) {
  .hero__actions .btn { flex: 1 1 100%; }
  .facts dd { font-size: 0.9688rem; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .kv dd { margin-bottom: 0.6rem; }
  .ports { columns: 2; }
  .footer-grid > div:last-child { grid-column: 1 / -1; }
}
@media (max-width: 340px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts > div,
  .facts > div:nth-child(even) { padding: 1rem 0; border-left: 0; border-top: 1px solid var(--rule); }
  .facts > div:first-child { border-top: 0; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
}

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

@media print {
  .site-header, .site-nav, .menu-toggle, .quote, .hero__rings, .site-footer__rings, .skip-link { display: none !important; }
  body { background: #fff; }
  .hero, .section--panel, .site-footer { background: #fff; color: #000; }
}
