/* Contexa: shared styles
   Fonts are self-hosted (Barlow, SIL Open Font License) so no visitor data
   goes to Google or any other third party. */

/* ---------- Fonts ---------- */

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/barlow-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/barlow-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/barlow-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/barlow-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/barlow-semi-condensed-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/barlow-semi-condensed-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/barlow-semi-condensed-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */

:root {
  --graphite: #1c1e20;
  --steel: #383c40;
  --chalk: #ece8e0;
  --chalk-soft: #cfccc5;
  --muted: #a9aaa6;
  --amber: #e1a23a;
  --amber-bright: #eeb75e;

  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Barlow Semi Condensed", "Barlow", "Arial Narrow", system-ui, sans-serif;

  --gutter: clamp(1.25rem, 4.5vw, 3.5rem);
  --max-width: 78rem;

  color-scheme: dark;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--graphite);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--graphite);
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--chalk);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(236, 232, 224, 0.4);
  text-underline-offset: 0.22em;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

a:hover {
  color: var(--amber-bright);
  text-decoration-color: currentColor;
}

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

::selection {
  background: var(--amber);
  color: var(--graphite);
}

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

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--chalk);
  color: var(--graphite);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Background threads ---------- */

.threads {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  pointer-events: none;
}

/* Darkens the area behind the text so the copy always reads cleanly. */
.has-threads::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(28, 30, 32, 0.78) 0%,
    rgba(28, 30, 32, 0.6) 34%,
    rgba(28, 30, 32, 0.12) 64%,
    rgba(28, 30, 32, 0) 100%
  );
}

/* ---------- Page frame ---------- */

.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: max(clamp(1.25rem, 3vw, 2.25rem), env(safe-area-inset-top));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--chalk);
  text-decoration: none;
}

.brand:hover {
  color: var(--chalk);
}

.brand-mark {
  display: block;
  width: 2.5rem;
  height: 1.5rem;
  flex: none;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4375rem;
  line-height: 1;
  letter-spacing: 0.01em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.status::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--amber);
}

.header-link {
  font-size: 0.9375rem;
}

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(2.5rem, 7vh, 6rem) clamp(2rem, 4vh, 3.5rem);
}

.headline {
  max-width: 11.5ch;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3.125rem, 1.35rem + 5.6vw, 6rem);
  line-height: 0.97;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.lede {
  max-width: 33rem;
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 0;
  color: var(--chalk-soft);
  font-size: clamp(1.1875rem, 1.02rem + 0.55vw, 1.4375rem);
  line-height: 1.45;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: clamp(2rem, 4vw, 2.75rem);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.85rem 1.6rem;
  border-radius: 2px;
  background: var(--amber);
  color: var(--graphite);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.button:hover {
  background: var(--amber-bright);
  color: var(--graphite);
}

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

.button:focus-visible {
  outline-color: var(--chalk);
}

.contact-alt {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---------- Principles ---------- */

.principles {
  margin-top: clamp(3rem, 8vh, 6rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--steel);
}

.principles-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.principle-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3125rem;
  line-height: 1.2;
  letter-spacing: 0.005em;
}

.principle-text {
  max-width: 32ch;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.5rem;
  padding-bottom: max(1.75rem, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0;
}

.etymology span {
  color: var(--chalk-soft);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
}

.footer-meta ul {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-meta a {
  color: var(--muted);
  text-decoration-color: rgba(169, 170, 166, 0.4);
}

.footer-meta a:hover,
.footer-meta a[aria-current="page"] {
  color: var(--chalk);
}

/* ---------- Legal pages and 404 ---------- */

.legal {
  flex: 1;
  width: 100%;
  max-width: 44rem;
  padding-block: clamp(3rem, 9vh, 6rem) clamp(3rem, 8vh, 5rem);
}

.legal-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.5rem, 1.7rem + 3vw, 4rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.legal-intro {
  margin: 0 0 2.5rem;
  color: var(--muted);
}

.legal h2 {
  margin: 2.5rem 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.375rem;
  line-height: 1.25;
}

.legal p,
.legal address,
.legal li {
  color: var(--chalk-soft);
}

.legal p,
.legal address {
  margin: 0 0 1rem;
}

.legal address {
  font-style: normal;
}

.legal ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.legal li {
  margin-bottom: 0.35rem;
}

.legal .button {
  margin-top: 1rem;
}

/* Placeholders are styled to stand out until real details replace them. */
.placeholder {
  padding: 0 0.3em;
  border: 1px dashed rgba(225, 162, 58, 0.7);
  border-radius: 2px;
  background: rgba(225, 162, 58, 0.1);
  color: var(--amber-bright);
}

/* ---------- Small screens ---------- */

@media (max-width: 47.99rem) {
  .has-threads::after {
    background: linear-gradient(
      180deg,
      rgba(28, 30, 32, 0.6) 0%,
      rgba(28, 30, 32, 0.5) 50%,
      rgba(28, 30, 32, 0.1) 85%,
      rgba(28, 30, 32, 0) 100%
    );
  }

  .principles-list {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .principle-text {
    max-width: 40ch;
  }

  .site-footer {
    flex-direction: column;
    gap: 0.75rem;
  }
}

@media (max-width: 23rem) {
  .status {
    font-size: 0.875rem;
  }

  .brand-name {
    font-size: 1.3125rem;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* ---------- Print ---------- */

@media print {
  .threads,
  .has-threads::after,
  .skip-link {
    display: none;
  }

  html,
  body {
    background: #fff;
    color: #000;
  }

  .page {
    min-height: 0;
  }

  a,
  .legal p,
  .legal address,
  .legal li,
  .lede,
  .principle-text,
  .site-footer,
  .footer-meta a {
    color: #000;
  }

  .placeholder {
    background: none;
    color: #000;
  }
}
