/*
  Arxvale Enterprises | Corporate website V1.0 | Production stylesheet
  VOICE   Institutional, restrained, precise. Typography carries the page.
  IDEA    A corporate register: ruled lines, labelled fields, measured margins.
  COLOUR  Warm Ivory ground, Carbon Black type, Deep Forest for action,
          Burnt Copper only as a short decorative rule. Tokens from
          Arxvale_Color_Tokens.css (loaded first, values unaltered).
  TYPE    Sora (local variable WOFF2), approved tokens and weights 400–700.
  LAYOUT  12-column grid, 76rem max width, hairline separations, no cards
          beyond the two equal division plates.
*/

/* ---------- Typeface ---------- */
@font-face {
  font-family: 'Sora';
  src: url('./assets/fonts/sora-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Approved typography tokens ---------- */
:root {
  --font-primary: 'Sora', Arial, sans-serif;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --text-hero: clamp(2.5rem, 5vw, 4rem);
  --text-h1: clamp(2rem, 4vw, 3rem);
  --text-h2: clamp(1.75rem, 3vw, 2.25rem);
  --text-h3: clamp(1.375rem, 2vw, 1.5rem);
  --text-h4: clamp(1.125rem, 1.5vw, 1.25rem);

  --text-body-lg: 1.125rem;
  --text-body: 1rem;
  --text-small: 0.875rem;
  --text-caption: 0.75rem;

  --tracking-hero: -0.04em;
  --tracking-heading: -0.03em;
  --tracking-body: 0em;
  --tracking-label: 0.12em;

  --leading-heading: 1.2;
  --leading-body: 1.65;
}

/* ---------- Layout, spacing and interaction tokens ---------- */
:root {
  /* Breakpoints (reference): 1280 / 1024 / 768 / 480 px */
  --content-max: 76rem;          /* 1216px */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --grid-gap: clamp(1.5rem, 3vw, 2.5rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  --section-pad: clamp(4rem, 9vw, 7.5rem);
  --header-h: 5rem;

  --border-hairline: 1px solid var(--color-border);
  --border-strong: 1px solid var(--color-text-primary);
  --radius: 2px;

  --button-h: 3rem;              /* 48px target */
  --button-h-compact: 2.75rem;   /* 44px target */

  --focus-ring: var(--color-primary);
  --focus-ring-on-dark: var(--color-soft-sage);

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --duration-fast: 150ms;
  --duration-base: 240ms;
  --duration-enter: 640ms;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--color-burnt-copper); color: var(--color-pure-white); } /* 4.67:1 */

/* Logo treatment follows the active token theme (Logo Application Standards):
   primary artwork on Warm Ivory / Pure White (light, the V1.0 default);
   inverted artwork on Carbon Black / Deep Forest (reserved dark tokens).
   No theme selector is provided; [data-theme="dark"] is only set externally,
   e.g. by a dark-mode preview viewer. Dark variants are lazy, so they are
   not downloaded while hidden. */
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: inherit; }
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius);
}

.container {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Off-screen helper for the clipboard fallback (keeps CSP free of inline styles). */
.visually-offscreen {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}
.skip-link:focus { top: var(--space-4); }

/* ---------- Type roles ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  color: var(--color-text-secondary);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  line-height: 1.4;
  text-transform: uppercase;
}
/* The single Burnt Copper device: a short decorative rule (non-text). */
.eyebrow::before {
  content: "";
  flex: none;
  width: 2rem;
  height: 2px;
  background: var(--color-accent);
}
.hero-title {
  font-size: var(--text-hero);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-hero);
  line-height: 1.08;
  text-wrap: balance;
}
.h2 {
  font-size: var(--text-h2);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-heading);
  line-height: var(--leading-heading);
  text-wrap: balance;
}
.h3 {
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-heading);
  line-height: var(--leading-heading);
}
.lede, .body-lg {
  font-size: var(--text-body-lg);
  line-height: var(--leading-body);
}
.lede { color: var(--color-text-secondary); max-width: 34rem; }
.label-heading {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

/* ---------- Buttons and links ---------- */
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--button-h);
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease);
}
.button--compact { min-height: var(--button-h-compact); padding: 0 var(--space-4); }
.button--primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.button--primary:hover { background: var(--color-text-primary); }
.button--secondary {
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-text-primary);
}
.button--secondary:hover { background: var(--color-text-primary); color: var(--color-background); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-background);
  border-bottom: var(--border-hairline);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: var(--header-h);
}
.brand {
  display: block;
  flex: none;
  /* The horizontal logo canvas keeps the approved 20/470 side margin;
     offset it so the symbol aligns with the content edge. */
  margin-left: -0.77rem;
  margin-block: -0.5rem;
}
.brand img { width: 18rem; }   /* 288px canvas: ~6.1px subline cap height */
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: var(--space-6); }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--color-text-primary);
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  text-decoration: none;
  background: linear-gradient(var(--color-accent), var(--color-accent)) left calc(50% + 0.85em) / 0 2px no-repeat;
  transition: background-size var(--duration-base) var(--ease);
}
.site-nav a:hover, .site-nav a:focus-visible { background-size: 100% 2px; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3.5rem, 8vw, 7rem) var(--section-pad); }
.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
  align-items: center;
}
.hero-copy { grid-column: 1 / span 7; }
.hero-title { margin-bottom: var(--space-5); max-width: 15em; }
.hero-copy .lede { margin-bottom: var(--space-7); }

.register {
  grid-column: 8 / span 5;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: var(--border-hairline);
}
.register-mark {
  display: grid;
  place-items: center;
  padding: var(--space-6) var(--space-5) var(--space-4);
  border-bottom: var(--border-hairline);
}
.register-mark img { width: min(100%, 18rem); }
/* Fields are centred horizontally and vertically within equal rows
   that share the panel height below the logo. */
.register-list {
  flex: 1;
  display: grid;
  grid-auto-rows: 1fr;
}
.register-list > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  text-align: center;
}
.register-list > div + div { border-top: var(--border-hairline); }
.register-list dt, .footer-info dt {
  color: var(--color-text-secondary);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  line-height: 1.9;
  text-transform: uppercase;
}
.register-list dd { font-size: var(--text-small); font-weight: var(--weight-medium); line-height: 1.6; }

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *, .register {
    animation: rise var(--duration-enter) var(--ease) both;
  }
  .hero-copy > :nth-child(2) { animation-delay: 60ms; }
  .hero-copy > :nth-child(3) { animation-delay: 120ms; }
  .hero-copy > :nth-child(4) { animation-delay: 180ms; }
  .register { animation-delay: 220ms; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section-pad); border-top: var(--border-hairline); }
.section-head .h2 { margin-bottom: var(--space-5); }
.section-head--wide { max-width: 44rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }

/* Divisions heading: centred, with the copper rule mirrored for symmetry. */
.divisions .section-head {
  margin-inline: auto;
  text-align: center;
}
.divisions .section-head .eyebrow { justify-content: center; }
.divisions .section-head .eyebrow::after {
  content: "";
  flex: none;
  width: 2rem;
  height: 2px;
  background: var(--color-accent);
}

/* Overview */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
}
.overview .section-head { grid-column: 1 / span 6; }
.overview .body-lg { max-width: 34rem; }
.expertise { grid-column: 8 / span 5; padding-top: var(--space-1); }
.index-list { border-top: var(--border-strong); }
.index-list li {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: var(--border-hairline);
  font-size: var(--text-h4);
  font-weight: var(--weight-medium);
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.index-list li::before {
  content: "";
  flex: none;
  width: 0.75rem;
  height: 2px;
  background: var(--color-accent);
}

/* Divisions */
.divisions { background: var(--color-surface); }
/* Both divisions share one row grid (subgrid): logo, name, description and
   focus list sit on common rows, so every element and rule aligns across
   the two halves regardless of description length. */
.division-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, auto);
  row-gap: var(--space-5);
  border-top: var(--border-strong);
}
.division {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  justify-items: center;
  align-items: start;
  text-align: center;
  padding: clamp(2rem, 4vw, 3rem) clamp(0rem, 4vw, 3rem) 0 0;
}
.division + .division {
  padding-left: clamp(1.5rem, 4vw, 3rem);
  padding-right: 0;
  border-left: var(--border-hairline);
}
/* Each divisional logo is centred within its half of the section. */
.division-logo {
  display: flex;
  justify-content: center;
  align-self: center;
}
.division-logo img { width: min(100%, 25rem); }
.division .h3::after {          /* centred copper rule under each division name */
  content: "";
  display: block;
  width: 2rem;
  height: 2px;
  margin: var(--space-4) auto 0;
  background: var(--color-accent);
}
.division p { color: var(--color-text-secondary); max-width: 32rem; }
.focus-list {
  justify-self: stretch;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-2);
  padding-top: var(--space-4);
  border-top: var(--border-hairline);
}
.focus-list li::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: var(--space-2);
  vertical-align: 0.15em;
  background: var(--color-accent);
}
.focus-list li {
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  line-height: 1.6;
}

/* Contact */
.contact {
  background: var(--color-deep-forest);
  color: var(--color-pure-white);
  border-top: 0;
}
/* Dark tokens make the divisions surface Deep Forest too; keep the bands distinct. */
[data-theme="dark"] .contact { border-top: var(--border-hairline); }
.contact :focus-visible { outline-color: var(--focus-ring-on-dark); }
.eyebrow--on-dark { color: var(--color-soft-sage); }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
  align-items: end;
}
.contact-grid > :first-child { grid-column: 1 / span 5; }
.contact-panel { grid-column: 7 / span 6; }
.contact .h2 { margin-bottom: var(--space-4); }
.contact-text { color: var(--color-soft-sage); font-size: var(--text-body-lg); max-width: 28rem; }
.contact-label {
  margin-bottom: var(--space-2);
  color: var(--color-soft-sage);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.contact-email {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 2px solid var(--color-accent);
  font-size: clamp(1.25rem, 3.2vw, 2.25rem);
  font-weight: var(--weight-medium);
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.button--light { background: var(--color-warm-ivory); color: var(--color-carbon-black); }
.button--light:hover { background: var(--color-pure-white); }
.button--ghost-dark {
  background: transparent;
  color: var(--color-pure-white);
  border-color: var(--color-soft-sage);
}
.button--ghost-dark:hover { background: var(--color-carbon-black); border-color: var(--color-carbon-black); }
.copy-status {
  min-height: 1.65em;
  margin-top: var(--space-3);
  color: var(--color-soft-sage);
  font-size: var(--text-small);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-carbon-black);
  color: var(--color-warm-ivory);
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
}
.site-footer :focus-visible { outline-color: var(--focus-ring-on-dark); }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
  align-items: center;
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.footer-mark { grid-column: 1 / span 4; }
.footer-mark img { width: 15rem; margin-left: -0.875rem; } /* 20/344 canvas margin at 240px */
.footer-info {
  grid-column: 6 / span 7;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}
.footer-info dt { color: var(--color-soft-sage); margin-bottom: var(--space-1); }
.footer-info dd { font-size: var(--text-small); overflow-wrap: anywhere; }
.footer-info a {
  display: inline-block;
  padding-block: 0.25rem;      /* 26px target height (WCAG 2.2 target size minimum) */
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}
.footer-info a:hover { text-decoration-thickness: 2px; }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  padding-block: var(--space-5);
  border-top: 1px solid var(--color-slate-green);
  color: var(--color-soft-sage);
  font-size: var(--text-small);
}
.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--color-warm-ivory);
  text-underline-offset: 0.25em;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-copy { grid-column: 1 / span 6; }
  .register { grid-column: 7 / span 6; }
  .overview .section-head { grid-column: 1 / span 7; }
  .expertise { grid-column: 8 / span 5; }
  .footer-mark { grid-column: 1 / -1; }
  .footer-info { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .hero-grid, .overview-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-copy, .register,
  .overview .section-head, .expertise,
  .contact-grid > :first-child, .contact-panel { grid-column: 1 / -1; }
  .register { max-width: 30rem; }
  .expertise { padding-top: var(--space-4); }
  .contact-grid { align-items: start; gap: var(--space-7); }
}

@media (max-width: 768px) {
  .division-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .division {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-5);
    grid-row: auto;
    padding: var(--space-7) 0 var(--space-7);
  }
  .focus-list { align-self: stretch; }
  .division + .division {
    padding-left: 0;
    border-left: 0;
    border-top: var(--border-hairline);
  }
  .division:last-child { padding-bottom: 0; }
  .footer-info { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-info > :last-child { grid-column: 1 / -1; }
}

/* Two-row header: logo + contact on the first row, section links below. */
@media (max-width: 900px) {
  :root { --header-h: 7.5rem; }
  .header-inner {
    flex-wrap: wrap;
    gap: 0 var(--space-4);
    min-height: 0;
    padding-top: var(--space-2);
  }
  .header-cta { margin-left: auto; }
  .site-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    border-top: var(--border-hairline);
  }
  .site-nav ul { gap: var(--space-5); }
  .brand { margin-block: 0; }
}

@media (max-width: 640px) {
  .brand { margin-left: -0.64rem; }
  .brand img { width: 15rem; }  /* 240px canvas: ~5.1px subline cap height */
}

@media (max-width: 520px) {
  /* Logo legibility takes priority in the narrow header; contact stays one
     tap away via the Contact link and the hero's Contact Arxvale button. */
  .header-cta { display: none; }
}

@media (max-width: 480px) {
  .actions { flex-direction: column; align-items: stretch; }
  .actions .button { width: 100%; }
  .footer-info { grid-template-columns: minmax(0, 1fr); }
  .register { max-width: none; }
}

@media (max-width: 360px) {
  .site-nav ul { gap: var(--space-4); }
}

/* Keeps the longest hero word ("modernization.") inside the content box
   at the approved minimum hero size (2.5rem) on 320px screens. */
@media (max-width: 340px) {
  :root { --gutter: 0.875rem; }
}

/* ---------- Motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
@media print {
  .site-header { position: static; }
  .skip-link, .header-cta, #copy-email { display: none; }
}
