/* Alderway — alderway.net
   Brand palette: Forest #2F5D46, Deep Canopy #1E3B2D, Alder Copper #C0673A, Cream #F5EFE3,
   Ember #9E4E28, Paper #FBF8F1, Charcoal #2A2A28, Sage #A8BFA3.
   Type: Georgia for the brand voice, Segoe UI / system sans for small labels (no web fonts, nothing to download). */

:root {
  --forest: #2F5D46;
  --deep: #1E3B2D;
  --copper: #C0673A;
  --cream: #F5EFE3;
  --ember: #9E4E28;
  --paper: #FBF8F1;
  --charcoal: #2A2A28;
  --sage: #A8BFA3;

  --bg: var(--cream);
  --surface: var(--paper);
  --text: var(--charcoal);
  --muted: #5F5A50;          /* Bark, darkened slightly for AA on cream */
  --line: #E6DFD0;           /* Linen */
  --accent-text: var(--ember);
  --link: var(--forest);
  --shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 10px 30px rgba(30, 59, 45, .08);

  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
  --gutter: clamp(16px, 5vw, 48px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #122019;           /* Night Forest */
    --surface: #1B3226;      /* Moss */
    --text: #EFE8DA;         /* Warm Cream */
    --muted: #B3C0AE;        /* Lichen */
    --line: #2A4636;         /* Fern Shade */
    --accent-text: #E39A6E;  /* Lit Copper, lifted for small text */
    --link: var(--sage);
    --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-weight: 400; line-height: 1.15; letter-spacing: -.01em; margin: 0; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden {
  position: absolute !important; 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; left: 12px; top: -60px; z-index: 100;
  background: var(--paper); color: var(--deep); padding: 10px 16px; border-radius: 8px;
  font-family: var(--sans); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  font-family: var(--sans); font-size: .78rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--accent-text);
}

/* ---------- Header ---------- */
.site-header { background: var(--deep); color: var(--cream); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--cream); text-decoration: none; font-size: 1.45rem; }
.brand svg { width: 36px; height: 36px; flex: none; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: clamp(14px, 3vw, 30px); font-family: var(--sans); font-size: .95rem; }
.nav a { color: #DCD5C6; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--cream); border-bottom-color: var(--copper); }
@media (max-width: 560px) { .nav .nav-optional { display: none; } }

/* ---------- Hero ---------- */
.hero { background: var(--deep); color: var(--cream); position: relative; overflow: hidden; padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 104px); }
.hero .rings { position: absolute; right: -160px; top: -140px; width: 520px; height: 520px; opacity: .12; pointer-events: none; }
.hero .wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; position: relative; }
.hero .eyebrow { color: var(--sage); }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); margin-top: 14px; }
.hero h1 em { color: var(--copper); font-style: italic; }
.hero .lede { margin-top: 22px; font-size: clamp(1.1rem, 1.6vw, 1.28rem); color: #DCD5C6; max-width: 34em; }
.hero .actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-fox { width: min(100%, 380px); justify-self: center; }
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-fox { width: min(70%, 280px); order: -1; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-weight: 700; font-size: 1.2rem; line-height: 1.2;
  padding: 15px 28px; border-radius: 999px; text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s, transform .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }
/* Copper with 19.2px bold text = WCAG "large text"; Ember on hover for stronger contrast */
.btn-copper { background: var(--copper); color: var(--paper); }
.btn-copper:hover { background: var(--ember); }
.btn-ghost { font-size: 1.05rem; font-weight: 600; color: var(--cream); border: 1.5px solid var(--sage); padding: 13px 24px; }
.btn-ghost:hover { background: rgba(168, 191, 163, .14); }

/* ---------- Sections ---------- */
section { scroll-margin-top: 16px; }
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section h2 { font-size: clamp(2rem, 4vw, 2.9rem); margin-top: 12px; }
.section .intro { margin-top: 18px; font-size: 1.15rem; color: var(--muted); max-width: 40em; }

/* ---------- About ---------- */
.about { background: var(--surface); border-bottom: 1px solid var(--line); }
.about .wrap { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(28px, 6vw, 80px); align-items: start; }
.about-body p { font-size: 1.15rem; }
.about-body p + p { margin-top: 18px; }
@media (max-width: 820px) { .about .wrap { grid-template-columns: 1fr; } }

/* ---------- What we're building (Deep Canopy band) ---------- */
.building { background: var(--deep); color: var(--cream); }
@media (prefers-color-scheme: dark) { .building { background: #0F1B15; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); } }
.building .eyebrow { color: var(--sage); }
.building .intro { color: #DCD5C6; }
.principles { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.principles li { border-top: 2px solid var(--sage); padding-top: 14px; }
.principles b { display: block; font-weight: 400; font-size: 1.2rem; }
.principles span { display: block; margin-top: 6px; font-family: var(--sans); font-size: .95rem; line-height: 1.55; color: #CFC8B9; }
@media (max-width: 820px) { .principles { grid-template-columns: 1fr; } }

/* compact product card: always the light "paper" card, as in the brand file's "in use" examples */
.product-card {
  margin-top: 56px; background: var(--paper); color: var(--charcoal); border-radius: 22px;
  padding: clamp(22px, 3.5vw, 34px); box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
  display: grid; grid-template-columns: auto 1fr auto; gap: clamp(18px, 3vw, 32px); align-items: center;
  scroll-margin-top: 16px;
}
.product-mark { width: 76px; height: 76px; }
.product-card .eyebrow { color: var(--ember); }
.product-name { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.product-name h3 { font-size: clamp(1.9rem, 3vw, 2.3rem); }
.beta-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--deep); background: var(--sage); padding: 6px 12px; border-radius: 999px;
}
.beta-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ember); }
.product-copy > p:last-child { margin-top: 8px; font-size: 1.1rem; max-width: 34em; }
.product-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.product-cta small { font-family: var(--sans); font-size: .88rem; color: #5F5A50; }
.product-card a:focus-visible { outline-color: var(--ember); }
@media (max-width: 880px) {
  .product-card { grid-template-columns: auto 1fr; }
  .product-cta { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .product-card { grid-template-columns: 1fr; }
  .product-mark { width: 60px; height: 60px; }
}

/* ---------- Contact ---------- */
.contact { padding: clamp(56px, 8vw, 104px) 0; }
.contact .wrap { display: grid; grid-template-columns: 1fr 1.35fr; gap: clamp(28px, 6vw, 80px); align-items: start; }
.contact h2 { font-size: clamp(2rem, 4vw, 2.9rem); margin-top: 12px; }
.contact-intro > p:not(.eyebrow) { margin-top: 16px; font-size: 1.15rem; color: var(--muted); max-width: 26em; }
.contact a { color: var(--link); }
@media (max-width: 820px) { .contact .wrap { grid-template-columns: 1fr; } }

.contact-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: clamp(22px, 4vw, 36px); box-shadow: var(--shadow);
  --field-bg: #FFFFFF; --field-line: #D9D1C1; --error: #A23A1E;
}
@media (prefers-color-scheme: dark) {
  .contact-card { --field-bg: #16231C; --field-line: #355745; --error: #F0A07A; }
}
.contact-form { display: grid; gap: 22px; }
.contact-form[hidden] { display: none; }
.field { display: grid; gap: 8px; position: relative; }
.field label { font-family: var(--sans); font-weight: 600; font-size: .98rem; }
.field textarea, .field input {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--text);
  background: var(--field-bg); border: 1.5px solid var(--field-line); border-radius: 12px;
  padding: 12px 14px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 9.5em; line-height: 1.5; }
.field textarea:focus, .field input:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(192, 103, 58, .45); }
@media (prefers-color-scheme: dark) { .field textarea:focus, .field input:focus { border-color: var(--sage); } }
.field [aria-invalid="true"] { border-color: var(--error); }
.field .count, .field .hint { font-family: var(--sans); font-size: .86rem; color: var(--muted); }
.field .count { justify-self: end; font-variant-numeric: tabular-nums; }
.field .count.over { color: var(--error); font-weight: 600; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ts:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.form-actions .btn { border: 0; cursor: pointer; }
.form-actions .btn:disabled { cursor: progress; opacity: .8; transform: none; }
.form-actions .btn.busy svg { animation: nudge .8s ease-in-out infinite alternate; }
@keyframes nudge { to { transform: translateX(4px); } }
.form-msg { font-family: var(--sans); font-size: .98rem; flex: 1 1 220px; }
.form-msg:empty { display: none; }
.form-msg.error { color: var(--error); font-weight: 600; }
.form-note { font-family: var(--sans); font-size: .85rem; color: var(--muted); }
.linkish {
  font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: .18em;
}
.contact-success { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.contact-success[hidden] { display: none; }
.contact-success:focus { outline: none; }
.success-fox { width: 84px; height: auto; }
.contact-success h3 { font-size: 1.7rem; }
.contact-success p { margin-top: 6px; color: var(--muted); }
.contact-success .linkish { margin-top: 12px; font-family: var(--sans); font-size: .98rem; }
@media (max-width: 480px) { .contact-success { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .form-actions .btn.busy svg { animation: none; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--deep); color: #CFC8B9; font-family: var(--sans); font-size: .92rem; padding: 36px 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.site-footer .brand { font-size: 1.2rem; }
.site-footer .brand svg { width: 30px; height: 30px; }
.site-footer nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; }
.site-footer a { color: #E7E0D2; }
.site-footer a:focus-visible { outline-color: var(--copper); }
.site-footer .copy { width: 100%; color: #B9C4B4; font-size: .85rem; border-top: 1px solid #2E4F3E; padding-top: 18px; }

/* ---------- Fox mascot animation (respects reduced motion) ---------- */
.fox * { transform-box: fill-box; }
@media (prefers-reduced-motion: no-preference) {
  .fox .bob { animation: bob 3.2s ease-in-out infinite; }
  .fox .eye { animation: blink 4.5s infinite; transform-origin: center; }
  .fox .wag { animation: wag 2.6s ease-in-out infinite; transform-origin: 0% 100%; }
  .fox .ear { animation: twitch 6s ease-in-out infinite; transform-origin: 50% 100%; }
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes wag { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-8deg); } }
@keyframes twitch { 0%, 86%, 100% { transform: rotate(0); } 90% { transform: rotate(8deg); } 94% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }

/* ---------- Legal pages ---------- */
.legal { padding: clamp(48px, 7vw, 88px) 0 clamp(64px, 9vw, 112px); }
.legal .wrap { max-width: 780px; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-top: 12px; }
.legal .updated { margin-top: 10px; font-family: var(--sans); font-size: .92rem; color: var(--muted); }
.legal h2 { font-size: 1.5rem; margin-top: 44px; }
.legal p, .legal ul { margin-top: 14px; }
.legal ul { padding-left: 1.3em; }
.legal li + li { margin-top: 6px; }
.legal .summary { margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--forest); border-radius: 12px; padding: 18px 22px; }

/* ---------- 404 ---------- */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 64px 0; }
.notfound svg { width: 180px; margin: 0 auto 18px; }
.notfound h1 { font-size: clamp(2rem, 5vw, 3rem); }
.notfound p { margin-top: 12px; color: var(--muted); }
.notfound p a { color: var(--link); }

@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { background: #fff; color: #000; }
}
