/* ===== Arch Numeris — Celestial Ledger theme ===== */
/* Deliberate fixed dark identity — does not adapt to OS light/dark preference. */

:root {
  --ink: #10151c;
  --surface: #1a2230;
  --surface-2: #212b3c;
  --text: #e9e3d4;
  --text-dim: #9aa6bb;
  --brass: #c99a4d;
  --brass-bright: #e3b968;
  --rule: #3a4658;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Literata', Georgia, 'Times New Roman', serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;

  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

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

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

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

a { color: inherit; }

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 14px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brass-bright);
  outline-offset: 3px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn--primary {
  background: var(--brass);
  color: #14100a;
}
.btn--primary:hover { background: var(--brass-bright); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--rule);
}
.btn--ghost:hover { border-color: var(--brass); color: var(--brass-bright); }

/* ===== Header ===== */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  gap: 20px;
}
.brand {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--brass-bright);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.primary-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 26px;
  margin: 0;
  padding: 0;
}
.primary-nav a {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  transition: color 0.15s ease;
}
.primary-nav a:hover { color: var(--brass-bright); }
.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-dim);
}
.lang-switch__current { color: var(--brass); }
.lang-switch a { text-decoration: none; color: var(--text-dim); }
.lang-switch a:hover { color: var(--brass-bright); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ===== Hero ===== */
.hero {
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
  padding: 88px 24px 76px;
}
.hero__copy h1 {
  font-size: clamp(34px, 4.6vw, 54px);
  max-width: 15ch;
  margin: 0 0 22px;
}
.hero__sub {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 46ch;
  margin: 0 0 32px;
}
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero__numeral {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(140px, 17vw, 260px);
  line-height: 1;
  text-align: right;
  color: var(--rule);
  user-select: none;
}

/* ===== Carousels ===== */
.carousel-section {
  padding: 72px 0;
  border-bottom: 1px solid var(--rule);
}
.carousel-section--alt { background: var(--surface); }
.carousel-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.carousel-section__head h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  max-width: 22ch;
}
.carousel-controls { display: flex; gap: 10px; }
.carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 2px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.carousel-btn:hover { border-color: var(--brass); color: var(--brass-bright); }
.carousel-btn:disabled { opacity: 0.35; cursor: default; }
.carousel-btn:disabled:hover { border-color: var(--rule); color: var(--text); }

.carousel-viewport { overflow: hidden; }
.carousel__track {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 4px 0 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__item {
  flex: 0 0 clamp(260px, 32vw, 340px);
  scroll-snap-align: start;
}

.post-card {
  display: block;
  height: 100%;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.post-card:hover { border-color: var(--brass); transform: translateY(-2px); }
.post-card__image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90px;
  margin-bottom: 18px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.post-card__image span {
  font-family: var(--font-mono);
  font-size: 26px;
  color: var(--rule);
}
.post-card h3 {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 10px;
}
.post-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
}

.case-card {
  height: 100%;
  margin: 0;
  padding: 30px 26px;
  background: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.case-card__quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  line-height: 1.5;
  margin: 0 0 18px;
}
.case-card cite {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--brass);
}

/* ===== CTA row ===== */
.cta-row { padding: 76px 0 90px; }
.cta-row__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.cta-card {
  display: block;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  text-decoration: none;
  color: var(--text);
  position: relative;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.cta-card:hover { border-color: var(--brass); transform: translateY(-2px); }
.cta-card--accent { background: var(--surface-2); border-color: var(--brass); }
.cta-card h3 { font-size: 22px; font-weight: 600; margin: 0 0 10px; max-width: 22ch; }
.cta-card p { font-size: 14.5px; color: var(--text-dim); margin: 0; max-width: 40ch; }
.cta-card__arrow {
  position: absolute;
  top: 34px;
  right: 34px;
  font-family: var(--font-mono);
  color: var(--brass-bright);
  font-size: 18px;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  padding: 56px 0 0;
}
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 36px;
}
.site-footer__tag {
  font-size: 14px;
  color: var(--text-dim);
  max-width: 34ch;
  margin: 10px 0 0;
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px;
  align-content: flex-start;
}
.site-footer__links a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--text-dim);
}
.site-footer__links a:hover { color: var(--brass-bright); }
.site-footer__legal {
  border-top: 1px solid var(--rule);
  padding: 18px 24px;
}
.site-footer__legal p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
}

/* ===== 404 ===== */
.not-found { padding: 120px 0; text-align: center; }
.not-found__num {
  font-family: var(--font-mono);
  color: var(--rule);
  font-size: 14px;
  letter-spacing: 0.2em;
  margin: 0 0 18px;
}
.not-found h1 { font-size: clamp(26px, 4vw, 36px); max-width: 24ch; margin: 0 auto 16px; }
.not-found p { color: var(--text-dim); }
.not-found a { color: var(--brass); text-decoration: underline; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--brass);
  border-radius: 3px;
  padding: 34px 32px;
  text-align: center;
}
.modal__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 12px;
}
.modal__title {
  font-size: 24px;
  margin: 0 0 14px;
}
.modal__body {
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 26px;
}
.modal__close { width: 100%; justify-content: center; }

.primary-nav a.is-active { color: var(--brass-bright); }
.lang-switch__disabled {
  opacity: 0.4;
  cursor: default;
}

.post-card__image--photo {
  padding: 0;
  overflow: hidden;
  height: 140px;
}
.post-card__image--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.carousel-empty {
  color: var(--text-dim);
  margin: 0;
}

/* ===== Inner pages ===== */
.page-hero {
  padding: 72px 0 36px;
  border-bottom: 1px solid var(--rule);
}
.page-hero h1 {
  font-size: clamp(32px, 4.2vw, 46px);
  max-width: 18ch;
  margin: 0 0 16px;
}
.page-hero__sub {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 46ch;
  margin: 0;
  line-height: 1.7;
}
.page-body { padding: 48px 0 96px; }
.prose-page, .article__wrap { max-width: 68ch; }
.prose-page p, .prose p { margin: 0 0 1.15em; }
.prose-page a, .prose a { color: var(--brass); }
.prose-page h2, .prose h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin: 2em 0 0.6em;
}
.prose-page h3, .prose h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 1.6em 0 0.5em;
}
.prose-page ul, .prose ul,
.prose-page ol, .prose ol { color: var(--text-dim); padding-left: 1.2em; }
.prose-page li, .prose li { margin: 0.35em 0; }
.prose-page code, .prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 0.1em 0.35em;
}
.prose blockquote {
  margin: 1.4em 0;
  padding: 0 0 0 1em;
  border-left: 2px solid var(--brass);
  font-family: var(--font-display);
  font-style: italic;
}
.prose pre {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 16px;
  overflow-x: auto;
}
.prose img { border: 1px solid var(--rule); }

.form-wrap { max-width: 520px; }
.form-wrap--narrow { max-width: 400px; }
.stack-form { display: flex; flex-direction: column; gap: 18px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 8px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 11px 12px;
  font-family: var(--font-body);
  font-size: 16px;
}
.field textarea { resize: vertical; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid var(--brass-bright);
  outline-offset: 2px;
  border-color: var(--brass);
}
.field--error input,
.field--error textarea { border-color: #c45c4a; }
.field-error {
  display: block;
  margin-top: 6px;
  color: #e08a7a;
  font-size: 13px;
}
.notice {
  padding: 14px 16px;
  border: 1px solid var(--brass);
  background: var(--surface);
  color: var(--text);
  margin: 0 0 24px;
}
.notice--success { border-color: #6e9a72; }
.notice--error { border-color: #c45c4a; color: #e08a7a; }

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}
.tag-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text-dim);
  border: 1px solid var(--rule);
  padding: 6px 12px;
  border-radius: 2px;
}
.tag-chip.is-active,
.tag-chip:hover { color: var(--brass-bright); border-color: var(--brass); }
.blog-list { padding: 48px 0 96px; }
.blog-index { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 28px; }
.blog-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  text-decoration: none;
  color: inherit;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}
.blog-card__image {
  height: 140px;
  background: var(--surface);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.blog-card__image img { width: 100%; height: 100%; object-fit: cover; }
.blog-card__image--empty { background: var(--surface-2); }
.blog-card__body h2 {
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 10px;
}
.blog-card__body p { color: var(--text-dim); margin: 0; }
.blog-card__date {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--brass);
  margin: 0 0 8px !important;
}
.blog-card__tags { margin-top: 12px !important; display: flex; gap: 10px; flex-wrap: wrap; }
.blog-card__tags span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}
.pagination {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}
.pagination a { color: var(--brass); }
.empty-copy { color: var(--text-dim); }

.article { padding: 48px 0 96px; }
.article__crumb { margin-bottom: 28px; }
.article__crumb a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--brass);
  text-decoration: none;
}
.article__header { margin-bottom: 32px; }
.article__header h1 { font-size: clamp(30px, 4vw, 42px); margin: 0 0 16px; }
.article__intro { font-size: 18px; color: var(--text-dim); line-height: 1.65; margin: 0; }
.article__tags { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 0; }
.article__tags a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--brass);
  text-decoration: none;
}
.article__figure { margin: 0 0 36px; }
.article__figure img { width: 100%; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; padding: 56px 24px 48px; }
  .hero__numeral { text-align: left; font-size: clamp(90px, 30vw, 150px); }
  .cta-row__grid { grid-template-columns: 1fr; }
  .blog-card { grid-template-columns: 1fr; }

  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    padding: 20px 24px 28px;
    display: none;
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav ul { flex-direction: column; gap: 16px; }
  .site-header { position: relative; }
}
