/* Bambusa Krafty: www.bambusakrafty.com
   Brand colours from shops/bambusa_krafty/config.json (wood #6B4423, cane #C8893B),
   plus the backwater green and the monsoon sky they sit in. */

:root {
  --sky: #E4E9E0;
  --paper: #EFF0EB;
  --water: #23392F;
  --water-ink: #94B3A1;
  --wood: #6B4423;
  --cane: #C8893B;
  --ink: #21170F;
  --soft: #54473D;
  --on-dark: #F2F2EE;

  --display: "Fraunces", Georgia, serif;
  --text: "Inter", system-ui, sans-serif;

  /* five sizes do the work */
  --t-small: 16px;
  --t-body: 18px;
  --t-mid: clamp(22px, 2.1vw, 30px);
  --t-big: clamp(40px, 4.8vw, 68px);
  --t-hero: clamp(64px, 10.2vw, 148px);

  --m: clamp(16px, 4vw, 56px);
  --gap: 24px;
  --section: clamp(96px, 12vw, 176px);
  --bar: 72px;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--bar); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-body)/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--cane); outline-offset: 3px; }
::selection { background: var(--cane); color: var(--ink); }

h2, h3, .step-line, .foot-invite, .hero-title, .wordmark, .foot-name {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
h2, .step-line, .foot-invite { font-size: var(--t-big); }

/* Button: one shape, square corners, cane fill */
.button {
  display: inline-block;
  padding: 14px 22px;
  background: var(--cane);
  color: var(--ink);
  font: 600 var(--t-small)/1 var(--text);
  text-decoration: none;
  transition: transform .2s var(--ease), background-color .2s;
}
.button:hover { background: #D59A4E; }
.button:active { transform: translateY(1px) scale(.98); }

/* ---------- Header: takes the colour of the chapter beneath it ---------- */
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 var(--m);
  background: var(--sky);
  color: var(--ink);
  transition: background-color .3s, color .3s;
}
.bar[data-on="water"] { background: var(--water); color: var(--on-dark); }
.bar[data-on="paper"] { background: var(--paper); color: var(--ink); }
.bar[data-on="wood"]  { background: var(--wood);  color: var(--on-dark); }
.wordmark { font-size: var(--t-mid); text-decoration: none; margin-right: auto; }
.bar-links { display: flex; gap: 28px; }
.bar-links a { text-decoration: none; font-size: var(--t-small); font-weight: 500; }
.bar-links a:hover { text-decoration: underline; text-underline-offset: 6px; }

/* ---------- Hero: two fields, the waterline cuts the headline ---------- */
.hero {
  --hero-h: max(600px, 100svh);
  --seam: calc(var(--hero-h) / 2);
  --lh: 0.9;
  /* line two is cut through its upper third */
  --title-top: calc(var(--seam) - var(--t-hero) * var(--lh) * 1.32);
  position: relative;
  height: calc(var(--hero-h) + 8svh);
  overflow: hidden;
}
.field { position: absolute; left: 0; right: 0; }
.field-sky { top: 0; height: var(--seam); background: var(--sky); }
.field-water { top: var(--seam); bottom: 0; background: var(--water); }
.hero-title {
  position: absolute;
  top: var(--title-top);
  left: var(--m);
  right: var(--m);
  font-size: var(--t-hero);
  line-height: var(--lh);
  font-weight: 700;
  letter-spacing: -0.045em;
  text-align: center;
  color: var(--wood);
}
.hero-title span { display: block; }
/* Below the waterline the same words, in the colour of the water */
.waterline { pointer-events: none; position: absolute; top: var(--seam); left: 0; right: 0; bottom: 0; overflow: hidden; }
.waterline .hero-title { top: calc(var(--title-top) - var(--seam)); color: var(--water-ink); }
.hero-foot {
  position: absolute;
  left: var(--m);
  right: var(--m);
  bottom: calc(8svh + 56px);
  text-align: center;
  color: var(--on-dark);
}
.hero-lede { font-size: 20px; line-height: 1.45; max-width: 34ch; margin: 0 auto 20px; }
.hero-link { font-weight: 600; text-underline-offset: 5px; }
.hero-link:hover { color: var(--cane); }

/* ---------- Grid helper ---------- */
.craft, .boats, .steps, .contact, .foot-top {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding: var(--section) var(--m);
}

/* ---------- Craft: photo as a drop cap ---------- */
.craft { background: var(--paper); align-items: start; }
.craft-facts { grid-column: 1 / span 2; display: grid; gap: 20px; padding-top: calc(var(--t-big) + 40px); font-size: var(--t-small); }
.craft-facts strong { display: block; font-weight: 600; }
.craft-text { grid-column: 3 / span 6; }
.craft h2 { margin-bottom: 40px; }
.statement { font-family: var(--display); font-size: var(--t-mid); line-height: 1.28; letter-spacing: -0.01em; }
.statement b { font-weight: 600; }
.soft { color: var(--soft); margin-top: 28px; max-width: 52ch; }
.drop {
  float: left;
  width: 3.84em;
  height: 3.84em;
  object-fit: cover;
  margin: 0.22em 0.5em 0 0;
}
.craft-photo { grid-column: 9 / span 4; margin-top: calc(var(--t-big) + 40px); }
.craft-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.craft-photo figcaption { margin-top: 12px; font-size: var(--t-small); color: var(--soft); }

/* ---------- Band: one wide view of the lake ---------- */
.band { height: min(72svh, 56vw); overflow: hidden; background: var(--water); }
.band img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Boats: the picker ---------- */
.boats { background: var(--water); color: var(--on-dark); row-gap: 40px; }
.boats > h2 { grid-column: 1 / -1; max-width: 14ch; }
.picker { grid-column: 1 / -1; flex-wrap: wrap; gap: 8px; display: none; }
.js .picker { display: flex; }
.picker button {
  font: 600 var(--t-small)/1 var(--text);
  padding: 15px 20px;
  border: 0;
  background: #2F4B3E;
  color: var(--on-dark);
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s var(--ease);
}
.picker button:hover { background: #3A5A4A; }
.picker button:active { transform: scale(.97); }
.picker button[aria-selected="true"] { background: var(--on-dark); color: var(--water); }

.boat {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: start;
}
.js .boat[hidden] { display: none; }
.boat-photo { grid-column: 1 / span 7; overflow: hidden; aspect-ratio: 3 / 2; }
.boat-photo img { width: 100%; height: 100%; object-fit: cover; animation: drift 24s ease-in-out infinite alternate; }
.boat-text { grid-column: 9 / span 4; }
.boat-text h3 { font-size: var(--t-big); margin-bottom: 20px; }
.boat-text p { max-width: 38ch; }
.boat-model { display: block; width: 100%; max-width: 360px; margin: 36px 0 28px; }
.boat-link { display: inline-block; font-weight: 600; text-underline-offset: 5px; color: #DBA562; }
.boat-link:hover { color: var(--on-dark); }
.boat.swap .boat-text, .boat.swap .boat-photo { animation: swap .5s var(--ease) both; }
.boat.swap .boat-text { animation-delay: .08s; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.07) translateX(-1.5%); } }
@keyframes swap { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Ordering: lines that step across ---------- */
.steps { background: var(--paper); }
.steps ol { grid-column: 1 / -1; display: grid; gap: 56px; }
.steps li:nth-child(2) { margin-left: calc((100% + var(--gap)) / 12 * 2); }
.steps li:nth-child(3) { margin-left: calc((100% + var(--gap)) / 12 * 4); }
.steps li:nth-child(4) { margin-left: calc((100% + var(--gap)) / 12 * 6); }
.step-line { margin-bottom: 14px; color: var(--ink); }
.steps li:last-child .step-line { color: var(--wood); }
.steps li p:not(.step-line) { max-width: 36ch; color: var(--soft); }

/* ---------- Contact ---------- */
.contact { background: var(--sky); align-items: start; padding-bottom: 120px; }
.contact-lead { grid-column: 1 / span 6; }
.contact h2 { margin-bottom: 24px; }
.contact-lead .statement { max-width: 24ch; }
.contact-photo { grid-column: 8 / span 2; width: 100%; aspect-ratio: 1; object-fit: cover; margin-top: 8px; }
.contact-links { grid-column: 10 / span 3; padding-top: 8px; }
.contact-q { font-weight: 600; margin-bottom: 18px; }
.contact-links ul { display: grid; gap: 10px; margin-bottom: 18px; }
.contact-links a { text-underline-offset: 5px; }
.contact-links a:hover { color: var(--wood); }
.contact-note { color: var(--soft); font-size: var(--t-small); }

/* ---------- Footer: invitation over a cropped name ---------- */
.foot {
  position: relative;
  overflow: hidden;
  background: var(--wood);
  color: var(--on-dark);
  min-height: 72svh;
  display: flex;
  flex-direction: column;
}
.foot-top { padding-bottom: 48px; }
.foot-top > div { grid-column: 1 / span 7; }
.foot-invite { margin-bottom: 36px; }
.foot-links { grid-column: 10 / span 3; display: grid; gap: 12px; align-content: start; }
.foot-links a { text-underline-offset: 5px; }
.foot-links a:hover { color: var(--cane); }
.foot-legal {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding: 0 var(--m) 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #EADFD2;
}
.foot-legal p:last-child { max-width: 80ch; text-align: right; }
.foot-name {
  font-size: 19.5vw;
  font-weight: 700;
  letter-spacing: -0.05em;
  white-space: nowrap;
  line-height: .8;
  color: #E2C49B;
  padding-left: calc(var(--m) - 0.04em);
  transform: translateY(26%);
  margin-top: 8px;
}

/* ---------- Entrances (only when the script runs) ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; transition: opacity .3s; }
  .boat-photo img { animation: none; }
  .boat.swap .boat-text, .boat.swap .boat-photo { animation: none; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .bar-links { gap: 20px; }
  .craft-text { grid-column: 1 / span 7; }
  .craft-photo { grid-column: 8 / -1; margin-top: calc(var(--t-big) + 40px); }
  .craft-facts { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(3, 1fr); padding-top: 56px; }
  .boat-photo { grid-column: 1 / -1; }
  .boat-text { grid-column: 1 / -1; margin-top: 32px; display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gap); }
  .boat-text h3, .boat-text p { grid-column: 1; }
  .boat-model { grid-column: 2; grid-row: 1 / span 3; margin: 0; align-self: center; }
  .boat-link { grid-column: 1; margin-top: 20px; }
  .contact-lead { grid-column: 1 / -1; margin-bottom: 48px; }
  .contact-photo { grid-column: 1 / span 4; margin: 0; }
  .contact-links { grid-column: 6 / -1; padding: 0; }
  .foot-top > div { grid-column: 1 / span 8; }
}

/* ---------- Phone ---------- */
@media (max-width: 640px) {
  :root { --bar: 64px; --gap: 16px; --t-body: 18px; --t-small: 15px; --t-mid: 21px; --t-big: 9vw; --t-hero: 15.5vw; }
  .bar { gap: 16px; }
  .bar-links { display: none; }
  .button { padding: 13px 18px; }

  .hero { --seam: calc(var(--hero-h) * .46); }
  .hero-foot { bottom: calc(8svh + 40px); }
  .hero-lede { font-size: 18px; max-width: 28ch; }

  .craft-text, .craft-photo, .craft-facts { grid-column: 1 / -1; }
  .craft-photo { grid-row: 2; margin-top: 48px; }
  .craft-facts { grid-row: 3; grid-template-columns: 1fr 1fr 1fr; gap: 12px; padding-top: 40px; }
  .statement { line-height: 1.3; }
  .drop { width: 5.2em; height: 5.2em; }
  .band { height: 56vw; }

  .boat-text { display: block; }
  .boat-model { margin: 28px 0 20px; max-width: 280px; }
  .picker button { flex: 1 1 auto; padding: 14px 10px; }

  .steps ol { gap: 40px; }
  .steps li:nth-child(2) { margin-left: 6vw; }
  .steps li:nth-child(3) { margin-left: 12vw; }
  .steps li:nth-child(4) { margin-left: 18vw; }

  .contact-photo { grid-column: 1 / span 4; }
  .contact-links { grid-column: 5 / -1; }

  .foot-top > div, .foot-links { grid-column: 1 / -1; }
  .foot .button { display: block; text-align: center; }
  .foot-links { grid-auto-flow: column; justify-content: start; gap: 20px; margin-top: 40px; }
  .foot-legal { flex-direction: column; gap: 8px; }
  .foot-legal p:last-child { text-align: left; }
  .foot-name { font-size: 24vw; }
}

/* ---------- 404 ---------- */
.lost { min-height: 100svh; display: grid; align-content: center; gap: 24px; padding: var(--m); background: var(--water); color: var(--on-dark); }
.lost h1 { font-family: var(--display); font-size: var(--t-big); letter-spacing: -0.03em; line-height: 1; }
.lost-home { margin-left: 16px; font-weight: 600; text-underline-offset: 5px; }
