/* ============================================================
   James Law Realty — projectsales.jameslaw.co.nz
   Premium editorial, typography-led. No frameworks, no build.
   ============================================================ */

:root {
  /* Palette (OKLCH) */
  --paper: oklch(0.965 0.012 90);          /* warm off-white */
  --surface: oklch(0.985 0.008 90);        /* card surface on paper */
  --ink: oklch(0.24 0.04 262);             /* deep navy ink */
  --ink-2: oklch(0.285 0.045 262);         /* raised surface on ink */
  --ink-deep: oklch(0.19 0.035 262);       /* footer */
  --gold: oklch(0.72 0.12 85);             /* gold/amber accent (on ink) */
  --gold-deep: oklch(0.52 0.11 80);        /* gold for text on paper */

  /* Text */
  --text: oklch(0.30 0.03 262);
  --text-muted: oklch(0.42 0.03 262);
  --text-on-ink: oklch(0.95 0.012 90);
  --text-on-ink-muted: oklch(0.80 0.02 90);

  /* Lines */
  --line-on-paper: oklch(0.85 0.015 90);
  --line-on-ink: oklch(0.38 0.04 262);

  --focus: var(--gold-deep);
  --radius: 4px;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Space rhythm */
  --section-pad: clamp(4rem, 10vw, 7.5rem);
  --container: 72rem;

  /* z-index scale */
  --z-sticky: 100;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

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

/* ---------- Focus ---------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}
.section-ink, .site-header, .site-footer { --focus: var(--gold); }

/* ---------- Type helpers ---------- */
.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 1.3rem + 3vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 22ch;
}
.section-lede {
  margin-top: 1.25rem;
  max-width: 60ch;
  font-size: 1.125rem;
  text-wrap: pretty;
}
.section-ink .section-lede { color: var(--text-on-ink-muted); }

.section-paper { background: var(--paper); color: var(--text); }
.section-ink { background: var(--ink); color: var(--text-on-ink); line-height: 1.72; }
.section-paper, .section-ink { padding-block: var(--section-pad); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.9rem 1.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease-out, color 180ms ease-out, border-color 180ms ease-out, transform 180ms ease-out;
}
.btn-primary {
  background: var(--gold);
  color: var(--ink);
}
.btn-primary:hover { background: oklch(0.77 0.13 85); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--text-on-ink);
  border-color: var(--line-on-ink);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: color-mix(in oklab, var(--ink) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-on-ink);
  color: var(--text-on-ink);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-on-ink);
}
.wordmark-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  border-radius: 2px;
}
.wordmark-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.wordmark-text em { font-style: normal; color: var(--gold); }

.site-nav { display: none; }
.site-nav a {
  color: var(--text-on-ink-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.25rem;
  transition: color 160ms ease-out;
}
.site-nav a:hover { color: var(--text-on-ink); }
.site-nav .nav-cta {
  color: var(--ink);
  background: var(--gold);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
}
.site-nav .nav-cta:hover { background: oklch(0.77 0.13 85); color: var(--ink); }

/* Mobile nav */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.6rem;
  background: transparent;
  border: 1px solid var(--line-on-ink);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-on-ink);
}
.site-nav.is-open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 1rem clamp(1.25rem, 4vw, 2.5rem) 1.5rem;
  background: var(--ink-deep);
  border-bottom: 1px solid var(--line-on-ink);
}
.site-nav.is-open a { padding: 0.75rem 0; font-size: 1.05rem; }
.site-nav.is-open .nav-cta { margin-top: 0.5rem; text-align: center; padding: 0.85rem 1.1rem; }
.header-inner { position: relative; }

/* No-JS: the toggle button can't work, so keep the nav visible, stacked
   below the bar. (The `js` class is set pre-paint by an inline head script,
   so JS users never see this.) */
@media (max-width: 959.98px) {
  html:not(.js) .nav-toggle { display: none; }
  html:not(.js) .site-nav {
    display: flex;
    flex-direction: column;
    flex-basis: 100%;
    padding-bottom: 1rem;
  }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--ink);
  color: var(--text-on-ink);
  padding-block: clamp(5rem, 14vw, 9.5rem) clamp(4.5rem, 11vw, 8rem);
  border-bottom: 1px solid var(--line-on-ink);
}
.hero-eyebrow {
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 1.7rem + 5vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 14ch;
}
.hero-title-accent { color: var(--gold); }
.hero-sub {
  margin-top: 1.75rem;
  max-width: 56ch;
  font-size: clamp(1.05rem, 0.98rem + 0.4vw, 1.25rem);
  line-height: 1.7;
  color: var(--text-on-ink-muted);
  text-wrap: pretty;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.5rem;
}

/* ---------- Stats bar ---------- */
.stats {
  background: var(--gold);
  color: var(--ink);
  padding-block: clamp(2.25rem, 5vw, 3.5rem);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem 1.25rem;
}
.stat { display: flex; flex-direction: column; gap: 0.15rem; }
.stat-number {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 1.6rem + 3vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  max-width: 16ch;
}

/* ---------- Results / case cards ---------- */
.case-grid {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
.case-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--line-on-paper);
  border-radius: var(--radius);
  transition: border-color 200ms ease-out, box-shadow 200ms ease-out;
}
.case-card:hover {
  border-color: var(--gold-deep);
  box-shadow: 0 12px 32px -18px oklch(0.3 0.03 262 / 0.35);
}
.case-figure {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
}
.case-numeral {
  display: block;
  font-size: clamp(3rem, 2.2rem + 4vw, 4.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.35rem;
}
.case-project {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}
.case-body {
  font-size: 0.98rem;
  color: var(--text-muted);
  text-wrap: pretty;
}
.case-link {
  margin-top: auto;
  padding-top: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gold-deep);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  align-self: flex-start;
  transition: color 160ms ease-out;
}
.case-link:hover { color: var(--text); }

/* ---------- News ---------- */
.news-grid {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
.news-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--ink-2);
  border: 1px solid var(--line-on-ink);
  border-radius: var(--radius);
}
.news-source {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.news-headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.35rem, 1.1rem + 1.4vw, 1.9rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  max-width: 26ch;
}
.news-link {
  margin-top: auto;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  align-self: flex-start;
  transition: color 160ms ease-out;
}
.news-link:hover { color: var(--text-on-ink); }
.news-note {
  margin-top: 2rem;
  color: var(--text-on-ink-muted);
  font-size: 0.95rem;
}

/* ---------- Why JLR ---------- */
.why-list {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line-on-paper);
}
.why-list li {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line-on-paper);
  color: var(--text-muted);
  max-width: 62ch;
  text-wrap: pretty;
}
.why-list strong { color: var(--text); font-weight: 700; }

/* ---------- What we handle ---------- */
.handle-list {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line-on-ink);
}
.handle-list li {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line-on-ink);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-on-ink);
}
.handle-list li::before {
  content: "—";
  color: var(--gold);
  margin-right: 0.75rem;
}

/* ---------- About ---------- */
.about-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}
.about-mono {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(5rem, 18vw, 11rem);
  line-height: 0.85;
  letter-spacing: -0.03em;
  color: var(--gold-deep);
  user-select: none;
}
.about-copy p + p { margin-top: 1.1rem; }
.about-copy p { max-width: 58ch; color: var(--text-muted); text-wrap: pretty; }
.about-copy strong { color: var(--text); }

/* ---------- Contact ---------- */
.contact { border-top: 1px solid var(--line-on-ink); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 6vw, 4.5rem);
}
.contact-form { margin-top: 2.5rem; }
.form-field { margin-bottom: 1.35rem; }
.form-field label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-on-ink);
}
.required-marker { color: var(--gold); }
.optional-marker { color: var(--text-on-ink-muted); font-weight: 400; }
.form-field input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.8rem 1rem;
  font: inherit;
  color: var(--text-on-ink);
  background: var(--ink-2);
  border: 1px solid var(--line-on-ink);
  border-radius: var(--radius);
  transition: border-color 160ms ease-out, background-color 160ms ease-out;
}
.form-field input::placeholder { color: var(--text-on-ink-muted); }
.form-field input:hover { border-color: oklch(0.48 0.045 262); }
.form-field input:focus { border-color: var(--gold); }
.form-field input[aria-invalid="true"] { border-color: oklch(0.62 0.19 30); }
.form-honeypot {
  position: absolute !important;
  left: -100vw !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}
.form-status {
  margin-bottom: 1.35rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: oklch(0.45 0.09 150 / 0.18);
  border: 1px solid oklch(0.65 0.12 150 / 0.6);
  color: var(--text-on-ink);
}
.form-status-error {
  background: oklch(0.5 0.15 30 / 0.18);
  border-color: oklch(0.65 0.16 30 / 0.65);
}
.form-status a { color: var(--gold); font-weight: 600; }
.form-submit { width: 100%; }
.form-submit[disabled] { opacity: 0.65; cursor: wait; }
.form-microcopy {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-on-ink-muted);
}

.contact-aside {
  padding: clamp(1.75rem, 4vw, 2.5rem);
  background: var(--ink-2);
  border: 1px solid var(--line-on-ink);
  border-radius: var(--radius);
  align-self: start;
}
.aside-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--gold);
}
.aside-list { margin-top: 1.5rem; }
.aside-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line-on-ink);
  font-size: 1rem;
}
.aside-list li:last-child { border-bottom: 0; }
.aside-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-on-ink-muted);
  margin-bottom: 0.15rem;
}
.aside-list a {
  color: var(--text-on-ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease-out, border-color 160ms ease-out;
  overflow-wrap: anywhere;
}
.aside-list a:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink-deep);
  color: var(--text-on-ink-muted);
  padding-block: 2.75rem;
  font-size: 0.92rem;
}
.footer-inner { display: grid; gap: 0.5rem; }
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-on-ink);
  letter-spacing: -0.01em;
}
.site-footer a {
  color: var(--text-on-ink-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease-out;
}
.site-footer a:hover { color: var(--gold); }
.footer-copy { margin-top: 0.75rem; font-size: 0.85rem; }

/* ---------- Scroll reveal (JS-gated) ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1), transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Track record ---------- */
.records { background: var(--surface); }
.records-subhead {
  margin-top: clamp(2.75rem, 6vw, 4rem);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.75rem);
  letter-spacing: -0.01em;
  color: var(--text);
}
.records-table-wrap {
  margin-top: 1.5rem;
  overflow-x: auto;
  border-top: 2px solid var(--ink);
}
.records-table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  font-size: 0.98rem;
}
.records-table th {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.9rem 1.25rem 0.9rem 0;
  border-bottom: 1px solid var(--line-on-paper);
}
.records-table td {
  padding: 0.95rem 1.25rem 0.95rem 0;
  border-bottom: 1px solid var(--line-on-paper);
  vertical-align: top;
}
.records-table td:first-child { font-weight: 700; color: var(--text); }
.records-table td:last-child { padding-right: 0; font-weight: 600; color: var(--gold-deep); }
.records-table tbody tr { transition: background-color 160ms ease-out; }
.records-table tbody tr:hover { background: oklch(0.945 0.015 90); }
.records-all {
  margin-top: 1.5rem;
  columns: 1;
  column-gap: 2.5rem;
  font-size: 0.95rem;
}
.records-all li {
  break-inside: avoid;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line-on-paper);
  font-weight: 600;
  color: var(--text);
}
.records-all .records-loc { font-weight: 400; color: var(--text-muted); }
.records-note {
  margin-top: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
@media (min-width: 640px) {
  .records-all { columns: 2; }
}
@media (min-width: 960px) {
  .records-all { columns: 3; }
}

/* ---------- Breakpoints ---------- */
@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .case-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .handle-list { grid-template-columns: repeat(2, 1fr); column-gap: 2.5rem; }
}

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    position: static;
    padding: 0;
    background: transparent;
    border: 0;
    flex-direction: row;
  }
  .case-grid { grid-template-columns: repeat(3, 1fr); }
  .why-list { grid-template-columns: repeat(2, 1fr); column-gap: 3rem; }
  .handle-list { grid-template-columns: repeat(3, 1fr); column-gap: 2.5rem; }
  .about-inner { grid-template-columns: auto 1fr; gap: 4.5rem; }
  .contact-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .footer-inner { grid-template-columns: 1fr auto; align-items: center; }
  .footer-details { grid-column: 1; }
  .footer-copy { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; align-self: center; }
}

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