/* ==========================================================
   Adelaide Web Agency
   ========================================================== */

:root {
  /* Palette */
  --bg: #f6f3ec;
  --ink: #16140f;
  --ink-soft: #2b2821;
  --muted: #6b665c;
  --line: #e4ded1;
  --line-strong: #d6cdbb;
  --accent: #b5441f;
  --accent-glow: rgba(214, 96, 52, 0.28);
  --dark-bg: #16140f;

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  /* Layout */
  --container: 1120px;
  --gutter: 28px;
  --radius: 18px;
  --section-pad: 136px;
  --header-height: 72px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Fine film grain over the whole page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: #fff; }

h1, h2, h3, p { margin: 0; }
h1, h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  text-wrap: balance;
}
h1 em, h2 em { color: var(--accent); padding-right: 0.03em; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
p { text-wrap: pretty; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* Hairline that fades out at both ends */
.has-divider { position: relative; }
.has-divider::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(var(--container) - var(--gutter) * 2, 100% - var(--gutter) * 2);
  height: 1px;
  translate: -50% 0;
  background: linear-gradient(90deg, transparent, var(--line-strong) 18%, var(--line-strong) 82%, transparent);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.site-header.is-scrolled {
  background-color: rgba(246, 243, 236, 0.78);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  box-shadow: 0 1px 0 var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-height); }
.brand { display: block; flex-shrink: 0; text-decoration: none; }
.brand img { display: block; width: auto; height: 34px; }
.site-header--overlay { position: absolute; top: 0; left: 0; right: 0; }
.nav { display: flex; gap: 36px; margin-left: auto; }
.nav a {
  position: relative;
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  transition: color 0.25s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.45s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); transform-origin: left center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--ink-soft), var(--ink));
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 2px rgba(22, 20, 15, 0.22);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), filter 0.4s var(--ease);
}
.btn-small { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn-large { min-height: 58px; padding: 0 32px; font-size: 17px; }
.btn-block { display: flex; width: 100%; }
.btn-accent {
  background: linear-gradient(180deg, #c4512a, #a93e1b);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 1px 2px rgba(120, 40, 10, 0.3),
    0 10px 28px -10px rgba(181, 68, 31, 0.6);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(22, 20, 15, 0.2);
}
.btn-arrow { display: inline-block; transition: transform 0.4s var(--ease); }

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 16px 32px -14px rgba(22, 20, 15, 0.5);
  }
  .btn-accent:hover {
    filter: brightness(1.06) saturate(1.05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 20px 40px -14px rgba(181, 68, 31, 0.65);
  }
  .btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
  .btn:hover .btn-arrow { transform: translateX(4px); }
}
.btn:active { transform: scale(0.98); transition-duration: 0.12s; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 88px 0 var(--section-pad);
  text-align: center;
}
.hero-inner { max-width: 940px; }
.hero h1 { font-size: clamp(3.25rem, 9vw, 7.75rem); line-height: 0.95; }

/* Headline lines that rise out of a mask */
.split { display: flex; flex-direction: column; }
.h1-line { display: block; overflow: hidden; padding: 0.04em 0.06em 0.12em; margin: -0.04em -0.06em -0.12em; }
.h1-line > span { display: inline-block; }

.lead { margin-top: 28px; font-size: 1.15rem; color: var(--muted); }
.bob { display: inline-block; }

.hero-glow {
  position: absolute;
  z-index: -1;
  top: 52%;
  left: 50%;
  width: min(1100px, 100%);
  height: min(680px, 85%);
  translate: -50% -50%;
  background: radial-gradient(closest-side, var(--accent-glow), transparent);
  pointer-events: none;
}

/* Video, framed in a soft double bezel */
.video-shell {
  margin: 56px 0 52px;
  padding: 10px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.35));
  box-shadow:
    inset 0 0 0 1px rgba(22, 20, 15, 0.07),
    0 1px 2px rgba(22, 20, 15, 0.05),
    0 30px 60px -24px rgba(22, 20, 15, 0.3),
    0 70px 120px -50px rgba(181, 68, 31, 0.4);
}
.video {
  position: relative;
  isolation: isolate;
  aspect-ratio: 16 / 9;
  border-radius: 17px;
  overflow: hidden;
  background: var(--dark-bg);
}
.video::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -35%;
  background:
    radial-gradient(38% 48% at 28% 32%, rgba(214, 96, 52, 0.55), transparent 72%),
    radial-gradient(34% 44% at 72% 66%, rgba(140, 74, 38, 0.55), transparent 72%),
    radial-gradient(28% 36% at 58% 22%, rgba(255, 214, 170, 0.16), transparent 72%);
}
.video::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 28%),
    radial-gradient(130% 100% at 50% 110%, rgba(0, 0, 0, 0.5), transparent 55%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.video:has(iframe, video)::before,
.video:has(iframe, video)::after { display: none; }
.video iframe,
.video video { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; border: 0; }

/* ---------- Sections ---------- */
.section { position: relative; padding: var(--section-pad) 0; }
.section-title { font-size: clamp(2.75rem, 6vw, 4.75rem); margin-bottom: 64px; }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
  position: relative;
  padding: 36px 32px 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fdfcf8, #f8f5ee);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(22, 20, 15, 0.03);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s var(--ease);
}
.step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 32px;
  right: 32px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.6s var(--ease);
}
.step-num {
  display: block;
  margin-bottom: 48px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 4rem;
  line-height: 1;
  color: var(--accent);
}
.step p { margin-top: 10px; color: var(--muted); }

@media (hover: hover) {
  .step:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: inset 0 1px 0 #fff, 0 30px 50px -30px rgba(22, 20, 15, 0.3);
  }
  .step:hover::before { transform: scaleX(1); }
}

/* ---------- FAQ ---------- */
.faq-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 64px; align-items: start; }
.faq-layout .section-title { position: sticky; top: calc(var(--header-height) + 48px); margin-bottom: 0; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq details.is-animating { overflow: hidden; }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0;
  list-style: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.45s var(--ease);
}
.faq details[open]:not(.is-closing) summary::after { transform: rotate(45deg); }
.faq summary:focus-visible { outline-offset: 6px; }
.faq-answer p { max-width: 56ch; padding-bottom: 28px; color: var(--muted); }

@media (hover: hover) {
  .faq summary:hover { color: var(--accent); }
}

/* ---------- Final CTA ---------- */
.cta-final { overflow: hidden; isolation: isolate; text-align: center; }
.cta-final::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: min(900px, 100%);
  height: min(420px, 90%);
  translate: -50% -50%;
  background: radial-gradient(closest-side, rgba(214, 96, 52, 0.2), transparent);
  pointer-events: none;
}
.cta-title { font-size: clamp(3rem, 8vw, 6.5rem); margin-bottom: 48px; }

/* ---------- Footer ---------- */
.site-footer { padding: 32px 0 40px; color: var(--muted); font-size: 14px; }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; transition: color 0.25s var(--ease); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Thank-you page ---------- */
.thanks {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 48px 0;
  text-align: center;
}
.thanks h1 { font-size: clamp(3.25rem, 9vw, 6.5rem); }
.thanks .lead { margin-bottom: 44px; }

/* ==========================================================
   Motion
   .js is added in <head> only when the visitor allows motion.
   ========================================================== */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
@keyframes line-up { from { translate: 0 110%; } to { translate: 0 0; } }
@keyframes breathe { from { scale: 1; } to { scale: 1.08; } }
@keyframes drift {
  from { transform: translate3d(-6%, -4%, 0) rotate(0deg); }
  to { transform: translate3d(6%, 5%, 0) rotate(14deg); }
}
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 3px; } }

/* Intro: plays once fonts are ready (html.is-ready) */
.js .site-header,
.js .hero-glow,
.js .intro { opacity: 0; }
.js .h1-line > span { translate: 0 110%; }

.js.is-ready .site-header { animation: fade-in 0.9s var(--ease) 0.35s both; }
.js.is-ready .hero-glow { animation: fade-in 2s ease 0.2s both, breathe 9s ease-in-out 2.2s infinite alternate; }
.js.is-ready .h1-line > span { animation: line-up 1.1s var(--ease) var(--delay, 0s) both; }
.js.is-ready .intro { animation: rise-in 1s var(--ease) var(--delay, 0s) both; }

.h1-line + .h1-line > span { --delay: 0.08s; }
.intro-group > :nth-child(2) { --delay: 0.3s; }
.intro-group > :nth-child(3) { --delay: 0.42s; }
.intro-group > :nth-child(4) { --delay: 0.54s; }

/* Scroll reveal. The 3s animation is a failsafe in case main.js never runs;
   main.js adds .reveal-init, which cancels it and takes over. */
.js .reveal { opacity: 0; animation: rise-in 0.6s ease 3s both; }
.js.reveal-init .reveal { animation: none; }
.js.reveal-init .reveal.is-visible { animation: rise-in 0.9s var(--ease) var(--stagger, 0s) both; }

.steps > :nth-child(2),
.faq > :nth-child(2) { --stagger: 0.08s; }
.steps > :nth-child(3),
.faq > :nth-child(3) { --stagger: 0.16s; }
.faq > :nth-child(4) { --stagger: 0.24s; }

/* Ambient motion */
@media (prefers-reduced-motion: no-preference) {
  .video::before { animation: drift 18s ease-in-out infinite alternate; }
  .bob { animation: bob 2.6s ease-in-out infinite; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { transition-duration: 0.01ms !important; }
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 900px) {
  .faq-layout { grid-template-columns: 1fr; gap: 40px; }
  .faq-layout .section-title { position: static; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; --section-pad: 88px; --header-height: 64px; }
  body { font-size: 16px; }
  .nav { display: none; }
  .header-inner { justify-content: space-between; }
  .brand img { height: 28px; }
  .hero { padding-top: 56px; }
  .video-shell { margin: 40px 0 36px; padding: 6px; border-radius: 18px; }
  .video { border-radius: 13px; }
  .btn-large { min-height: 54px; padding: 0 28px; font-size: 16px; }
  .section-title { margin-bottom: 40px; }
  .steps { grid-template-columns: 1fr; gap: 14px; }
  .step { padding: 28px 24px 30px; }
  .step::before { left: 24px; right: 24px; }
  .step-num { margin-bottom: 28px; font-size: 3.25rem; }
}

/* Smallest phones (e.g. iPhone SE 1st gen): keep the header and headline on clean lines */
@media (max-width: 359px) {
  .hero h1 { font-size: 2.75rem; }
  .header-inner { gap: 12px; }
  .btn-small { padding: 0 14px; font-size: 13px; }
}
