/* premium-ui-design tokens (accent swapped to the Cairns Fencing brand orange)
   Based on measured apple.com values and Material 3 accessibility floors.
   Swap --accent values for the client's brand colour. Keep exactly one accent. */

:root {
  /* Surfaces */
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --bg-dark: #000000;
  --bg-nav: rgba(250, 250, 252, 0.8);

  /* Text */
  --ink: #1d1d1f;
  --ink-2: #6e6e73;        /* small secondary text, passes AA on white */
  --ink-3: #86868b;        /* large or decorative text only */
  --ink-on-dark: #f5f5f7;
  --ink-2-on-dark: #a1a1a6;

  /* Lines */
  --hairline: #d2d2d7;
  --hairline-soft: rgba(0, 0, 0, 0.08);

  /* The one accent. Used only on interactive elements. */
  --accent: #b84a12;   /* Cairns Fencing orange, darkened to pass 5.2:1 with white */
  --accent-hover: #a8430f;
  --accent-press: #9a3c0c;
  --link: #b84a12;          /* inline links on light */
  --link-on-dark: #2997ff;  /* links and outline buttons on dark */
  --focus: rgba(184, 74, 18, 0.3);

  /* Semantic */
  --error: #e30000;
  --success: #008009;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  /* Spacing, 8px base */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 40px;
  --s-7: 64px;
  --s-8: 80px;
  --s-9: 120px;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 980px;

  /* Motion */
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --t-fast: 200ms;
  --t-base: 400ms;
  --t-slow: 600ms;

  /* Layout */
  --max: 1080px;
  --gutter: 24px;
  --nav-h: 44px;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #000000;
    --bg-alt: #161617;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --hairline: #424245;
    --bg-nav: rgba(22, 22, 23, 0.8);
    --link: #2997ff;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Type scale */
.display {
  font-size: clamp(40px, 7vw, 80px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}
.headline {
  font-size: clamp(32px, 4.5vw, 48px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0;
}
.subhead {
  font-size: clamp(28px, 3vw, 34px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.lede {
  font-size: clamp(19px, 2vw, 21px);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: 0.011em;
  color: var(--ink-2);
  margin: 0;
}
.small { font-size: 14px; line-height: 1.3; letter-spacing: -0.016em; }
.caption { font-size: 12px; line-height: 1.33; letter-spacing: -0.01em; color: var(--ink-2); }
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
p { margin: 0 0 1em; max-width: 34em; }

/* Layout */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.band {
  padding: var(--s-7) 0;
  background: var(--bg);
}
.band--alt  { background: var(--bg-alt); }
.band--dark { background: var(--bg-dark); color: var(--ink-on-dark); }
.band--dark .lede, .band--dark .caption, .band--dark .eyebrow { color: var(--ink-2-on-dark); }
.band--center { text-align: center; }
.band--center p, .band--center .lede { margin-left: auto; margin-right: auto; }

@media (min-width: 768px) {
  .band { padding: var(--s-9) 0; }
}

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-5); }

/* Buttons: one shape, the pill */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 21px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font: inherit;
  font-size: 17px;
  letter-spacing: -0.022em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:active { background: var(--accent-press); }
.btn--secondary { background: transparent; color: var(--link); border-color: var(--link); }
.btn--secondary:hover { background: rgba(184, 74, 18, 0.06); }
.band--dark .btn--secondary { color: var(--link-on-dark); border-color: var(--link-on-dark); }

.btn:focus-visible, .link:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
}

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: center; }

/* Inline link with chevron */
.link { color: var(--link); text-decoration: none; }
.link:hover { text-decoration: underline; }
.band--dark .link { color: var(--link-on-dark); }
.link--chev::after { content: " \203A"; }

/* Tiles: use only when they hold an image or a distinct object */
.tile {
  background: var(--bg-alt);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.band--alt .tile { background: var(--bg); }
.band--dark .tile { background: #1d1d1f; }

/* Frosted nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--bg-nav);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline-soft);
}
.nav__inner {
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  font-size: 12px;
  letter-spacing: -0.01em;
}
.nav a { color: var(--ink); text-decoration: none; opacity: 0.88; transition: opacity var(--t-fast) var(--ease); }
.nav a:hover { opacity: 1; }
.nav__links { display: none; gap: var(--s-5); }
@media (min-width: 768px) { .nav__links { display: flex; } }
.nav .btn { min-height: 28px; padding: 4px 12px; font-size: 12px; opacity: 1; color: #fff; }

/* Forms */
.field { display: block; margin-bottom: var(--s-4); }
.field label { display: block; font-size: 14px; margin-bottom: var(--s-2); color: var(--ink-2); }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }

/* Reveal: fires once, short, no bounce */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

img, video { max-width: 100%; height: auto; display: block; }
