/* ==========================================================
   Palmverra — styles
   One grid for the whole page: a 1240 px container, a 760 px reading column,
   one spacing rhythm and one type scale. Warm greys, Inter, generous white space.
   ========================================================== */
:root {
  --ink: #4f4c48;
  --ink-d: #2d2b28;
  --muted: #7a766f;
  --white: #fff;
  --grey: #e4e3df;
  --tint: #f5f3ee;
  --line: #dcd9d1;
  --video: #d6d4cf;
  --black: #000;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  --pad: clamp(20px, 4.5vw, 56px);            /* page gutter */
  --container: 1240px;
  --prose: 780px;
  --hh: 76px;                                  /* header height */
  --gap: clamp(28px, 5vw, 80px);               /* gap between columns */
  --space: clamp(64px, 8vw, 112px);            /* vertical rhythm between sections */

  --fs-h2: clamp(1.85rem, 3.1vw, 2.75rem);
  --fs-lead: clamp(1.2rem, 1.9vw, 1.6rem);
  --fs-body: clamp(1.05rem, 1.4vw, 1.25rem);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: var(--hh); }
body { margin: 0; background: var(--white); color: var(--ink); font: 500 1.0625rem/1.65 var(--font); -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4, p, figure, ul { margin: 0; }
:focus-visible { outline: 3px solid var(--ink-d); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; color: #000; padding: .6rem 1rem; z-index: 300; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- Grid & rhythm ---------- */
.container { width: min(var(--container), 100% - 2 * var(--pad)); margin-inline: auto; }
.prose { max-width: var(--prose); }
.center { text-align: center; }
.sec { padding-block: var(--space); }
.sec-white { background: var(--white); }
.sec-tint { background: var(--tint); }
.sec-sand { background: #ebe4d3; }
.sec-grey { background: var(--grey); }
.sec-flush { padding-bottom: 0; }
.sec-flush-top { padding-top: 0; }
/* consistent space between the blocks inside a section */
.sec > * + * { margin-top: clamp(32px, 4.5vw, 64px); }
.sec > .prose + .prose { margin-top: clamp(32px, 4.5vw, 64px); }

/* ---------- Type ---------- */
h2 { font-weight: 800; text-transform: uppercase; font-size: var(--fs-h2); line-height: 1.1; letter-spacing: .01em; color: var(--ink-d); }
.lead { font-size: var(--fs-lead); line-height: 1.55; font-weight: 600; color: var(--ink); }
.body { font-size: var(--fs-body); line-height: 1.7; color: var(--ink); }
.kicker { font-size: var(--fs-body); font-weight: 700; letter-spacing: .02em; color: var(--ink-d); }
h2 + .lead, h2 + .body, h2 + .kicker { margin-top: 1.1rem; }
.kicker + .body { margin-top: 1.1rem; }
.body + .body, .lead + .lead { margin-top: 1.25rem; }
.kicker i, .body i { font-style: normal; margin: 0 .45em; color: var(--muted); }

/* ---------- Two-column rows ---------- */
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.two-col-center { align-items: center; }
.col-text > * + * { margin-top: 1.25rem; }
.col-text h2 { margin-bottom: 1.5rem; }
.col-text h2 + * { margin-top: 0; }

/* ---------- Placeholders (visible until the real image exists) ---------- */
.ph {
  position: relative; display: block; overflow: hidden; width: 100%; aspect-ratio: var(--ratio, 4/3);
  background:
    repeating-linear-gradient(45deg, rgba(90,87,83,.07) 0 12px, transparent 12px 24px),
    #e7e4dc;
  outline: 1px dashed rgba(90,87,83,.45); outline-offset: -1px;
}
.sec-grey .ph { background: repeating-linear-gradient(45deg, rgba(90,87,83,.08) 0 12px, transparent 12px 24px), #cfccc3; }
.ph::before {
  content: attr(data-label); position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  padding: 1rem; font: 600 .78rem/1.45 var(--font); letter-spacing: .03em; color: var(--ink);
}
.ph > img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; background: transparent; }
/* JS adds .is-loaded once the real image has arrived: placeholder pattern and label go away */
.ph.is-loaded { background: #fff; outline: 0; }
.ph.is-loaded::before { display: none; }
.rounded { border-radius: var(--radius); }
.bleed { border-radius: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font: 700 1rem/1 var(--font); text-decoration: none; cursor: pointer;
  padding: .9rem 1.35rem; border: 1.5px solid #111; border-radius: 8px; background: transparent; color: #111;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-send { width: 100%; background: var(--ink-d); border-color: var(--ink-d); color: #fff; text-transform: uppercase; letter-spacing: .04em; padding-block: 1.05rem; }
.btn-send:hover { background: #000; border-color: #000; }
.btn-send:disabled { opacity: .6; cursor: wait; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.97); backdrop-filter: blur(8px); color: #111; box-shadow: 0 1px 0 rgba(0,0,0,.07); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: var(--hh); }
.brand { display: inline-flex; align-items: center; text-decoration: none; opacity: 0; pointer-events: none; transition: opacity .25s; }
.past-hero .brand { opacity: 1; pointer-events: auto; }
.brand-img { height: 18px; width: auto; }
.brand-text { font-weight: 800; letter-spacing: .28em; font-size: 1rem; }
.has-logo .brand-text { display: none; }
.nav { display: flex; align-items: center; gap: 1.5rem; margin-left: auto; font-size: 1rem; }
.nav-link { font-weight: 600; text-decoration: none; padding-block: .25rem; border-bottom: 2px solid transparent; transition: border-color .15s; }
.nav-link:hover { border-bottom-color: currentColor; }
.nav-item { position: relative; }
.nav-trigger { display: inline-flex; align-items: center; gap: .4rem; background: none; border-top: 0; border-inline: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.chev { flex: none; transition: transform .2s; }
.has-sub.is-open .chev { transform: rotate(180deg); }
.subnav {
  list-style: none; margin: 0; padding: .5rem; position: absolute; top: 100%; left: -1rem; min-width: 280px; padding-top: .5rem;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.3);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s;
}
.subnav::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.subnav a { display: block; padding: .75rem 1rem; border-radius: 6px; font-weight: 600; font-size: .95rem; text-decoration: none; color: var(--ink-d); white-space: nowrap; }
.subnav a:hover, .subnav a:focus-visible { background: var(--tint); }
.has-sub.is-open .subnav { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) and (min-width: 961px) {
  .has-sub:hover .subnav { opacity: 1; visibility: visible; transform: none; }
  .has-sub:hover .chev { transform: rotate(180deg); }
}
.btn-nav { padding: .7rem 1.1rem; font-size: .95rem; }
.btn-nav:hover { background: #111; color: #fff; }
.nav .btn-nav + .btn-nav { margin-left: -.5rem; }
.menu-btn { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 10px; color: inherit; margin-left: auto; }
.menu-btn span { display: block; height: 2.5px; background: currentColor; margin: 6px 0; transition: .2s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; height: clamp(460px, 74vh, 760px); display: grid; place-items: center; text-align: center; color: #fff; isolation: isolate; padding: 0 var(--pad) 3%; }
/* Image: assets/backgrounds/hero-bg.jpg — warm grey shows until it exists */
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(rgba(0,0,0,.2), rgba(0,0,0,.3)),
    url("../assets/backgrounds/hero-bg.jpg") center / cover no-repeat,
    linear-gradient(160deg, #8d8a7e, #5a5753);
}
/* logo box lines up with the left edge of the page content */
.hero-logo { position: absolute; top: clamp(20px, 3.5vw, 44px); left: max(var(--pad), calc((100% - var(--container)) / 2)); width: clamp(104px, 11vw, 168px); height: auto; background: #fff; border-radius: 4px; }
.hero h1 { font-weight: 800; text-transform: uppercase; font-size: clamp(2.8rem, 8.5vw, 7.5rem); line-height: 1; letter-spacing: .01em; }
.hero-tag { margin-top: clamp(1rem, 2vw, 1.75rem); font-weight: 700; font-size: clamp(1.05rem, 2vw, 1.75rem); line-height: 1.3; }

/* ---------- Philosophy ---------- */
/* one-line tagline above the heading: 70% of the h2 size, soft grey */
.sec-tagline { font-size: calc(var(--fs-h2) * .7); font-weight: 600; line-height: 1.3; color: #9a9690; }
.sec-tagline + .container { margin-top: clamp(24px, 3vw, 40px); }
@media (min-width: 768px) { .sec-tagline { white-space: nowrap; } }
.bullets { list-style: none; padding: 0; display: grid; gap: 1.25rem; font-size: var(--fs-lead); line-height: 1.45; font-weight: 600; color: var(--ink); }
.bullets li { position: relative; padding-left: 1.9rem; }
.bullets li::before { content: ""; position: absolute; left: 0; top: .5em; width: .8rem; height: .8rem; border-radius: 50%; background: var(--ink-d); box-shadow: 0 0 0 4px #fff, 0 0 0 5.5px var(--ink-d); }
.palm { width: min(100%, 460px); justify-self: center; background: transparent; outline: 0; --ratio: 1/1; overflow: visible; container-type: inline-size; transform: translateX(clamp(0px, 6vw, 110px)); }
/* trunk continues straight down from the photo's base to the top of the plantation image, thickening slightly with
   height. The tall transparent tile is cut from the photo's own trunk (mirrored) and widens ~1.7% per row, picking up
   exactly where the photo's trunk ends; the element is 128px of the 1200px-wide image, centred on the trunk. */
.palm-trunk {
  position: absolute; z-index: 0; pointer-events: none; top: calc(100% - 1px); left: 47.71%; width: 10.667%; height: var(--trunk-h, 0px);
  background: url("../assets/images/philosophy/trunk-tile.png") 0 0 / 100% auto no-repeat;
}
.palm::before { font-size: .7rem; }
.palm > img { object-fit: contain; }
.palm.is-loaded { background: transparent; }

/* ---------- Story, statement ---------- */
.statement { margin-top: clamp(40px, 5vw, 72px); padding-top: clamp(32px, 4vw, 56px); border-top: 1px solid var(--line); display: grid; align-items: start; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.statement-item { position: relative; padding-left: 1.5rem; border-left: 3px solid var(--ink-d); }
.statement-item .lead { color: var(--ink-d); font-weight: 700; line-height: 1.4; }
.statement-item .sub { margin-top: .6rem; font-size: var(--fs-body); font-weight: 500; line-height: 1.55; color: var(--muted); }
.eyebrow { margin-bottom: .9rem; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.text-rule { display: block; width: 100%; height: 0; border: 0; border-top: 3px solid #000; margin: clamp(28px, 4vw, 48px) 0 0; }
.lead-xl { font-size: clamp(1.5rem, 2.6vw, 2.2rem); font-weight: 700; line-height: 1.3; color: var(--ink-d); }


/* ---------- Process ---------- */
.mosaic { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(12px, 1.8vw, 24px); }
.mosaic > .ph { grid-column: span 2; }
/* felling photo: full width and cropped in on the saw cut */
.mosaic > .ph.feature { grid-column: 1 / -1; }
.mosaic > .ph.feature > img { transform: scale(1.6); transform-origin: 58% 39%; }

/* ---------- Structure ---------- */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.pair figcaption { margin-top: 1.1rem; text-align: center; font-size: var(--fs-body); font-weight: 600; color: var(--ink); }

/* ---------- Products ---------- */
.pgroup { margin-top: clamp(48px, 6vw, 88px); }
.pgroup:first-of-type { margin-top: clamp(40px, 5vw, 64px); }
.pgroup h3 { font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 800; line-height: 1.2; color: var(--ink-d); padding-bottom: 1rem; margin-bottom: clamp(20px, 2.6vw, 36px); border-bottom: 1px solid var(--line); }
.pgrid { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: clamp(36px, 5vw, 72px); }
.pcard { text-align: center; width: min(100%, 960px); }
.pimg { --ratio: 4/3; border-radius: var(--radius); background-color: #fff; border: 1px solid var(--line); }
.pimg > img { object-fit: contain; padding: 3%; }
.pcard h4 { margin-top: 1.1rem; font-weight: 800; text-transform: uppercase; font-size: 1.05rem; letter-spacing: .03em; line-height: 1.3; color: var(--ink-d); }
.pcard .ptag { margin-left: .35em; font-weight: 400; font-size: .8em; letter-spacing: .02em; text-transform: lowercase; color: #b4b0a8; }
.pcard p { margin-top: .2rem; font-weight: 600; font-size: .95rem; letter-spacing: .04em; color: var(--muted); }

.grain { width: min(100%, 960px); margin: clamp(48px, 6vw, 88px) auto 0; }
.grain figcaption { margin-top: 1.1rem; text-align: center; font-size: var(--fs-body); font-weight: 600; line-height: 1.5; color: var(--ink); }

/* ---------- Product code link + PDF viewer page ---------- */
.pcode { color: inherit; text-decoration: none; border-bottom: 1.5px solid var(--line); transition: border-color .15s, color .15s; }
.pcode:hover, .pcode:focus-visible { color: var(--ink-d); border-bottom-color: var(--ink-d); }
.pcode::after { content: " \2197"; font-size: .85em; }

.viewer-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap; padding: .75rem var(--pad); background: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.viewer-back { white-space: nowrap; }
.viewer-title { display: grid; line-height: 1.3; min-width: 0; }
.viewer-title strong { font-weight: 800; color: var(--ink-d); }
.viewer-title span { font-size: .9rem; letter-spacing: .04em; color: var(--muted); }
.viewer-open { margin-left: auto; font-size: .95rem; font-weight: 600; color: var(--ink-d); }
.viewer-main { flex: 1; min-height: 0; background: var(--video); display: flex; }
.viewer-main iframe { flex: 1; width: 100%; border: 0; }
.viewer-msg { margin: auto; text-align: center; font-weight: 600; line-height: 2.2; }

/* ---------- Tableware ---------- */
.tableware { margin-top: clamp(28px, 4vw, 56px); }
.tableware-img { width: min(100%, 1100px); margin-inline: auto; box-shadow: 0 18px 40px -22px rgba(0,0,0,.35); }
/* ---------- Material ---------- */
.sheet { width: min(100%, 460px); justify-self: center; border-radius: var(--radius); box-shadow: 0 18px 40px -22px rgba(0,0,0,.35); }
.decl { width: min(100%, 880px); margin-inline: auto; border-radius: var(--radius); box-shadow: 0 18px 40px -22px rgba(0,0,0,.35); }
.decl > img { object-fit: contain; }

/* ---------- Applications ---------- */
.apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); }

/* ---------- Note ---------- */
.note { background: var(--tint); padding-block: clamp(40px, 5vw, 72px); border-block: 1px solid var(--line); }

/* ---------- Contact ---------- */
.contact { background: var(--white); }
.contact-intro { line-height: 1.8; }
.contact-intro a { white-space: nowrap; font-weight: 700; color: var(--ink-d); text-decoration: none; border-bottom: 2px solid var(--line); }
.contact-intro a:hover { border-bottom-color: var(--ink-d); }
/* Enquiry on top, Catalogue underneath, one column aligned to the left */
.forms { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 4vw, 48px); width: min(100%, 760px); margin: clamp(36px, 5vw, 64px) auto 0 0; }
.form { display: grid; align-content: start; gap: 1.1rem; background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 3vw, 40px); }
.form h2 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); }
.form-sub { color: var(--ink); font-weight: 600; margin-top: -.5rem; }.form label { display: grid; gap: .45rem; text-transform: uppercase; font-size: .8rem; font-weight: 700; letter-spacing: .05em; color: var(--ink); }
.form input, .form textarea {
  font: 500 1rem var(--font); text-transform: none; letter-spacing: 0; color: #111; background: #fff; border: 1.5px solid #c9c5ba; border-radius: 8px; padding: .8rem 1rem; width: 100%; resize: vertical;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--ink-d); box-shadow: 0 0 0 3px rgba(45,43,40,.12); }
.form-note { min-height: 1.4em; font-size: .92rem; font-weight: 600; }
.form-note.ok { color: #3f7a2a; } .form-note.err { color: #b3382c; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-d); color: #cfcbc2; text-align: center; padding-block: clamp(44px, 6vw, 80px); font-size: 1rem; }
.site-footer .container { display: grid; gap: .6rem; justify-items: center; }
.foot-brand { font-size: 1.5rem; font-weight: 800; letter-spacing: .04em; color: #fff; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.75rem; margin: .6rem 0 .8rem; }
.site-footer nav a { text-decoration: none; font-weight: 600; color: #fff; }
.site-footer nav a:hover { text-decoration: underline; }
.site-footer .copy { font-size: .9rem; color: #9b978e; padding-top: 1.1rem; margin-top: .4rem; border-top: 1px solid rgba(255,255,255,.14); width: min(100%, 520px); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  :root { --hh: 68px; }
  .menu-btn { display: block; }
  .site-header { backdrop-filter: none; background: #fff; }   /* backdrop-filter would trap the fixed mobile menu inside the header bar */
  .nav {
    position: fixed; inset: var(--hh) 0 0 0; background: #fff; color: #111; flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 0; padding: 1rem var(--pad); transform: translateX(100%); transition: transform .25s; overflow-y: auto; font-size: 1.2rem; margin-left: 0;
  }
  .nav.is-open { transform: none; }
  .nav-link { padding: 1.1rem 0; border-bottom: 1px solid #ddd; }
  .nav-trigger { width: 100%; justify-content: space-between; font-size: inherit; }
  .subnav { position: static; min-width: 0; border: 0; box-shadow: none; padding: 0 0 0 1rem; display: none; opacity: 1; visibility: visible; transform: none; }
  .subnav::before { display: none; }
  .has-sub.is-open .subnav { display: block; }
  .subnav a { padding: 1rem 0; border-bottom: 1px solid #eee; border-radius: 0; font-size: 1.05rem; white-space: normal; }
  .btn-nav { margin-top: 1rem; text-align: center; padding: 1.1rem; }
  .nav .btn-nav + .btn-nav { margin-left: 0; }
  .forms { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .two-col, .pair, .statement { grid-template-columns: 1fr; }
  .two-col-center { align-items: start; }
  .two-col .palm { order: 2; transform: none; }
  .palm-trunk { display: none; }
  .apps, .mosaic { grid-template-columns: 1fr; }
  .mosaic > .ph, .mosaic > .ph.feature { grid-column: auto; }
  .mosaic > .ph.feature { aspect-ratio: 4/3; }
  .mosaic > .ph.feature > img { transform-origin: 60% 39%; }
}
@media (max-width: 560px) {
  .hero { height: clamp(420px, 70vh, 560px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .nav, .brand { transition: none; }
}
