/* Te Hapori Hōiho — v3 (direction D)
   Layout: rounded photographic "cards" inset 16px from the window edge, alternating with open oat sections on a 1200px column. */
:root {
  --oat: #f6f2ec;
  --sand: #ece3d6;
  --umber: #231b14;
  --umber-2: #4a3d30;
  --clay: #b5643c;
  --clay-ink: #a0552f;
  --ochre: #c3913f;
  --gold: #d9b16f;
  --moss: #5d6440;
  --sage: #e4e6d7;
  --sage-ink: #5d6648;
  --muted: #6a5d50;
  --head: "Outfit", "Helvetica Neue", Arial, sans-serif;
  --body: "Albert Sans", "Helvetica Neue", Arial, sans-serif;
  --r-xl: 28px;
  --r-lg: 24px;
  --r-md: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--oat); color: var(--umber); font-family: var(--body); font-size: 1.0625rem; line-height: 1.65; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--clay-ink); }
a:hover { color: var(--umber); }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--head); font-weight: 500; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); line-height: 1.05; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2rem); line-height: 1.25; letter-spacing: -.01em; }
h3 { font-size: 1.2rem; line-height: 1.3; }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.inset { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.section { padding-block: clamp(64px, 9vw, 96px); }
.eyebrow { font-size: .8125rem; font-weight: 500; color: var(--clay-ink); }
.on-dark .eyebrow { color: var(--gold); }
.muted { color: var(--muted); }
.head { display: grid; gap: 10px; margin-bottom: clamp(28px, 4vw, 40px); }
.head p { max-width: 60ch; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 600; font-size: .9375rem; line-height: 1.2; padding: 14px 24px; border-radius: 999px; border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s; }
.btn--light { background: var(--oat); color: var(--umber); }
.btn--light:hover { background: var(--gold); color: var(--umber); }
.btn--outline { border-color: rgba(246,242,236,.6); color: var(--oat); }
.btn--outline:hover { background: var(--oat); color: var(--umber); }
.btn--dark { background: var(--umber); color: var(--oat); }
.btn--dark:hover { background: var(--clay); color: #fff; }
.btn--ochre { background: var(--ochre); color: var(--umber); }
.btn--ochre:hover { background: var(--oat); color: var(--umber); }
.btn--white { background: #fff; color: var(--umber); }
.btn--white:hover { background: var(--umber); color: #fff; }
.btn--line { border-color: var(--umber); color: var(--umber); }
.btn--line:hover { background: var(--umber); color: var(--oat); }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* Rounded photo card used for heroes and features */
.photo { position: relative; background-color: var(--umber-2); background-size: cover; background-position: center; color: var(--oat); isolation: isolate; overflow: hidden; border-radius: var(--r-xl); }
.photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(35,27,20,.45) 0%, rgba(35,27,20,.1) 30%, rgba(35,27,20,.78) 100%); }

/* Header (sits inside the hero card) */
.site-header { position: relative; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px clamp(18px, 2.4vw, 28px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--oat); }
.brand:hover { color: var(--oat); }
.brand img { width: 42px; height: 42px; object-fit: contain; border-radius: 12px; }
.brand span { font-family: var(--head); font-weight: 600; font-size: 1.0625rem; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px; background: rgba(246,242,236,.14); backdrop-filter: blur(10px); }
.nav a { text-decoration: none; color: var(--oat); font-size: .875rem; font-weight: 500; padding: 8px 14px; border-radius: 999px; transition: background .2s; }
.nav a:hover { background: rgba(246,242,236,.16); color: var(--oat); }
.nav a[aria-current="page"] { background: var(--oat); color: var(--umber); }
.koha-btn { padding: 11px 20px; font-size: .875rem; }
.menu-btn { display: none; align-items: center; gap: 8px; background: rgba(246,242,236,.16); color: var(--oat); border: 0; border-radius: 999px; padding: 11px 18px; font: 600 .875rem var(--body); cursor: pointer; }
.menu-btn svg { width: 18px; height: 18px; }
@media (max-width: 1020px) {
  .menu-btn { display: inline-flex; }
  .site-header .koha-btn { display: none; }
  .nav { display: none; order: 3; width: 100%; flex-direction: column; align-items: stretch; border-radius: var(--r-md); background: rgba(35,27,20,.88); padding: 8px; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 16px; border-radius: 14px; font-size: 1rem; }
  .nav .nav-koha { background: var(--ochre); color: var(--umber); text-align: center; margin-top: 6px; }
}
@media (min-width: 1021px) { .nav .nav-koha { display: none; } }

/* Home hero */
.hero-shell { padding-top: max(16px, env(safe-area-inset-top, 0px)); }
.hero { min-height: min(92vh, 780px); display: flex; flex-direction: column; }
.hero-body { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 20px; padding: 0 clamp(22px, 4vw, 48px) clamp(32px, 4.5vw, 56px); }
.hero h1 { max-width: 16ch; }
.chip { align-self: flex-start; font-size: .8125rem; font-weight: 500; background: rgba(246,242,236,.16); backdrop-filter: blur(6px); padding: 6px 14px; border-radius: 999px; }
.hero-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px; }
.hero-foot p { max-width: 46ch; color: rgba(246,242,236,.88); }

/* Inner page hero */
.page-hero { min-height: min(62vh, 520px); display: flex; flex-direction: column; }
.page-hero .hero-body { gap: 16px; }
.page-hero p.intro { max-width: 54ch; color: rgba(246,242,236,.88); font-size: 1.125rem; }

/* Two-column intro */
.intro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(28px, 5vw, 56px); align-items: start; }
.intro-grid .text { display: grid; gap: 16px; color: var(--muted); }
@media (min-width: 700px) { .intro-grid .text { padding-top: 34px; } }

/* Bento */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 280px 280px; gap: 16px; }
.tile { position: relative; border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; text-decoration: none; overflow: hidden; isolation: isolate; min-width: 0; }
.tile .t { font-family: var(--head); font-size: 1.5rem; font-weight: 500; line-height: 1.2; }
.tile .s { font-size: .9375rem; }
.tile.img { color: var(--oat); background: var(--umber-2) center / cover no-repeat; }
.tile.img::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, rgba(35,27,20,.82)); }
.tile.img .bgz { position: absolute; inset: 0; z-index: -2; background: inherit; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.tile.img:hover .bgz { transform: scale(1.05); }
.tile.img:hover { color: var(--oat); }
.tile.tall { grid-row: span 2; }
.tile.tall .t { font-size: 1.75rem; }
.tile.sage { background: var(--sage); color: var(--umber); }
.tile.sage .s { color: var(--sage-ink); }
.tile.sage:hover { background: #d9dcc8; color: var(--umber); }
.tile.values { grid-column: span 2; background: var(--umber); color: var(--oat); justify-content: center; gap: 18px; padding: 32px; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pills span { background: rgba(246,242,236,.1); padding: 10px 18px; border-radius: 999px; font-weight: 500; }
@media (max-width: 860px) {
  .bento { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .tile { min-height: 220px; }
  .tile.tall { grid-row: auto; grid-column: span 2; min-height: 320px; }
  .tile.values { grid-column: span 2; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
  .tile.tall, .tile.values { grid-column: auto; }
}

/* Feature: dark split with photo */
.feature { border-radius: var(--r-xl); background: var(--umber); color: var(--oat); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); overflow: hidden; }
.feature .pic { min-height: clamp(320px, 40vw, 540px); background: var(--umber-2) center / cover no-repeat; position: relative; }
.feature .pic small { position: absolute; left: 16px; bottom: 14px; font-size: .75rem; background: rgba(35,27,20,.6); padding: 5px 10px; border-radius: 999px; }
.feature .pic small a { color: inherit; }
.feature .copy { padding: clamp(36px, 5vw, 64px) clamp(26px, 4.5vw, 56px); display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.feature .copy p { color: rgba(246,242,236,.8); }
.feature .btn { align-self: flex-start; }

/* Soft cards grid */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 16px; }
.card { background: var(--sand); border-radius: var(--r-md); padding: 26px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card p { font-size: .9375rem; color: var(--muted); }
.card ul { margin: 0; padding-left: 1.1em; font-size: .9375rem; color: var(--muted); display: grid; gap: 4px; }

/* Moss band */
.band { border-radius: var(--r-xl); background: var(--moss); color: var(--oat); }
.band .inner { max-width: 1000px; margin-inline: auto; padding: clamp(56px, 8vw, 88px) clamp(26px, 4vw, 40px); display: grid; gap: 22px; }
.band .reo { font-family: var(--head); font-size: clamp(1.35rem, 2.6vw, 1.75rem); line-height: 1.4; font-weight: 400; }
.band .en { color: rgba(246,242,236,.82); max-width: 60ch; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; align-items: stretch; }
.plan { border-radius: var(--r-lg); padding: 32px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.plan .price { font-family: var(--head); font-size: 1.875rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.plan .price span { font-family: var(--body); font-size: .9375rem; font-weight: 400; opacity: .75; }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; font-size: .9375rem; }
.plan li { padding-block: 9px; border-top: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 16%, transparent); }
.plan .btns { margin-top: auto; padding-top: 10px; }
.plan--sand { background: var(--sand); }
.plan--sand .tag { color: var(--clay-ink); }
.plan--dark { background: var(--umber); color: var(--oat); }
.plan--dark .tag { color: var(--gold); }
.plan--clay { background: var(--clay); color: #fff; }
.tag { font-size: .8125rem; font-weight: 500; }

/* About */
.statement { font-family: var(--head); font-size: clamp(1.4rem, 2.6vw, 1.75rem); line-height: 1.4; font-weight: 400; max-width: 36ch; }
.trustees { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 40px 20px; }
.trustee { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.trustee .portrait { aspect-ratio: 4 / 5; max-width: 100%; border-radius: var(--r-md); background: var(--sand) center top / cover no-repeat; margin-bottom: 8px; }
.trustee .role { align-self: flex-start; font-size: .75rem; font-weight: 600; background: var(--clay); color: #fff; padding: 4px 12px; border-radius: 999px; }
.trustee .iwi { font-size: .875rem; font-weight: 600; color: var(--clay-ink); }
.trustee .bio { font-size: .9375rem; color: var(--muted); }

/* Culture timeline */
.timeline { display: grid; gap: 16px; }
.moment { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(20px, 4vw, 56px); background: var(--sand); border-radius: var(--r-lg); padding: clamp(26px, 4vw, 44px); }
.moment .mark { font-family: var(--head); font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 500; color: var(--clay-ink); line-height: 1.1; }
.moment .text { display: grid; gap: 14px; color: var(--muted); }
.moment .text .lead { color: var(--umber); font-size: 1.125rem; }
@media (max-width: 760px) { .moment { grid-template-columns: 1fr; } }
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.links a, .links span { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 22px; border-radius: var(--r-md); background: rgba(246,242,236,.08); color: var(--oat); text-decoration: none; font-weight: 600; }
.links a::after { content: "↗"; flex: none; }
.links a:hover { background: var(--ochre); color: var(--umber); }
.links span { color: rgba(246,242,236,.6); }

/* Code of conduct */
.doc { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.toc { position: sticky; top: 24px; background: var(--sand); border-radius: var(--r-md); padding: 20px; display: grid; gap: 2px; }
.toc .tag { color: var(--clay-ink); padding: 0 12px 8px; }
.toc a { text-decoration: none; color: var(--umber); padding: 10px 12px; border-radius: 12px; font-weight: 500; }
.toc a:hover { background: var(--oat); color: var(--umber); }
.doc-body { display: grid; gap: 1.1em; max-width: 64ch; }
.doc-body h2 { margin-top: 1.2em; scroll-margin-top: 24px; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body .lead { font-size: 1.125rem; }
.doc-body ol { margin: 0; padding: 0; list-style: none; counter-reset: m; display: grid; gap: 10px; }
.doc-body ol li { counter-increment: m; display: grid; grid-template-columns: 2.2rem 1fr; gap: 12px; background: var(--sand); border-radius: 16px; padding: 16px 18px; font-size: .9875rem; }
.doc-body ol li::before { content: counter(m); font-family: var(--head); font-weight: 500; color: var(--clay-ink); font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .doc { grid-template-columns: 1fr; } .toc { position: static; } }

/* Footer */
.site-footer { padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
.foot { border-radius: var(--r-xl); background: var(--umber); color: #cfc4b4; padding: clamp(36px, 5vw, 56px) clamp(24px, 4vw, 44px) 26px; display: grid; gap: 36px; font-size: .9375rem; }
.foot-top { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.foot .name { font-family: var(--head); font-weight: 600; color: var(--oat); font-size: 1.25rem; margin-bottom: 6px; }
.foot .col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.foot .col .tag { color: var(--gold); margin-bottom: 2px; }
.foot a { color: #cfc4b4; text-decoration: none; overflow-wrap: anywhere; }
.foot a:hover { color: var(--oat); }
.foot a.btn, .foot a.btn:hover { color: var(--umber); }
.foot-bottom { border-top: 1px solid rgba(246,242,236,.14); padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: .8125rem; color: #8f8473; }
.foot .btn { align-self: flex-start; margin-top: 12px; }
@media (max-width: 900px) { .foot-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-top { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .tile.img .bgz { transition: none; } }

/* Junior sign-up form */
.form-layout { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 56px); align-items: start; }
.form-aside { display: grid; gap: 16px; position: sticky; top: 24px; }
@media (max-width: 900px) { .form-layout { grid-template-columns: 1fr; } .form-aside { position: static; } }
.form { display: grid; gap: 20px; }
.form fieldset { border: 0; margin: 0; padding: clamp(22px, 3vw, 32px); background: var(--sand); border-radius: var(--r-lg); display: grid; gap: 18px; min-width: 0; }
.form legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-family: var(--head); font-size: 1.25rem; font-weight: 500; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-weight: 600; font-size: .9375rem; }
.field .opt { font-weight: 400; color: var(--muted); }
.field .hint { font-size: .875rem; color: var(--muted); margin-top: -2px; }
.field input:not([type=radio]):not([type=checkbox]), .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--umber); background: var(--oat);
  border: 1.5px solid rgba(35,27,20,.18); border-radius: 14px; padding: 12px 14px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px rgba(181,100,60,.18); }
.field [aria-invalid="true"] { border-color: #b3261e !important; box-shadow: 0 0 0 3px rgba(179,38,30,.14); }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; cursor: pointer; }
.choices .choice { background: var(--oat); border: 1.5px solid rgba(35,27,20,.18); border-radius: 999px; padding: 10px 18px; align-items: center; }
.choices .choice:has(input:checked) { border-color: var(--clay); background: #f7e6dc; }
.choice input { accent-color: var(--clay); width: 18px; height: 18px; margin: 2px 0 0; flex: none; }
.choices:has([aria-invalid="true"]) .choice { border-color: #b3261e; }
.consent { background: var(--sage); border-radius: var(--r-md); padding: 18px 20px; }
.consent .choice { font-weight: 400; font-size: .9375rem; }
.consent:has([aria-invalid="true"]) { box-shadow: inset 0 0 0 2px #b3261e; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-error { background: #fbe9e7; color: #8c1d18; border-radius: 14px; padding: 14px 16px; font-weight: 500; }
.form .btn { justify-self: start; border: 0; cursor: pointer; font-family: var(--body); }
.form .btn:disabled { opacity: .6; cursor: progress; }
.done { background: var(--sand); border-radius: var(--r-lg); padding: clamp(28px, 4vw, 44px); display: grid; gap: 14px; }
.done:focus { outline: none; }
.done .btn { border: 0; cursor: pointer; font-family: var(--body); }
.done .btn--line { border: 1px solid var(--umber); background: transparent; }

/* Admin */
.admin-body { min-height: 100vh; }
.admin-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.admin-top .brand { color: var(--umber); }
.admin-top .brand:hover { color: var(--umber); }
.login { max-width: 420px; margin: clamp(40px, 10vh, 120px) auto; background: var(--sand); border-radius: var(--r-xl); padding: 36px; display: grid; gap: 18px; }
.login .btn { border: 0; cursor: pointer; font-family: var(--body); }
.admin-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.admin-bar input[type=search] { font: inherit; padding: 11px 16px; border-radius: 999px; border: 1.5px solid rgba(35,27,20,.18); background: #fff; min-width: min(100%, 320px); }
.admin-bar .btn { border: 0; cursor: pointer; font-family: var(--body); }
.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat { background: var(--sand); border-radius: 999px; padding: 8px 16px; font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--r-lg); border: 1px solid rgba(35,27,20,.1); }
.subs { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.subs th { text-align: left; font-size: .8125rem; font-weight: 600; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid rgba(35,27,20,.1); white-space: nowrap; background: var(--oat); }
.subs td { padding: 14px 16px; border-bottom: 1px solid rgba(35,27,20,.07); vertical-align: top; }
.subs td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.subs tr.detail td { background: var(--oat); }
.subs .row-btn { font: inherit; font-weight: 600; color: var(--clay-ink); background: none; border: 0; padding: 0; cursor: pointer; }
.pill { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: .8125rem; font-weight: 600; border: 0; cursor: pointer; font-family: var(--body); }
.pill.paid { background: #e3ead6; color: #3c4a22; }
.pill.unpaid { background: #f7e6dc; color: #8a3f1c; }
.dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 0; }
.dl dt { font-weight: 600; color: var(--muted); font-size: .875rem; }
.dl dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-actions { display: flex; gap: 12px; margin-top: 16px; }
.danger { font: inherit; font-size: .875rem; font-weight: 600; color: #8c1d18; background: none; border: 1px solid #e3b5b1; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
@media (max-width: 600px) { .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 10px; } }
