/* =========================================================
   HOBILL — hobill.com.au
   Single dark theme, static marketing site.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --pine:      #0E1512;   /* background */
  --pine-2:    #121c18;   /* raised panels */
  --bone:      #F4F1EA;   /* text */
  --bone-dim:  #cfcabb;   /* secondary text */
  --brass:     #B99B6B;   /* accent */
  --sage:      #8FA58F;   /* fine lines */

  --line:      rgba(143, 165, 143, 0.22);  /* hairline sage */
  --line-2:    rgba(244, 241, 234, 0.10);
  --brass-soft: rgba(185, 155, 107, 0.55);

  --wrap:      1200px;
  --pad:       clamp(1.25rem, 5vw, 4rem);
  --header-h:  72px;

  --ease:      cubic-bezier(0.22, 1, 0.36, 1);

  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-body:    "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--pine);
  color: var(--bone);
  font-family: var(--f-body);
  font-weight: 400;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

.section {
  position: relative;
  padding-block: clamp(6rem, 14vh, 12rem);
}

.section-index {
  position: absolute;
  top: clamp(2rem, 6vh, 4rem);
  right: var(--pad);
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(5rem, 18vw, 15rem);
  line-height: 0.8;
  color: var(--bone);
  opacity: 0.04;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.label {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--bone-dim);
  margin: 0;
}
.label--brass { color: var(--brass); }
.label--sage  { color: var(--sage); }

.section-title,
.contact-title {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-top: 1rem;
}

/* ---------- Accessibility ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: 0.5rem; left: 0.5rem;
  z-index: 200;
  background: var(--brass);
  color: #17110a;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(14, 21, 18, 0.72);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom-color: var(--line-2);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.42em;
  padding-inline-start: 0.42em; /* optical balance for tracking */
  color: var(--bone);
}
.site-nav {
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.6rem);
}
.site-nav a {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
  position: relative;
  padding-block: 0.4rem;
  transition: color 0.3s var(--ease);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0.15rem;
  width: 100%; height: 1px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--bone); }
.site-nav a:hover::after,
.site-nav a:focus-visible::after { transform: scaleX(1); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}

/* CSS placeholder behind everything */
.hero-placeholder {
  position: absolute; inset: 0; z-index: -3;
  background:
    radial-gradient(120% 90% at 70% 15%, #24382b 0%, rgba(36,56,43,0) 60%),
    radial-gradient(90% 70% at 25% 60%, rgba(143,165,143,0.08) 0%, rgba(143,165,143,0) 55%),
    radial-gradient(140% 120% at 10% 100%, #0c1310 0%, rgba(12,19,16,0) 55%),
    linear-gradient(160deg, #17281e 0%, #0b120e 60%, #0E1512 100%);
}
.hero-contours {
  position: absolute; inset: -10%;
  background-image: url("../assets/contours.svg");
  background-size: 70vmax 70vmax;
  background-position: center;
  opacity: 0.30;
  mix-blend-mode: screen;
  will-change: transform;
  animation: contourDrift 60s linear infinite alternate;
}
@keyframes contourDrift {
  from { transform: translate3d(-3%, -2%, 0) scale(1.05); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.12); }
}

.hero-video {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover;
  /* Hidden until JS confirms it can play; also hidden on error */
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.hero-video.is-ready { opacity: 1; }

.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(14,21,18,0.55) 0%, rgba(14,21,18,0.15) 32%, rgba(14,21,18,0.55) 70%, rgba(14,21,18,0.96) 100%),
    radial-gradient(90% 70% at 30% 80%, rgba(14,21,18,0.5), rgba(14,21,18,0));
}

.hero-content {
  padding-bottom: clamp(6rem, 16vh, 11rem);
  will-change: transform, opacity;
}
.hero-title {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(2.9rem, 9.5vw, 8rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-top: 1.1rem;
  max-width: 16ch;
}
.hero-sub {
  margin-top: 1.6rem;
  max-width: 40ch;
  color: var(--bone-dim);
  font-weight: 300;
  font-size: clamp(1rem, 0.95rem + 0.5vw, 1.35rem);
  line-height: 1.5;
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  left: 50%; bottom: 1.6rem;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 0.7rem;
  z-index: 2;
}
.scroll-cue__line {
  width: 1px; height: 46px;
  background: linear-gradient(var(--brass), rgba(185,155,107,0));
  transform-origin: top;
  animation: cueSlide 2.4s var(--ease) infinite;
}
@keyframes cueSlide {
  0%   { transform: scaleY(0.2); opacity: 0; }
  35%  { opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}
.scroll-cue__text {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--bone-dim);
}

/* ---------- ETHOS ---------- */
.ethos-inner { max-width: 62rem; }
.ethos-statement {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  line-height: 1.16;
  letter-spacing: -0.01em;
  margin-top: 1.6rem;
}
.ethos-statement span { display: block; }
.ethos-statement span + span { margin-top: 0.6rem; color: var(--bone-dim); }

/* ---------- APPROACH / PLAT ---------- */
.approach-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(3rem, 6vw, 5rem);
  align-items: start;
}
.approach-list { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.approach-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 1.4rem;
  padding-block: 1.6rem;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.approach-item:last-child { border-bottom: 1px solid var(--line); }
.approach-item__tick {
  font-family: var(--f-body);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--brass);
  grid-row: 1 / span 2;
  padding-top: 0.35rem;
}
.approach-item h3 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  line-height: 1.1;
}
.approach-item p {
  margin-top: 0.5rem;
  color: var(--bone-dim);
  font-weight: 300;
  max-width: 46ch;
}

/* Plat figure */
.plat { margin: 0; }
.plat__frame {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(18,28,24,0.6), rgba(14,21,18,0.6));
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: 2px;
}
.plat__frame::before {
  /* corner survey crosses */
  content: "";
  position: absolute; inset: 10px;
  background-image:
    linear-gradient(var(--brass-soft), var(--brass-soft)),
    linear-gradient(var(--brass-soft), var(--brass-soft));
  background-size: 12px 1px, 1px 12px;
  background-position: top left, top left;
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0.6;
}
.plat-svg { width: 100%; height: auto; }

.plat-svg .plat-draw path,
.plat-svg .plat-draw circle {
  fill: none;
  stroke: var(--sage);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  /* dash setup for scroll-draw; pathLength normalised to 1 */
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.plat-svg .plat-frame path { stroke: var(--brass); stroke-width: 1.6; }
.plat-svg .plat-creek path { stroke: var(--brass-soft); }
.plat-svg .plat-contours path { stroke-width: 1; opacity: 0.7; }
.plat-svg .plat-corridor path {
  fill: none;
  stroke: var(--brass-soft);
  stroke-width: 1;
  stroke-dasharray: 6 5;
}
.plat-svg .plat-north path { fill: var(--brass); stroke: none; }
.plat-svg .north-n {
  fill: var(--bone-dim); font-family: var(--f-body); font-size: 12px; text-anchor: middle;
}
.plat-svg .plat-scale line { stroke: var(--sage); stroke-width: 1; }
.plat-svg .scale-txt { fill: var(--bone-dim); font-family: var(--f-body); font-size: 11px; }
.plat-svg .plat-cross path { stroke: var(--brass); stroke-width: 1; fill: none; }

/* labels fade in with the draw */
.plat-svg .plat-labels { opacity: 0; transition: opacity 0.8s var(--ease); }
.plat.is-drawn .plat-svg .plat-labels { opacity: 1; }

.plat__cap { margin-top: 1rem; text-align: right; color: var(--bone-dim); }

/* Progressive enhancement: CSS scroll-driven draw where supported.
   JS also drives it; the animation-timeline simply refines it. */
@supports (animation-timeline: view()) {
  .plat-svg .plat-draw path,
  .plat-svg .plat-draw circle {
    animation: platDraw linear forwards;
    animation-timeline: view();
    animation-range: entry 15% cover 55%;
  }
  @keyframes platDraw { to { stroke-dashoffset: 0; } }
}

/* ---------- SCROLL STORY ---------- */
.story {
  position: relative;
  height: 300vh;         /* tall scroll track */
}
.story-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}
.story-stage {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.7s var(--ease);
  will-change: opacity;
}
.story-stage.is-active { opacity: 1; }
/* First stage visible by default (no-js / reduced-motion) */
.story-stage[data-stage="0"] { opacity: 1; }

.story-ph { position: absolute; inset: 0; }
.story-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Subtle sage wash behind the stewardship statement */
.stewardship {
  background: radial-gradient(60% 55% at 50% 0%, rgba(143,165,143,0.07), transparent 70%);
}

/* Stage 1 — rainforest canopy, mist */
.story-ph--canopy {
  background:
    radial-gradient(90% 70% at 30% 30%, rgba(244,241,234,0.05) 0%, rgba(244,241,234,0) 55%),
    radial-gradient(80% 60% at 35% 45%, #2a3f2e 0%, rgba(42,63,46,0) 60%),
    repeating-radial-gradient(circle at 60% 60%, rgba(0,0,0,0.08) 0 14px, rgba(255,255,255,0.012) 14px 28px),
    linear-gradient(150deg, #1a2a1f 0%, #10190f00 40%, #0c1410 100%),
    linear-gradient(#152019, #0e1613);
}
/* Stage 2 — deep forest interior, soft warm glow (the bird) */
.story-ph--life {
  background:
    radial-gradient(38% 32% at 62% 44%, rgba(185,155,107,0.14) 0%, rgba(185,155,107,0) 65%),
    radial-gradient(70% 60% at 30% 60%, #22352a 0%, rgba(34,53,42,0) 60%),
    linear-gradient(150deg, #142218 0%, #0a110d 100%);
}
/* Stage 3 — golden-hour open farmland */
.story-ph--land {
  background:
    linear-gradient(115deg, rgba(185,155,107,0.16), rgba(185,155,107,0) 55%),
    radial-gradient(90% 70% at 70% 75%, #33402c 0%, rgba(51,64,44,0) 55%),
    radial-gradient(60% 45% at 78% 30%, rgba(244,241,234,0.06) 0%, rgba(244,241,234,0) 60%),
    linear-gradient(150deg, #24301f 0%, #161c13 55%, #10140e 100%);
}

.story-scrim {
  position: absolute; inset: 0; z-index: 3;
  background: linear-gradient(180deg, rgba(14,21,18,0.35) 0%, rgba(14,21,18,0) 30%, rgba(14,21,18,0.25) 55%, rgba(14,21,18,0.9) 100%);
  pointer-events: none;
}
.story-caption {
  position: absolute;
  left: 0; right: 0; bottom: clamp(3rem, 10vh, 6rem);
  z-index: 4;
}
.story-stage-no { color: var(--brass); }
.story-cap-text {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-top: 0.6rem;
}
.story-progress {
  margin-top: 1.6rem;
  width: min(240px, 60vw);
  height: 1px;
  background: var(--line-2);
  position: relative;
}
.story-progress__bar {
  position: absolute; inset: 0 auto 0 0;
  width: 33%;
  background: var(--brass);
  transition: width 0.3s var(--ease);
}

/* ---------- QUIET SIGNALS ---------- */
.signals { padding-block: clamp(4rem, 9vh, 7rem); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.signals-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 4vw, 3rem);
  text-align: center;
}
.signal {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(1.1rem, 2.6vw, 1.75rem);
  color: var(--bone);
  letter-spacing: 0.01em;
}
.signal-rule { width: 1px; height: 1.6em; background: var(--line); }

/* ---------- CONTACT ---------- */
.contact-inner { max-width: 60rem; }
.contact-title { margin-bottom: clamp(2rem, 5vw, 3.5rem); }

/* ----- contact form ----- */
.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.4rem, 3vw, 2.2rem) clamp(1.6rem, 4vw, 3rem);
  max-width: 46rem;
}
.field { display: flex; flex-direction: column; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-family: var(--f-body);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 0.7rem;
}
.field input,
.field textarea {
  font-family: var(--f-body);
  font-size: 1.05rem;
  color: var(--bone);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-2);
  padding: 0.55rem 0.1rem;
  border-radius: 0;
  transition: border-color 0.35s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 3.2em; line-height: 1.5; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--brass);
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(244,241,234,0.3); }

/* honeypot — visually removed, kept in flow for bots */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}

.form-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1.5rem 2rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.btn-send {
  position: relative;
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  color: var(--bone);
  background: none;
  border: none;
  padding: 0 0.15em 0.12em 0;
  cursor: pointer;
  letter-spacing: -0.01em;
}
.btn-send__line {
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--brass);
  transform: scaleX(1);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.btn-send:hover .btn-send__line,
.btn-send:focus-visible .btn-send__line { transform: scaleX(0); transform-origin: right; }
.btn-send:hover, .btn-send:focus-visible { color: var(--brass); }
.btn-send[disabled] { opacity: 0.5; cursor: default; }
.btn-send[disabled] .btn-send__line { transform: scaleX(1); }

.form-status {
  font-family: var(--f-body);
  font-size: 0.85rem;
  color: var(--bone-dim);
  margin: 0;
  min-height: 1.2em;
}
.form-status.is-error { color: #cf9b7c; }
.form-status.is-ok { color: var(--sage); }

/* When submitted OK, fade the form fields back and let the message stand */
.contact-form.is-sent .field,
.contact-form.is-sent .btn-send { opacity: 0.35; pointer-events: none; }

@media (max-width: 640px) {
  .contact-form { grid-template-columns: 1fr; }
}

/* ---------- FOOTER ---------- */
.site-footer {
  border-top: 1px solid var(--line-2);
  padding-block: clamp(2.5rem, 6vh, 4rem);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2rem;
  align-items: center;
  justify-content: space-between;
}
.footer-mark {
  font-weight: 500;
  letter-spacing: 0.32em;
  font-size: 0.85rem;
}
.footer-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: var(--bone-dim);
  font-size: 0.8rem;
}
.footer-abn { color: rgba(244,241,234,0.42); }

/* =========================================================
   REVEAL SYSTEM — only active when JS is present.
   Without JS the content stays fully visible.
   ========================================================= */
.js .reveal,
.js .reveal-words span {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(6px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease),
    filter 0.9s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.js .reveal.is-visible,
.js .reveal-words.is-visible span {
  opacity: 1;
  transform: none;
  filter: blur(0);
}
.js .reveal-words.is-visible span:nth-child(2) { transition-delay: 0.14s; }

/* Header starts hidden state offset handled in JS; hero content parallax via CSS var */
.js .hero-content { transition: opacity 0.2s linear; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (min-width: 900px) {
  :root { --header-h: 80px; }
  .approach-inner {
    grid-template-columns: 1fr 1.05fr;
    gap: clamp(3rem, 6vw, 6rem);
  }
  .plat { position: sticky; top: 120px; }
}

@media (max-width: 560px) {
  .site-nav { gap: 1.1rem; }
  .wordmark { letter-spacing: 0.3em; }
  .section-index { opacity: 0.05; }
}

/* Scroll-margin so anchors clear the fixed header */
[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

/* =========================================================
   REDUCED MOTION — soften/disable all motion.
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-contours { animation: none; }
  .scroll-cue__line { animation: none; opacity: 0.6; }
  /* Ensure revealed content is simply shown */
  .js .reveal,
  .js .reveal-words span { opacity: 1 !important; transform: none !important; filter: none !important; }
  .story-stage { transition: none; }
  .plat-svg .plat-draw path,
  .plat-svg .plat-draw circle { stroke-dashoffset: 0 !important; }
  .plat .plat-svg .plat-labels { opacity: 1 !important; }
}
