@layer reset, base, layout, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body, h1, h2, h3, p, blockquote { margin: 0; }
  img, svg { display: block; max-width: 100%; }
  button, input, textarea { font: inherit; }
}

@layer base {
  :root {
    --paper: #f4efe4;
    --paper-light: #fbf9f4;
    --ink: #17201b;
    --muted: #66655e;
    --forest: #18392c;
    --forest-light: #2e5a45;
    --ochre: #8f551d;
    --line: rgba(23, 32, 27, 0.18);
    --max: 1180px;
    --serif: Georgia, 'Times New Roman', serif;
    --sans: 'Avenir Next', Avenir, 'Segoe UI', Helvetica, Arial, sans-serif;
  }

  html { background: var(--paper); color: var(--ink); }
  body {
    min-width: 320px;
    background: var(--paper);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
  }
  a { color: inherit; text-underline-offset: 0.2em; }
  a:hover { text-decoration-thickness: 2px; }
  :focus-visible { outline: 3px solid var(--ochre); outline-offset: 4px; }
  ::selection { background: #d9bd91; color: var(--ink); }
}

@layer layout {
  .site-header {
    width: min(calc(100% - 48px), var(--max));
    height: 86px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    position: relative;
    z-index: 20;
  }
  .site-nav { display: flex; align-items: center; gap: 34px; }
  .section-shell { width: min(calc(100% - 48px), var(--max)); margin-inline: auto; }

  .hero {
    width: min(calc(100% - 48px), var(--max));
    min-height: 700px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
    align-items: center;
    gap: clamp(48px, 7vw, 96px);
    padding: 72px 0 88px;
  }
  .principles {
    display: grid;
    grid-template-columns: minmax(260px, 0.84fr) minmax(0, 1.16fr);
    gap: clamp(64px, 10vw, 150px);
    padding-block: 128px 140px;
  }
  .privacy-statement { background: var(--forest); color: var(--paper-light); }
  .privacy-grid {
    min-height: 540px;
    display: grid;
    grid-template-columns: 0.46fr 1.54fr;
    grid-template-rows: auto auto;
    gap: 40px 80px;
    align-content: center;
    padding-block: 96px;
  }
  .contact {
    display: grid;
    grid-template-columns: 0.82fr 1.18fr;
    gap: clamp(64px, 10vw, 150px);
    padding-block: 128px;
  }
  .site-footer {
    width: min(calc(100% - 48px), var(--max));
    margin-inline: auto;
    padding: 48px 0 34px;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px 48px;
    align-items: start;
  }
  .site-footer nav { display: flex; flex-wrap: wrap; gap: 16px 28px; }
  .copyright { grid-column: 1 / -1; }
}

@layer components {
  .skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    padding: 10px 14px;
    background: var(--ink);
    color: white;
    transform: translateY(-150%);
  }
  .skip-link:focus { transform: translateY(0); }
  .brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 650; letter-spacing: 0.02em; }
  .brand-mark { width: 33px; height: 33px; }
  .brand-mark path { fill: none; stroke: var(--forest); stroke-width: 2.3; stroke-linecap: round; }
  .brand-mark circle { fill: var(--ochre); }
  .site-nav a { font-size: 0.9rem; font-weight: 600; text-decoration: none; }
  .site-nav a:hover { color: var(--forest-light); }
  .nav-contact { border: 1px solid var(--ink); padding: 8px 16px; }
  .nav-contact:hover { background: var(--ink); color: var(--paper-light) !important; }
  .menu-button { display: none; border: 0; background: transparent; width: 44px; height: 44px; padding: 11px 8px; }
  .menu-button span:not(.sr-only) { display: block; height: 2px; background: var(--ink); margin: 6px 0; transition: transform 160ms ease; }

  .eyebrow { color: var(--ochre); font-size: 0.76rem; line-height: 1.2; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; }
  .hero h1 {
    max-width: 720px;
    margin-top: 26px;
    font-family: var(--serif);
    font-size: clamp(3.55rem, 6vw, 6.2rem);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.055em;
  }
  .hero h1 em { color: var(--forest-light); font-weight: 400; }
  .hero-lede { max-width: 570px; margin-top: 32px; color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.65; }
  .hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 22px 30px; margin-top: 42px; }
  .button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 0;
    padding: 12px 22px;
    cursor: pointer;
    font-weight: 650;
    text-decoration: none;
    transition: background 150ms ease, color 150ms ease, transform 150ms ease;
  }
  .button:hover { transform: translateY(-2px); }
  .button-primary { background: var(--forest); color: var(--paper-light); }
  .button-primary:hover { background: #0f2b20; }
  .text-link { font-weight: 650; text-decoration: none; border-bottom: 1px solid var(--line); }

  .lineage-figure {
    aspect-ratio: 1 / 1.08;
    position: relative;
    overflow: hidden;
    background:
      radial-gradient(circle at 22% 21%, rgba(184, 120, 54, 0.2) 0 4px, transparent 5px),
      linear-gradient(145deg, #244b3a, #17362a 70%);
    box-shadow: 18px 20px 0 #dfd4c1;
  }
  .lineage-figure::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(0deg, transparent 0 33px, rgba(255,255,255,0.035) 34px);
  }
  .lineage-figure svg { position: absolute; inset: 10% 7% 2%; width: 86%; height: 88%; overflow: visible; }
  .lineage-figure path { fill: none; stroke-linecap: round; }
  .branch-main { stroke: #d6b87f; stroke-width: 4; }
  .branch-fine { stroke: rgba(214,184,127,0.72); stroke-width: 2; }
  .lineage-figure circle { fill: var(--paper-light); stroke: #d6b87f; stroke-width: 4; }
  .paper {
    position: absolute;
    z-index: 2;
    width: 118px;
    min-height: 86px;
    padding: 14px;
    background: #f3ead8;
    color: #423e35;
    border: 1px solid rgba(255,255,255,0.46);
    box-shadow: 0 8px 26px rgba(0,0,0,0.2);
    transform: rotate(-3deg);
  }
  .paper span { display: block; margin-bottom: 9px; font-family: var(--serif); font-size: 0.88rem; font-style: italic; }
  .paper i { display: block; height: 1px; margin: 6px 0; background: rgba(66,62,53,0.3); }
  .paper-source { top: 11%; left: 9%; }
  .paper-original { top: 20%; right: 7%; transform: rotate(4deg); }
  .paper-story { bottom: 13%; left: 12%; transform: rotate(2deg); }
  .figure-note { position: absolute; right: 20px; bottom: 14px; color: rgba(255,255,255,0.62); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }

  .section-heading h2, .contact h2 {
    margin-top: 22px;
    font-family: var(--serif);
    font-size: clamp(2.6rem, 4.4vw, 4.8rem);
    font-weight: 400;
    line-height: 1.03;
    letter-spacing: -0.045em;
  }
  .principle-list { border-top: 1px solid var(--line); }
  .principle-list article { display: grid; grid-template-columns: 46px 1fr; gap: 18px; padding: 30px 0; border-bottom: 1px solid var(--line); }
  .principle-list article > span { color: var(--ochre); font-size: 0.74rem; font-weight: 700; }
  .principle-list h3 { margin: 0 0 7px; font-family: var(--serif); font-size: 1.55rem; font-weight: 400; }
  .principle-list p { max-width: 530px; color: var(--muted); }

  .privacy-grid .eyebrow { color: #e0b779; }
  .privacy-grid blockquote { grid-column: 2; max-width: 900px; font-family: var(--serif); font-size: clamp(2.7rem, 5vw, 5.3rem); font-weight: 400; line-height: 1.02; letter-spacing: -0.047em; }
  .privacy-grid > p:last-child { grid-column: 2; max-width: 670px; color: rgba(251,249,244,0.7); font-size: 1.04rem; }

  .contact-intro > p:not(.eyebrow) { max-width: 420px; margin-top: 24px; color: var(--muted); }
  .sms-disclosure-link { display: inline-block; margin-top: 28px; color: var(--forest); font-weight: 650; }
  .contact-card { align-self: start; padding: 38px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .contact-label { margin-bottom: 12px; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
  .contact-email { display: inline-block; color: var(--forest); font-family: var(--serif); font-size: clamp(1.75rem, 3.2vw, 3.2rem); line-height: 1.15; overflow-wrap: anywhere; }
  .contact-card > p:not(.contact-label) { max-width: 620px; margin-top: 28px; color: var(--muted); }
  .contact-card .button { margin-top: 30px; }

  .footer-brand span { font-family: var(--serif); font-size: 1.35rem; }
  .footer-brand p, .copyright { color: var(--muted); font-size: 0.78rem; }
  .site-footer nav a { font-size: 0.8rem; font-weight: 600; }

  .legal-content { width: min(calc(100% - 48px), 780px); margin: 0 auto; padding: 86px 0 120px; }
  .legal-content h1 { font-family: var(--serif); font-size: clamp(3rem, 7vw, 5.6rem); font-weight: 400; line-height: 1; letter-spacing: -0.05em; margin-bottom: 32px; }
  .legal-content h2 { margin: 54px 0 14px; padding-top: 8px; font-family: var(--serif); font-size: 1.9rem; font-weight: 400; line-height: 1.2; }
  .legal-content h3 { margin: 32px 0 10px; font-size: 1.04rem; }
  .legal-content p, .legal-content li { color: #464942; }
  .legal-content p { margin: 0 0 18px; }
  .legal-content ul { margin: 12px 0 24px; padding-left: 22px; }
  .legal-content li { margin-bottom: 8px; }
  .legal-content hr { border: 0; border-top: 1px solid var(--line); margin: 42px 0; }
  .legal-content strong { color: var(--ink); }
  .legal-content a { color: #22573f; font-weight: 600; }
  .not-found { min-height: 620px; padding-block: 120px; }
  .not-found h1 { max-width: 780px; margin: 20px 0; font-family: var(--serif); font-size: clamp(3rem, 7vw, 6rem); line-height: 1; font-weight: 400; }
  .not-found p:not(.eyebrow) { margin-bottom: 34px; color: var(--muted); }
}

@layer utilities {
  .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; }
}

@media (max-width: 860px) {
  .site-header { height: 74px; }
  .menu-button { display: block; }
  .site-nav {
    position: absolute;
    top: 73px;
    left: -24px;
    right: -24px;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding: 14px 24px 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .site-nav[data-open='true'] { display: flex; }
  .site-nav a { min-height: 48px; display: flex; align-items: center; }
  .nav-contact { border: 0; padding: 0; }
  .nav-contact:hover { background: transparent; color: var(--forest-light) !important; }
  .menu-button[aria-expanded='true'] span:nth-of-type(1) { transform: translateY(4px) rotate(45deg); }
  .menu-button[aria-expanded='true'] span:nth-of-type(2) { transform: translateY(-4px) rotate(-45deg); }
  .hero { min-height: auto; grid-template-columns: 1fr; padding: 70px 0 92px; }
  .hero-copy { max-width: 700px; }
  .lineage-figure { width: min(100%, 620px); justify-self: end; }
  .principles, .contact { grid-template-columns: 1fr; gap: 64px; }
  .privacy-grid { grid-template-columns: 1fr; gap: 34px; }
  .privacy-grid blockquote, .privacy-grid > p:last-child { grid-column: 1; }
}

@media (max-width: 580px) {
  .site-header, .section-shell, .hero, .site-footer, .legal-content { width: min(calc(100% - 32px), var(--max)); }
  .brand span { font-size: 0.94rem; }
  .hero { padding-top: 52px; gap: 54px; }
  .hero h1 { font-size: clamp(3rem, 15vw, 4.35rem); }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .lineage-figure { box-shadow: 10px 12px 0 #dfd4c1; }
  .paper { width: 92px; min-height: 70px; padding: 10px; }
  .paper span { font-size: 0.72rem; }
  .principles, .contact { padding-block: 88px; }
  .privacy-grid { min-height: 500px; padding-block: 78px; }
  .site-footer { grid-template-columns: 1fr; }
  .site-footer nav { flex-direction: column; gap: 10px; }
  .copyright { grid-column: 1; }
  .legal-content { padding: 64px 0 88px; }
}

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