/* ==========================================================================
   CrownRock Group — design tokens
   ========================================================================== */

:root {
  /* Palette: warm paper + near-black ink + deep navy + burnished bronze accent.
     Deliberately not the AI-cliché cream/terracotta or navy/acid-green pairing —
     bronze reads as both "crown" (regal, premium) and "rock" (mineral, warm metal). */
  --paper: #f6f3ec;
  --surface: #ffffff;
  --ink: #15181f;
  --ink-soft: #3a3f4a;
  --muted: #6c6558;
  --line: #e3ddcf;
  --line-strong: #cfc6b2;
  --navy: #10213c;
  --navy-soft: #1c3358;
  --accent: #a6682e;
  --accent-deep: #7f4e21;
  --accent-tint: #f1e3d3;
  --on-navy: #eef1f6;
  --on-navy-muted: #aab6c9;
  --success: #2f6b41;
  --success-tint: #e4f0e6;
  --danger: #a5372a;
  --danger-tint: #f6e6e3;

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;

  --max: 1180px;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow-card: 0 1px 2px rgba(21, 24, 31, 0.06), 0 8px 24px -12px rgba(21, 24, 31, 0.18);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@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;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

.container {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 24px;
}

@media (max-width: 640px) {
  .container {
    padding-inline: 20px;
  }
}

/* Wide content never forces the page itself to scroll horizontally */
.scroll-x {
  overflow-x: auto;
}

/* ==========================================================================
   Accessibility helpers
   ========================================================================== */

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

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  background: var(--navy);
  color: var(--on-navy);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 16px;
}

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

/* ==========================================================================
   Buttons & links
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--navy);
  color: var(--on-navy);
}

.btn-primary:hover {
  background: var(--navy-soft);
}

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

.btn-accent:hover {
  background: var(--accent-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--navy);
  background: var(--surface);
}

.btn-ghost-light {
  background: transparent;
  color: var(--on-navy);
  border-color: rgba(238, 241, 246, 0.35);
}

.btn-ghost-light:hover {
  border-color: var(--on-navy);
  background: rgba(238, 241, 246, 0.08);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--accent-deep);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.link-arrow:hover {
  border-bottom-color: currentColor;
}

/* ==========================================================================
   Header / nav
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 243, 236, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.brand-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}

.brand-word small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  padding: 10px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink-soft);
}

.nav-links a:hover {
  color: var(--ink);
  background: rgba(21, 24, 31, 0.05);
}

.nav-cta {
  margin-left: 8px;
}

/* .nav-links a's own color rule otherwise wins on specificity over .btn-accent's
   (class+element beats class alone) and silently overrides the button back to dark
   ink text on the bronze background — pin it back to white explicitly here. */
.nav-links a.btn-accent {
  color: #fff;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px;
  cursor: pointer;
}

.nav-toggle svg {
  display: block;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px 20px;
    gap: 4px;
    display: none;
  }

  .nav-links[data-open="true"] {
    display: flex;
  }

  .nav-links a {
    padding: 12px 8px;
  }

  .nav-cta {
    margin-left: 0;
    margin-top: 8px;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding-block: 88px 96px;
  max-width: 760px;
}

@media (max-width: 640px) {
  .hero-inner {
    padding-block: 56px 64px;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 22px;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent-deep);
}

.hero h1 {
  font-size: clamp(2.3rem, 5.2vw, 3.6rem);
  color: var(--navy);
}

.hero-lede {
  margin-top: 24px;
  font-size: 1.14rem;
  color: var(--ink-soft);
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.hero-facets {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ==========================================================================
   Section scaffolding
   ========================================================================== */

section {
  padding-block: 88px;
}

@media (max-width: 640px) {
  section {
    padding-block: 56px;
  }
}

.section-head {
  max-width: 620px;
  margin-bottom: 48px;
}

.section-kicker {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
  color: var(--navy);
}

.section-head p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.05rem;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-navy {
  background: var(--navy);
  color: var(--on-navy);
}

.section-navy .section-kicker {
  color: #d9a56a;
}

.section-navy .section-head h2 {
  color: var(--on-navy);
}

.section-navy .section-head p {
  color: var(--on-navy-muted);
}

/* ==========================================================================
   Pillars (What we specialise in)
   ========================================================================== */

.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

@media (max-width: 900px) {
  .pillars {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .pillars {
    grid-template-columns: 1fr;
  }
}

.pillar {
  background: var(--surface);
  padding: 34px 28px;
}

.pillar-icon {
  width: 42px;
  height: 42px;
  color: var(--accent);
  margin-bottom: 22px;
}

.pillar h3 {
  font-size: 1.18rem;
  color: var(--navy);
  margin-bottom: 10px;
}

.pillar p {
  color: var(--muted);
  font-size: 0.96rem;
}

/* ==========================================================================
   Group structure
   ========================================================================== */

.structure {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}

@media (max-width: 860px) {
  .structure {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.structure h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.2rem);
  color: var(--navy);
  margin-bottom: 20px;
}

.structure p {
  color: var(--ink-soft);
  font-size: 1.03rem;
}

.structure p + p {
  margin-top: 16px;
}

.structure-diagram {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.structure-node {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.structure-node.is-parent {
  background: var(--navy);
  color: var(--on-navy);
  border-color: var(--navy);
  font-weight: 700;
}

.structure-branch {
  display: flex;
  align-items: center;
  margin-left: 32px;
  padding-left: 20px;
  border-left: 2px solid var(--line-strong);
  min-height: 44px;
}

.structure-branch:first-of-type {
  margin-top: 18px;
}

.structure-node.is-child {
  background: var(--accent-tint);
  border-color: var(--line-strong);
  width: 100%;
  font-weight: 600;
  color: var(--accent-deep);
}

.structure-node.is-child.is-placeholder {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  font-weight: 500;
}

.node-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ==========================================================================
   Companies / portfolio
   ========================================================================== */

.companies {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.company-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 700px) {
  .company-card {
    grid-template-columns: 1fr;
  }
}

.company-card-body {
  padding: 40px 40px 40px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 640px) {
  .company-card-body {
    padding: 32px 28px;
  }
}

.company-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3d7a4f;
  background: #e4f0e6;
  border-radius: 100px;
  padding: 5px 12px;
  width: fit-content;
  margin-bottom: 18px;
}

.company-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3d7a4f;
}

.company-card h3 {
  font-size: 1.7rem;
  color: var(--navy);
}

.company-tagline {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent-deep);
  margin-top: 6px;
  font-size: 1.02rem;
}

.company-card-body p.company-desc {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.company-card-body .link-arrow {
  margin-top: 24px;
}

.company-shot {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-soft) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 32px;
  position: relative;
  overflow: hidden;
}

.company-shot img {
  width: 220px;
  border-radius: 20px 20px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: none;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
}

/* Desktop web-app screenshot: bleeds off the right edge of the card */
.company-shot.is-web {
  justify-content: flex-start;
  padding: 40px 0 0 40px;
  min-height: 300px;
}

.company-shot.is-web img {
  width: 150%;
  max-width: none;
  border-radius: 10px 0 0 0;
  border-right: none;
}

.company-status.is-building {
  color: #8a5a1f;
  background: var(--accent-tint);
}

.company-status.is-building::before {
  background: var(--accent);
}

.company-card.is-placeholder {
  grid-template-columns: 1fr;
  border-style: dashed;
  border-color: var(--line-strong);
  box-shadow: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.placeholder-mark {
  width: 40px;
  height: 40px;
  color: var(--line-strong);
  margin: 0 auto 18px;
}

.company-card.is-placeholder h3 {
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.company-card.is-placeholder p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 32ch;
  margin-inline: auto;
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .contact-panel {
    padding: 34px 28px;
    flex-direction: column;
    align-items: flex-start;
  }
}

.contact-panel h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  color: var(--navy);
  max-width: 22ch;
}

.contact-panel p {
  margin-top: 12px;
  color: var(--muted);
  max-width: 42ch;
}

.contact-email {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent-deep);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.contact-email:hover {
  border-bottom-color: currentColor;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

@media (max-width: 640px) {
  .contact-actions {
    align-items: flex-start;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--navy);
  color: var(--on-navy-muted);
  padding-block: 48px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--on-navy);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.footer-brand .brand-mark {
  width: 24px;
  height: 24px;
}

.footer-meta {
  font-size: 0.88rem;
  line-height: 1.7;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
}

.footer-links a {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--on-navy-muted);
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--on-navy);
}

.footer-bottom {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(238, 241, 246, 0.12);
  font-size: 0.82rem;
  color: var(--on-navy-muted);
}

/* ==========================================================================
   Reveal-on-scroll (progressive enhancement — content is visible without JS)
   ========================================================================== */

.reveal {
  opacity: 1;
  transform: none;
}

.js-enabled .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-enabled .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Sub-page header (non-homepage pages)
   ========================================================================== */

.page-header {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.page-header-inner {
  position: relative;
  z-index: 1;
  margin-inline: auto;
  padding-block: 36px 16px;
  max-width: 640px;
}

.page-header h1 {
  font-size: clamp(2rem, 4.4vw, 2.85rem);
  color: var(--navy);
}

.page-header-lede {
  margin-top: 18px;
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 56ch;
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 24px;
}

.breadcrumb:hover {
  color: var(--navy);
}

/* ==========================================================================
   Contact page
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 0.75fr;
  gap: 56px;
  align-items: start;
}

@media (max-width: 860px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px;
}

@media (max-width: 640px) {
  .contact-form {
    padding: 28px 24px;
  }
}

.form-row {
  margin-bottom: 22px;
}

.form-row-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 560px) {
  .form-row-pair {
    grid-template-columns: 1fr;
  }
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 8px;
}

.form-label .optional {
  font-weight: 500;
  color: var(--muted);
}

.form-input,
.form-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 13px 14px;
}

.form-textarea {
  resize: vertical;
  min-height: 140px;
}

.form-input:focus-visible,
.form-textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.form-input[aria-invalid="true"],
.form-textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.form-error {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--danger);
}

.form-error:empty {
  display: none;
}

/* Honeypot — visually hidden but not display:none, so it stays reachable by the
   spam bots this exists to catch while never being seen or focusable by a real
   visitor (tabindex="-1", aria-hidden, off-screen). */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-submit {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}

.form-submit[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

.form-status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
}

.form-status:empty {
  display: none;
}

.form-status[data-state="success"] {
  background: var(--success-tint);
  color: var(--success);
}

.form-status[data-state="error"] {
  background: var(--danger-tint);
  color: var(--danger);
}

.form-status a {
  color: inherit;
  text-decoration: underline;
}

.contact-side {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contact-info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.contact-info-card h2 {
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 14px;
}

.contact-info-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.contact-info-card p + p {
  margin-top: 10px;
}

.contact-info-card .contact-email {
  font-size: 1.08rem;
  display: inline-block;
  margin-top: 4px;
}
