/* Midhula Farm Hut — homepage concept
   Direction: the pinned poster. Ground deepens section by section, from the cobalt of the farm's tubs
   down to the dark of a tank at night. One accent: the orange of the farm's neon sign. */

:root {
  --ground: #0b3bd1;
  --surface: rgba(255, 255, 255, 0.08);
  --ink: #ffffff;
  --muted: #c9d5ff;
  --accent: #ff7a1a;
  --accent-ink: #111111;
  --night: #040f38;

  --m: clamp(16px, 2.2vw, 32px);
  --gap: clamp(120px, 14vw, 200px);

  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.5rem, 1.2rem + 5vw, 5.5rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Epilogue", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p, h1, h2, h3, figure, ul, dl, dd { margin: 0; }
ul[role="list"] { list-style: none; padding: 0; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: fixed; left: var(--m); top: -80px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 12px 18px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* Section grounds: flat fields. When the script runs, the body carries the colour instead and
   eases from one to the next, so the page sinks rather than cuts. */
[data-ground] { background: var(--sec, transparent); }
.hero      { --sec: #0b3bd1; }
.story     { --sec: #0a2fa8; }
.fish      { --sec: #082380; }
.customers { --sec: #061a5c; }
.foot      { --sec: #040f38; }
.panel:nth-of-type(1) { --sec: #0a2a8f; }
.panel:nth-of-type(2) { --sec: #08237a; }
.panel:nth-of-type(3) { --sec: #061d66; }
.panel:nth-of-type(4) { --sec: #051852; }
html.ground-js [data-ground] { background: transparent; }

/* Buttons and links: one shape, square corners, decided once */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 500; font-size: var(--step-body); text-decoration: none;
  border: 0; border-radius: 0; cursor: pointer;
  transition: scale 0.2s var(--ease), background-color 0.2s;
}
.btn:hover { background: #ff8f3d; }
.btn:active { scale: 0.96; }
.btn--small { min-height: 40px; padding: 0 18px; font-size: 15px; }
.link {
  font-weight: 500; text-decoration: underline; text-decoration-thickness: 2px;
  text-underline-offset: 6px; transition: text-underline-offset 0.25s var(--ease), color 0.2s;
}
.link:hover { text-underline-offset: 10px; color: var(--muted); }

.h2 {
  font-size: var(--step-head); font-weight: 900; letter-spacing: -0.04em; line-height: 0.95;
  max-width: 14ch;
}
.h3 { font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.01em; }

/* ---------- Bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: 56px; padding: 0 var(--m);
  background: var(--bar-bg, #0b3bd1);
  font-size: 15px;
  transition: background-color 0.4s var(--ease), transform 0.5s var(--ease);
}
.bar.is-hidden { transform: translateY(-100%); }
.wordmark { font-weight: 900; letter-spacing: -0.03em; font-size: 19px; text-decoration: none; }
.bar__links { display: flex; gap: 24px; margin-left: auto; margin-right: 12px; }
.bar__links a { text-decoration: none; position: relative; padding: 6px 0; }
.bar__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 0.35s var(--ease);
}
.bar__links a:hover::after, .bar__links a:focus-visible::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Hero: sentence split by a frame ---------- */
.hero {
  --frame-h: calc(100svh - 168px);
  --frame-w: calc(var(--frame-h) * 0.8);
  --half: calc((100vw - var(--frame-w) - 2 * var(--m) - 56px) / 2);
  position: relative; height: 100svh; min-height: 620px; overflow: hidden;
}
.hero__title {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px var(--m) 0;
  font-size: clamp(30px, calc(var(--half) / 5.9), 96px);
  font-weight: 900; letter-spacing: -0.04em; line-height: 0.95;
}
.hero__half { display: block; white-space: nowrap; }
.hero__reel {
  position: absolute; left: 50%; top: 56px; bottom: 0; width: var(--frame-w); overflow: hidden;
  transform: translateX(-50%); z-index: 2;
}
.hero__track {
  position: absolute; left: 0; right: 0;
  top: calc((100% - var(--frame-h)) / 2);
  display: flex; flex-direction: column; gap: 24px;
  will-change: transform;
}
.frame {
  width: var(--frame-w); height: var(--frame-h); overflow: hidden; border-radius: 4px;
  background: #0a2fa8; flex: none;
}
.frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transform: scale(1.06); }
.hero__track .frame:first-child { margin-top: calc(-1 * (var(--frame-h) + 24px)); }
.hero__caption {
  position: absolute; z-index: 3; right: var(--m); bottom: 32px;
  font-size: var(--step-small); color: var(--muted); max-width: 22ch; text-align: right;
}
.hero__foot {
  position: absolute; z-index: 3; left: var(--m); bottom: 32px;
  width: min(380px, var(--half));
  display: grid; gap: 22px;
}
.hero__lead { font-size: var(--step-body); line-height: 1.45; }
.hero__actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

/* ---------- Story: the pinned name ---------- */
/* The name holds the left of the screen; the farm's pictures rise up the right. Nothing crosses it. */
.story { position: relative; padding: 0 var(--m); }
.story__pinwrap { position: absolute; inset: 0 var(--m); pointer-events: none; z-index: 2; }
.story__pin {
  position: sticky; top: 0; height: 100svh;
  width: 57vw;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(96px, 13svh, 140px) 0 48px;
}
.story__name {
  font-size: clamp(88px, 13vw, 240px); font-weight: 900; letter-spacing: -0.05em; line-height: 0.85;
  white-space: nowrap;
}
.story__intro {
  max-width: 30ch;
  font-size: var(--step-lead); line-height: 1.2; font-weight: 500; letter-spacing: -0.01em;
}
.story__items {
  position: relative; z-index: 1;
  margin-left: 59vw; width: calc(41vw - 2 * var(--m));
  display: flex; flex-direction: column; gap: 7svh;
  padding: 18svh 0 14svh;
}
.story__photo { width: 60%; }
.story__media, .panel__photo { overflow: hidden; }
.story__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.story__photo--a { align-self: flex-end; }
.story__photo--b { align-self: flex-start; }
.story__photo--c { align-self: flex-end; width: 66%; }
.story__photo figcaption {
  margin-top: 14px; font-size: var(--step-body); line-height: 1.4; max-width: 30ch;
}

/* ---------- Fish: line-up at one size ---------- */
.fish { padding: var(--gap) var(--m) calc(var(--gap) * 0.6); position: relative; }
.fish__head {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: end;
  margin-bottom: 64px;
}
.fish__head .h2 { grid-column: 1 / span 7; }
.fish__lead { grid-column: 8 / span 5; max-width: 44ch; }
.hero__lead, .fish__lead, .customers__text p, .panel__text { max-width: 60ch; }
.fish__body { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: start; }
.lineup { grid-column: 1 / span 8; }
.row {
  --row-size: var(--step-lead);
  width: 100%; display: grid; grid-template-columns: 34% 19% 1fr 40px; align-items: center; gap: 12px;
  padding: 0.55em 12px; margin: 0 -12px; width: calc(100% + 24px);
  background: transparent; border: 0; text-align: left; cursor: pointer;
  font-size: var(--row-size); line-height: 1.3;
  transition: background-color 0.25s, color 0.25s;
}
.row:hover { background: var(--surface); }
.row__kind, .row__note { color: var(--muted); }
.row__add {
  justify-self: end; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); position: relative;
  transition: background-color 0.25s, transform 0.4s var(--ease);
}
.row__add::before, .row__add::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; background: var(--ink);
  transform: translate(-50%, -50%); transition: transform 0.4s var(--ease), width 0.3s;
}
.row__add::after { transform: translate(-50%, -50%) rotate(90deg); }
.row[aria-pressed="true"] { background: rgba(255, 122, 26, 0.14); }
.row[aria-pressed="true"] .row__name { color: #ffb27a; }
.row[aria-pressed="true"] .row__add { background: var(--accent); transform: rotate(180deg); }
.row[aria-pressed="true"] .row__add::before { width: 8px; transform: translate(-90%, 1px) rotate(45deg); background: var(--accent-ink); }
.row[aria-pressed="true"] .row__add::after { width: 15px; transform: translate(-28%, -1px) rotate(-50deg); background: var(--accent-ink); }

.fish__side { grid-column: 9 / span 4; position: sticky; top: 80px; display: grid; gap: 20px; }
.fish__preview { overflow: hidden; }
.fish__preview img { max-height: calc(100svh - 300px); }
.fish__preview img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transform: scale(1.05); }
.fish__preview figcaption { margin-top: 12px; font-size: var(--step-small); color: var(--muted); }

.tray {
  display: grid; gap: 14px;
  padding: 18px; background: #0b2c9e;
}
.tray .btn { width: 100%; }
.tray__text { font-size: var(--step-lead); font-weight: 500; }
.tray__text [data-count] { display: inline-block; min-width: 1ch; font-variant-numeric: tabular-nums; }

/* ---------- Journey: one verb at a time ---------- */
.panel {
  position: relative; min-height: 100svh; overflow: hidden;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: center;
  padding: 96px var(--m);
}
.panel__word { grid-column: 1 / span 7; grid-row: 1; }
.panel__word { align-self: center; }
.verb {
  margin: 0; font-size: clamp(96px, 13vw, 240px); font-weight: 900; letter-spacing: -0.05em; line-height: 0.85;
}
.panel__photo { grid-column: 8 / span 5; grid-row: 1; align-self: center; }
.panel__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.panel__photo--square img { aspect-ratio: 1; }
@media (min-width: 901px) {
  .panel:nth-of-type(even) .panel__word { grid-column: 7 / span 6; grid-row: 1; }
  .panel:nth-of-type(even) .panel__photo { grid-column: 1 / span 5; grid-row: 1; }
}
.panel__text {
  max-width: 30ch; font-size: var(--step-lead); line-height: 1.35; margin-top: 32px;
}

/* ---------- Customers ---------- */
.customers { padding: var(--gap) var(--m); }
.customers__grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: start; }
.customers__text { grid-column: 1 / span 5; display: grid; gap: 28px; align-content: start; }
.customers__text > p:not(.ml):not(.ml-en) { max-width: 40ch; }
.customers__shot { grid-column: 7 / span 6; }
.customers__shot img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 12px; }
.stats div { display: flex; flex-direction: column-reverse; gap: 4px; }
.stats dd { font-size: var(--step-head); font-weight: 900; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stats dt { color: var(--muted); }
.ml { font-family: "Noto Sans Malayalam", var(--font); font-size: var(--step-lead); line-height: 1.6; margin-top: 16px; }
.ml-en { color: var(--muted); margin-top: -22px; }

.reels { margin-top: var(--gap); }
.reels .h3 { margin-bottom: 28px; }
.reels__strip { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: start; }
.reel { position: relative; text-decoration: none; overflow: hidden; display: block; }
.reel:nth-child(1) { grid-column: 1 / span 3; }
.reel:nth-child(2) { grid-column: 4 / span 3; margin-top: 96px; }
.reel:nth-child(3) { grid-column: 7 / span 3; margin-top: 32px; }
.reel:nth-child(4) { grid-column: 10 / span 3; margin-top: 128px; }
.reel img { width: 100%; aspect-ratio: 9 / 14; object-fit: cover; transition: transform 0.8s var(--ease); }
.reel span { display: block; margin-top: 12px; font-size: var(--step-body); }
.reel:hover img, .reel:focus-visible img { transform: scale(1.05); }

/* ---------- CTA: one word is the button ---------- */
.cta__band {
  position: relative; display: block; height: 62svh; min-height: 380px; overflow: hidden;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  padding: 28px var(--m);
  transition: background-color 0.15s, color 0.15s;
}
.cta__band:hover, .cta__band:focus-visible { background: var(--night); color: var(--accent); outline-offset: -6px; }
.cta__note { display: block; font-size: var(--step-lead); max-width: 28ch; font-weight: 500; }
.cta__arrow { position: absolute; right: var(--m); top: 28px; transition: transform 0.5s var(--ease); }
.cta__band:hover .cta__arrow { transform: translate(6px, -6px); }
.cta__word {
  position: absolute; left: var(--m); right: var(--m); bottom: 24px;
  display: flex; justify-content: space-between;
  font-size: clamp(120px, 29vw, 520px); font-weight: 900; letter-spacing: -0.05em; line-height: 0.75;
}
.cta__word span { display: inline-block; }

/* ---------- Footer ---------- */
.foot { padding: 72px var(--m) 32px; min-height: 80svh; display: flex; flex-direction: column; }
.foot__name {
  font-size: clamp(44px, 10.3vw, 190px); font-weight: 900; letter-spacing: -0.05em; line-height: 0.9;
  white-space: nowrap;
}
.foot__row { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; margin-top: 72px; }
.foot__places { grid-column: 1 / span 6; display: grid; gap: 6px; }
.foot__places a, .foot__places span {
  font-size: var(--step-lead); font-weight: 500; color: var(--accent); text-decoration: none; letter-spacing: -0.02em;
}
.foot__places span { color: var(--muted); }
.foot__places a:hover { text-decoration: underline; text-underline-offset: 6px; }
.foot__links { grid-column: 8 / span 5; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.foot__links ul { display: grid; gap: 10px; align-content: start; }
.foot__links a { font-size: 15px; text-decoration: none; }
.foot__links a:hover { text-decoration: underline; }
.foot__legal {
  margin-top: auto; padding-top: 96px; display: flex; justify-content: space-between; gap: 16px;
  font-size: 13px; color: var(--muted);
}

/* ---------- Motion helpers (set only when the script runs) ---------- */
.line-mask { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.char, .foot__inner { display: inline-block; will-change: transform; }

/* ---------- Tablet & phone ---------- */
@media (max-width: 900px) {
  .bar__links { display: none; }
  .hero {
    height: auto; min-height: 100svh; overflow: hidden;
    display: flex; flex-direction: column; padding: 76px var(--m) 28px;
  }
  .hero__title { position: static; transform: none; display: block; padding: 0; margin-bottom: 4px; font-size: 15vw; order: 1; }
  .hero__half--b { text-align: right; }
  .hero__reel {
    order: 2; position: relative; left: auto; top: auto; transform: none; width: 100%;
    height: calc((100vw - 2 * var(--m)) * 0.86 + 56px); margin: 14px 0;
    overflow: hidden;
  }
  .hero__track { top: 28px; }
  .frame { width: 100%; height: calc((100vw - 2 * var(--m)) * 0.86); }
  .hero__track .frame:first-child { margin-top: calc(-1 * ((100vw - 2 * var(--m)) * 0.86 + 24px)); }
  .hero__caption { position: static; order: 4; text-align: left; margin-top: 18px; }
  .hero__foot { position: static; order: 5; width: auto; margin-top: 12px; }
  .hero__lead { font-size: 16px; }

  .story { padding: 176px var(--m) 72px; }
  .story__pinwrap { position: static; }
  .story__pin { position: static; height: auto; width: auto; padding: 0; gap: 28px; }
  .story__name { font-size: 22vw; }
  .fish { padding-top: 112px; }
  .story__intro { font-size: clamp(22px, 4vw, 32px); max-width: none; }
  .story__items { margin: 64px 0 0; width: auto; padding: 0; gap: 56px; }
  .story__photo, .story__photo--c { width: 76%; }

  .fish__head, .fish__body, .customers__grid, .foot__row { grid-template-columns: 1fr; }
  .fish__head > *, .fish__body > *, .customers__grid > *, .foot__row > * { grid-column: 1 / -1 !important; }
  .fish__lead { margin-top: 20px; }
  .fish__preview { display: none; }
  .fish__side { position: static; margin-top: 40px; }
  .row {
    grid-template-columns: 1fr 40px; grid-template-areas: "name add" "meta add";
    row-gap: 2px; padding: 12px; font-size: 22px;
  }
  .row__name { grid-area: name; }
  .row__kind { grid-area: meta; font-size: 15px; }
  .row__note { display: none; }
  .row__add { grid-area: add; align-self: center; }
  .tray__text { font-size: 20px; }

  .panel { grid-template-columns: 1fr; align-content: center; gap: 24px; padding: 72px var(--m); min-height: 0; }
  .panel__word, .panel__photo { grid-column: 1; grid-row: auto; }
  .verb { font-size: 22vw; }
  .panel__photo { width: 78%; justify-self: end; }
  .panel__text { font-size: 18px; margin-top: 0; }

  .customers__shot { margin-top: 48px; }
  .reels__strip { grid-template-columns: 1fr 1fr; gap: 16px; }
  .reel:nth-child(n) { grid-column: auto; margin-top: 0; }
  .reel:nth-child(even) { margin-top: 48px; }

  .cta__band { height: 46svh; min-height: 320px; }
  .cta__note { font-size: 17px; max-width: 22ch; }
  .cta__arrow { width: 32px; height: 32px; }
  .cta__word { font-size: 27vw; }

  .foot { min-height: 0; }
  .foot__name { font-size: 10.4vw; }
  .foot__places a, .foot__places span { font-size: 24px; }
  .foot__links { margin-top: 48px; }
  .foot__legal { font-size: 13px; padding-top: 64px; }
}

@media (min-width: 601px) and (max-width: 900px) {
  .panel { grid-template-columns: 1fr 1fr; align-items: center; }
  .panel__word { grid-column: 1; grid-row: 1; }
  .panel__photo { grid-column: 2; grid-row: 1; width: 100%; }
  .verb { font-size: 13vw; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
