/* ============================================
   Karikari Marae — design tokens
   Palette drawn from the peninsula itself:
   deep sea (moana), sand/dune, pōhutukawa bloom, whenua ink
   ============================================ */
:root {
  --moana-deep:  #122E29;
  --moana-mid:   #1E4E45;
  --sea-bright:  #4A9385;
  --pohutukawa:  #A6362B;
  --sand:        #F1E8D6;
  --sand-deep:   #E4D5B4;
  --whenua-ink:  #241A12;
  --paper:       #FBF7EF;
  --line:        rgba(36, 26, 18, 0.14);

  --font-display: "Spectral", Georgia, serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius: 4px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--whenua-ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.narrow { max-width: 720px; }

img, svg { max-width: 100%; display: block; }

a { color: var(--moana-mid); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--sea-bright);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 247, 239, 0.94);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--whenua-ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.header-cta {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--paper);
  background: var(--moana-deep);
  padding: 9px 18px;
  border-radius: var(--radius);
  transition: background 0.15s ease;
}
.header-cta:hover { background: var(--moana-mid); }

/* ============ Hero ============ */
.hero {
  position: relative;
  background-image:
    linear-gradient(115deg, rgba(10,15,15,0.72) 0%, rgba(10,15,15,0.5) 30%, rgba(10,15,15,0.22) 55%, rgba(10,15,15,0.08) 75%, rgba(10,15,15,0) 100%),
    url("hero-bg.jpg");
  background-size: cover;
  background-position: center;
  color: var(--paper);
  padding: 88px 0 96px;
  overflow: hidden;
}

.hero-inner { position: relative; z-index: 1; }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sea-bright);
  margin: 0 0 18px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.02;
  margin: 0 0 22px;
  letter-spacing: -0.01em;
}

.pepeha {
  margin: 28px auto 0;
  max-width: 480px;
}
.pepeha p {
  margin: 0 0 8px;
  text-align: center;
  font-size: 1.05rem;
  color: rgba(251, 247, 239, 0.92);
}
.pepeha p:last-child {
  margin-top: 10px;
  font-weight: 600;
}

.hero-sub {
  width: 100%;
  margin: 44px 0 0;
  padding: 26px 24px;
  border-top: 1px solid rgba(251, 247, 239, 0.25);
  border-bottom: 1px solid rgba(251, 247, 239, 0.25);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  text-align: center;
  color: var(--paper);
}

.horizon {
  width: 100%;
  height: 56px;
  display: block;
  color: var(--paper);
}
.horizon path { fill: currentColor; }
.horizon.flip { transform: scaleY(-1); color: var(--moana-deep); }

.closing .horizon { position: relative; z-index: 1; }

/* ============ Story sections ============ */
.story-section {
  padding: 72px 0;
}
.story-section.alt {
  background: var(--sand);
}

.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pohutukawa);
  margin: 0 0 12px;
}
.section-label.light { color: var(--sea-bright); }

.story-section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  margin: 0 0 20px;
  color: var(--whenua-ink);
  letter-spacing: -0.005em;
}

.story-section p {
  margin: 0 0 16px;
  font-size: 1.02rem;
  color: rgba(36, 26, 18, 0.88);
}

.story-section .lede {
  font-size: 1.12rem;
  line-height: 1.7;
}

.sub-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 32px 0 14px;
  color: var(--whenua-ink);
}

.tikanga-note {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.08rem;
  color: var(--moana-deep);
  border-left: 2px solid var(--pohutukawa);
  padding-left: 18px;
  margin-top: 24px;
}

/* ---- record lists (kaumātua etc.) ---- */
.record-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  border-top: 1px solid var(--line);
}
.record-list li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 4px 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.record-list .name {
  font-weight: 700;
  line-height: 1.4;
}
.record-list .detail {
  color: rgba(36, 26, 18, 0.82);
}
.record-list li > .detail:only-child {
  grid-column: 1 / -1;
}
.record-list.plain li {
  grid-template-columns: 110px 1fr;
}
.record-list.plain .name { min-width: 100px; }
@media (max-width: 480px) {
  .record-list li {
    grid-template-columns: 1fr;
  }
}


/* ---- taumata grid ---- */
.taumata-grid {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.taumata-grid li {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.taumata-grid li:nth-child(odd) { padding-right: 16px; }
.taumata-grid li:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
.patron-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pohutukawa);
  vertical-align: middle;
}

@media (max-width: 560px) {
  .taumata-grid { grid-template-columns: 1fr; }
  .taumata-grid li:nth-child(even) { padding-left: 0; border-left: none; }
}

.plans-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--pohutukawa);
  border-radius: var(--radius);
  padding: 32px 36px;
}
.plans-card .section-label { margin-bottom: 10px; }
.plans-card h2 { margin-bottom: 10px; }
.plans-card p { margin-bottom: 22px; }

.plans-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--paper);
  background: var(--pohutukawa);
  padding: 13px 26px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s ease;
}
.plans-link:hover { background: #8C2E24; }
.plans-link-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.plans-link-icon svg { width: 100%; height: 100%; }

/* ============ Timeline ============ */
.timeline-section { background: var(--paper); }

.timeline {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  border-left: 2px solid var(--sand-deep);
}
.timeline li {
  position: relative;
  padding: 4px 0 30px 28px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pohutukawa);
}
.timeline li:last-child { padding-bottom: 0; }
.tl-year {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--moana-deep);
  margin-bottom: 4px;
}
.tl-body {
  display: block;
  color: rgba(36, 26, 18, 0.85);
}

/* ============ Closing ============ */
.closing {
  background: var(--moana-deep);
  color: var(--paper);
  position: relative;
  padding-bottom: 80px;
}
.closing-inner { padding-top: 8px; }

.closing-list {
  list-style: none;
  margin: 24px 0 40px;
  padding: 0;
  display: grid;
  gap: 18px;
}
.closing-list li {
  padding-left: 22px;
  position: relative;
  color: rgba(251, 247, 239, 0.9);
  font-size: 1.02rem;
}
.closing-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 8px;
  background: var(--sea-bright);
}

.closing-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  line-height: 1.5;
  color: var(--paper);
  margin: 0;
  border-top: 1px solid rgba(251, 247, 239, 0.2);
  padding-top: 28px;
}

/* ============ Contact ============ */
.contact {
  background: var(--sand);
  padding: 80px 0 96px;
}

.contact-sub {
  font-size: 1.05rem;
  color: rgba(36, 26, 18, 0.85);
  margin-bottom: 32px;
}

.contact-form {
  display: grid;
  gap: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.form-row { display: grid; gap: 6px; }
.form-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--whenua-ink);
}
.form-row input,
.form-row textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--whenua-ink);
  resize: vertical;
}
.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--moana-mid);
}

.hidden-field { display: none; }

.contact-form button {
  justify-self: start;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--paper);
  background: var(--pohutukawa);
  border: none;
  padding: 13px 28px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease;
}
.contact-form button:hover { background: #8C2E24; }
.contact-form button:disabled { opacity: 0.6; cursor: default; }

.form-result {
  margin: 0;
  font-size: 0.9rem;
  min-height: 1.2em;
}
.form-result.success { color: #2F6B4F; }
.form-result.error { color: var(--pohutukawa); }

.mailto-fallback {
  margin-top: 22px;
  font-size: 0.92rem;
  color: rgba(36, 26, 18, 0.75);
}
.fallback-note {
  display: block;
  font-size: 0.78rem;
  color: rgba(36, 26, 18, 0.5);
  margin-top: 2px;
}

/* ============ Footer ============ */
.site-footer {
  background: var(--whenua-ink);
  color: rgba(251, 247, 239, 0.6);
  padding: 28px 0;
  font-size: 0.85rem;
  text-align: center;
}
