@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:wght@500;600;700&family=Libre+Franklin:wght@400;500;600;700;800&family=Oswald:wght@500;600;700&display=swap");

/* =========================
   Base
   ========================= */
* { box-sizing: border-box; }

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--fg);
  background:
    linear-gradient(rgba(244, 239, 227, .78), rgba(244, 239, 227, .9)),
    var(--texture-paper),
    var(--paper);
  font-family: var(--font-body);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(199, 169, 97, .16), transparent 28%),
    radial-gradient(circle at 82% 62%, rgba(143, 158, 139, .16), transparent 34%);
  mix-blend-mode: multiply;
  opacity: .56;
  z-index: -1;
}

main {
  flex: 1;
  width: 100%;
}

body:not(.home-page) main {
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  padding: clamp(34px, 5vw, 70px) 0;
}

img, svg {
  max-width: 100%;
}

a {
  color: var(--text-link);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

a:hover {
  color: var(--copper);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

h1, h2, h3, h4 {
  color: var(--ink);
  margin: 0 0 .55em;
  line-height: 1.05;
}

h1, h2, .display-heading {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 { font-size: clamp(3rem, 8vw, 6.5rem); }
h2 { font-size: clamp(2rem, 4.2vw, 4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.65rem); }

p {
  margin: 0 0 1rem;
}

small,
.muted {
  color: var(--muted);
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 28px 0;
}

blockquote {
  margin: 0;
  color: var(--text-2);
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3vw, 3rem);
  line-height: 1.05;
}

/* =========================
   Header and navigation
   ========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background:
    linear-gradient(rgba(244, 239, 227, .93), rgba(244, 239, 227, .93)),
    var(--texture-paper),
    var(--paper);
  border-bottom: 1px solid rgba(58, 63, 56, .14);
  box-shadow: 0 6px 24px rgba(35, 31, 22, .08);
  backdrop-filter: blur(14px);
}

.brand-bar {
  width: min(var(--site-max), calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 8px;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-brand a {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.site-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  padding: 0;
  filter: drop-shadow(0 3px 10px rgba(35, 31, 22, .16));
}

.site-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  line-height: .95;
  letter-spacing: .28em;
  text-transform: uppercase;
}

.site-subtitle {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: .78rem;
  letter-spacing: .52em;
  text-transform: uppercase;
}

.nav-bar {
  border-top: 1px solid rgba(58, 63, 56, .11);
}

.nav-shell {
  width: min(var(--site-max), calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.nav-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(58, 63, 56, .22);
  border-radius: var(--radius-sm);
  background: rgba(255, 252, 244, .72);
  color: var(--ink);
  cursor: pointer;
}

.nav-menu-toggle span,
.nav-menu-toggle span::before,
.nav-menu-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
  content: "";
}

.nav-menu-toggle span::before { top: -6px; position: absolute; }
.nav-menu-toggle span::after { top: 6px; position: absolute; }

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: clamp(7px, 1.05vw, 16px);
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--ink);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-list > li > a {
  position: relative;
}

.nav-list > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  height: 3px;
  background: var(--tvk-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s ease;
}

.nav-list > li > a:hover::after,
.nav-list > li.active > a::after {
  transform: scaleX(1);
}

.has-submenu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.submenu-toggle {
  width: 24px;
  height: 36px;
  margin-left: -8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.submenu-toggle::before {
  content: "⌄";
  font-size: 1rem;
  line-height: 1;
}

.submenu {
  list-style: none;
  position: absolute;
  top: calc(100% + 4px);
  left: -18px;
  min-width: 270px;
  margin: 0;
  padding: 10px;
  display: none;
  background:
    linear-gradient(rgba(244, 239, 227, .96), rgba(244, 239, 227, .96)),
    var(--texture-paper),
    var(--paper);
  border: 1px solid rgba(58, 63, 56, .18);
  box-shadow: var(--shadow-soft);
}

.submenu li a {
  min-height: auto;
  display: block;
  padding: 9px 10px;
  color: var(--ink);
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: none;
}

.submenu li a:hover {
  background: rgba(199, 169, 97, .13);
}

.has-submenu:hover .submenu,
.has-submenu:focus-within .submenu,
.has-submenu.open .submenu {
  display: block;
}

.nav-cta a {
  min-height: 40px;
  padding: 0 16px;
  color: var(--paper);
  background:
    linear-gradient(90deg, rgba(58, 63, 56, .98), rgba(37, 42, 36, .95)),
    var(--texture-forest);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 18px rgba(35, 31, 22, .18);
}

.nav-cta a::after {
  display: none;
}

/* =========================
   Shared components
   ========================= */
.container {
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  padding: 24px 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.card {
  background:
    linear-gradient(rgba(255, 252, 244, .82), rgba(255, 252, 244, .82)),
    var(--texture-paper);
  border: 1px solid rgba(58, 63, 56, .14);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: clamp(22px, 3vw, 34px);
}

.btn,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid rgba(58, 63, 56, .28);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: transparent;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.btn:hover,
.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  border-color: var(--copper);
  color: #fff8ef;
  background: linear-gradient(180deg, var(--copper), var(--copper-deep));
}

.button-dark {
  color: var(--paper);
  background: var(--charcoal);
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid rgba(58, 63, 56, .18);
  border-radius: 999px;
  background: rgba(255, 252, 244, .62);
  color: var(--ink-soft);
  font-size: .78rem;
}

.page-kicker,
.section-kicker {
  margin: 0 0 10px;
  color: var(--copper);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.page-header,
.nation-banner {
  position: relative;
  max-width: 100%;
  margin: 0 0 28px;
  padding: clamp(28px, 5vw, 58px);
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(244, 239, 227, .92), rgba(230, 220, 199, .82)),
    var(--texture-paper);
  border: 1px solid rgba(58, 63, 56, .14);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.page-header::after,
.nation-banner::after {
  content: "";
  position: absolute;
  right: -100px;
  bottom: -130px;
  width: 320px;
  height: 320px;
  background: url("/images/official-tvtn-logo.png") center / contain no-repeat;
  opacity: .06;
  pointer-events: none;
}

.page-header h1,
.page-title {
  font-size: clamp(2.6rem, 6vw, 5rem);
}

.page-text,
.page-deck,
.block-text,
.prose {
  color: var(--text-body);
}

.block-text {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.seal-float {
  float: left;
  width: clamp(140px, 16vw, 220px);
  height: auto;
  margin: 6px 24px 14px 0;
  border-radius: 50%;
  object-fit: contain;
}

.seal img {
  width: 120px;
  height: auto;
}

.governed-line {
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: italic;
}

.page-principles {
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 34px auto 0;
  padding: 18px;
  border: 1px solid rgba(58, 63, 56, .15);
  border-radius: var(--radius-md);
  background: rgba(255, 252, 244, .62);
}

.page-principles .metaLabel {
  color: var(--copper);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.chipRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: rgba(255, 252, 244, .9);
  color: var(--ink);
}

.alert,
.verify-status {
  padding: 16px 18px;
  border: 1px solid var(--border-4);
  border-radius: var(--radius-md);
  background: rgba(255, 252, 244, .7);
}

.verified {
  border-color: var(--verified-border);
  background: var(--verified-bg);
  color: var(--text-ok);
}

.unverified {
  border-color: var(--unverified-border);
  background: var(--unverified-bg);
  color: var(--text-err);
}

.breadcrumbs {
  color: var(--crumb);
  font-size: .82rem;
  letter-spacing: .04em;
}

/* =========================
   Homepage
   ========================= */
.home-hero {
  position: relative;
  --hero-image: url("/images/redesign/hero-image-desktop.webp");
  --hero-gradient: linear-gradient(90deg, rgba(13, 14, 11, .96) 0%, rgba(13, 14, 11, .78) 36%, rgba(13, 14, 11, .08) 60%);
  --hero-image-position: calc(100% + 260px) top;
  --hero-image-size: auto 86%;
  --hero-copy-width: min(560px, 100%);
  --hero-copy-pad-y: clamp(32px, 5vw, 64px);
  --hero-copy-pad-x: clamp(24px, 4vw, 48px);
  --hero-panel-top: -52px;
  --hero-panel-right: -46px;
  --hero-panel-bottom: -52px;
  --hero-panel-left: -50vw;
  --hero-panel-radius: 88px;
  min-height: clamp(640px, 79vh, 860px);
  display: grid;
  align-items: stretch;
  overflow: hidden;
  background: var(--charcoal);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    var(--hero-gradient),
    var(--hero-image) var(--hero-image-position) / var(--hero-image-size) no-repeat,
    var(--charcoal);
}

.home-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 120px;
  background: var(--brush-edge) center bottom / 100% 100% no-repeat;
}

.hero-panel {
  position: relative;
  z-index: 1;
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  display: flex;
  align-items: center;
  min-height: inherit;
  padding: clamp(64px, 8vw, 110px) 0 clamp(110px, 14vw, 170px);
}

.hero-copy {
  position: relative;
  width: var(--hero-copy-width);
  padding: var(--hero-copy-pad-y) var(--hero-copy-pad-x);
  color: var(--paper);
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: var(--hero-panel-top) var(--hero-panel-right) var(--hero-panel-bottom) var(--hero-panel-left);
  z-index: -1;
  background: rgba(11, 13, 10, .96);
  border-radius: 0 var(--hero-panel-radius) var(--hero-panel-radius) 0 / 0 50% 50% 0;
  box-shadow: 28px 0 50px rgba(0, 0, 0, .2);
}

.hero-kicker {
  margin: 0 0 16px;
  color: var(--tvk-gold);
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin-bottom: 22px;
  color: var(--paper);
  font-size: clamp(4.2rem, 10vw, 8.5rem);
  line-height: .93;
  text-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}

.hero-copy p {
  width: min(420px, 100%);
  margin-bottom: 28px;
  color: rgba(255, 248, 233, .9);
  font-size: 1.04rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-actions .button {
  color: var(--paper);
  border-color: rgba(255, 248, 233, .45);
}

.hero-actions .button-primary {
  border-color: var(--copper);
}

.hero-dots {
  position: absolute;
  left: clamp(28px, 6vw, 88px);
  bottom: clamp(72px, 9vw, 118px);
  z-index: 2;
  display: flex;
  gap: 14px;
}

.hero-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(255, 248, 233, .78);
}

.hero-dots span:first-child {
  background: var(--paper);
}

.paper-section {
  position: relative;
  padding: var(--section-y) 0;
}

.section-inner {
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
}

.identity-layout {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(0, 1.55fr);
  gap: clamp(28px, 5vw, 62px);
  align-items: center;
}

.identity-copy h2,
.involved-copy h2 {
  max-width: 460px;
}

.identity-list {
  list-style: none;
  margin: 22px 0;
  padding: 0;
}

.identity-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 6px;
}

.identity-list li::before {
  content: "✣";
  position: absolute;
  left: 0;
  color: var(--tvk-gold);
}

.learn-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--copper-deep);
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(58, 63, 56, .15);
  border-radius: var(--radius-md);
  background:
    linear-gradient(rgba(255, 252, 244, .76), rgba(255, 252, 244, .76)),
    var(--texture-paper);
  box-shadow: var(--shadow-soft);
}

.pillar-card {
  min-height: 310px;
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-right: 1px solid rgba(58, 63, 56, .13);
}

.pillar-card:last-child {
  border-right: 0;
}

.icon-medallion {
  width: 94px;
  height: 94px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  border-radius: 50%;
  color: var(--paper);
  background: var(--forest-deep);
}

.icon-medallion svg,
.action-card svg,
.principle-item svg,
.mail-icon svg {
  width: 44px;
  height: 44px;
}

.pillar-card:nth-child(2) .icon-medallion { background: var(--copper-deep); }
.pillar-card:nth-child(3) .icon-medallion { background: #213946; }
.pillar-card:nth-child(4) .icon-medallion { background: #b17b32; }

.pillar-card h3,
.action-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.pillar-rule {
  width: 46px;
  height: 3px;
  margin-top: auto;
  background: currentColor;
  opacity: .75;
}

.principles-band {
  position: relative;
  overflow: hidden;
  color: var(--paper);
  background:
    linear-gradient(rgba(31, 36, 30, .88), rgba(31, 36, 30, .9)),
    var(--texture-forest),
    var(--forest-deep);
}

.principles-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0, rgba(199, 169, 97, .08) 52%, transparent 52%);
  opacity: .4;
}

.principles-inner {
  position: relative;
  z-index: 1;
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  display: grid;
  grid-template-columns: .95fr repeat(3, .7fr) .9fr;
  gap: 0;
  align-items: stretch;
  min-height: 220px;
}

.quote-block,
.principle-item,
.land-medallion {
  padding: clamp(28px, 4vw, 46px);
}

.quote-block {
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(242, 241, 236, .18);
}

.principle-item {
  border-right: 1px solid rgba(242, 241, 236, .18);
}

.principle-item svg {
  color: var(--tvk-gold);
  margin-bottom: 16px;
}

.principle-item h3 {
  color: var(--paper);
  font-size: .9rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.principle-item p {
  color: rgba(255, 248, 233, .8);
  font-size: .9rem;
}

.land-medallion {
  display: flex;
  align-items: center;
  justify-content: center;
}

.land-medallion img {
  width: min(230px, 100%);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(199, 169, 97, .65);
  box-shadow: 0 18px 35px rgba(0, 0, 0, .28);
}

.record-note {
  padding: var(--section-y) 0 0;
}

.record-note-inner {
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .7fr);
  gap: clamp(24px, 4vw, 46px);
  align-items: start;
}

.record-note .card {
  height: 100%;
}

.founding-quote {
  background:
    linear-gradient(rgba(37, 42, 36, .92), rgba(37, 42, 36, .9)),
    var(--texture-forest);
  color: var(--paper);
}

.founding-quote h3 {
  color: var(--tvk-gold);
}

.founding-quote blockquote {
  font-size: clamp(1.3rem, 2.4vw, 2rem);
}

/* =========================
   Lineage redesign
   ========================= */
.lineage-page main {
  width: 100%;
  padding: 0;
}

.lineage-hero {
  position: relative;
  min-height: clamp(360px, 48vw, 540px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(13, 14, 11, .82), rgba(13, 14, 11, .34)),
    url("/images/redesign/section-citizenship.webp") center / cover no-repeat;
}

.lineage-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 108px;
  background: var(--brush-edge) center bottom / 100% 100% no-repeat;
}

.lineage-hero__copy {
  position: relative;
  z-index: 1;
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  padding: clamp(58px, 9vw, 112px) 0 clamp(102px, 12vw, 150px);
  color: var(--paper);
}

.lineage-hero h1 {
  max-width: 820px;
  color: var(--paper);
}

.lineage-hero p:not(.page-kicker) {
  max-width: 680px;
  color: rgba(255, 248, 233, .88);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.lineage-intro,
.lineage-doctrine {
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  padding: var(--section-y) 0;
}

.lineage-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .82fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: stretch;
}

.lineage-intro__text,
.lineage-doctrine__panel {
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(58, 63, 56, .15);
  border-radius: var(--radius-md);
  background:
    linear-gradient(rgba(255, 252, 244, .78), rgba(255, 252, 244, .78)),
    var(--texture-paper);
  box-shadow: var(--shadow-card);
}

.lineage-intro__image {
  min-height: 380px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(58, 63, 56, .15);
  background:
    linear-gradient(180deg, rgba(13, 14, 11, .02), rgba(13, 14, 11, .24)),
    url("/images/redesign/section-about.webp") center / cover no-repeat;
  box-shadow: var(--shadow-card);
}

.lineage-card-wall {
  padding: var(--section-y) 0;
  background:
    linear-gradient(rgba(37, 42, 36, .92), rgba(37, 42, 36, .9)),
    var(--texture-forest);
}

.lineage-card-wall .route-heading h2,
.lineage-card-wall .route-heading {
  color: var(--paper);
}

.flip-grid {
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.flip-card {
  min-height: 420px;
  perspective: 1200px;
  cursor: pointer;
}

.flip-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  transform-style: preserve-3d;
  transition: transform .72s cubic-bezier(.2, .7, .2, 1);
}

.flip-card:hover .flip-card__inner,
.flip-card:focus .flip-card__inner,
.flip-card:focus-within .flip-card__inner {
  transform: rotateY(180deg);
}

.flip-card__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 34px;
  color: var(--paper);
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 248, 233, .18);
  backface-visibility: hidden;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .28);
}

.flip-card__face::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(13, 14, 11, .35), rgba(13, 14, 11, .7)),
    var(--texture-forest);
}

.flip-card__face::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  height: 64px;
  z-index: -1;
  opacity: .22;
  background:
    repeating-linear-gradient(90deg, transparent 0 12px, currentColor 12px 14px, transparent 14px 28px),
    repeating-linear-gradient(45deg, transparent 0 10px, currentColor 10px 12px, transparent 12px 22px);
}

.flip-card__front svg {
  width: 112px;
  height: 112px;
  margin-bottom: 34px;
  color: var(--tvk-gold);
}

.flip-card__front h3 {
  max-width: 260px;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.1vw, 3.05rem);
  letter-spacing: .02em;
  text-transform: uppercase;
}

.flip-card__back {
  transform: rotateY(180deg);
  align-items: flex-start;
  text-align: left;
}

.flip-card__back p {
  margin: auto 0;
  color: rgba(255, 248, 233, .92);
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.18;
}

.flip-card--forest .flip-card__face::before {
  background:
    linear-gradient(rgba(7, 45, 38, .74), rgba(8, 27, 24, .96)),
    var(--texture-forest);
}

.flip-card--copper .flip-card__face::before {
  background:
    linear-gradient(rgba(123, 49, 26, .84), rgba(61, 23, 14, .96)),
    var(--texture-paper);
}

.flip-card--charcoal .flip-card__face::before {
  background:
    linear-gradient(rgba(7, 7, 7, .66), rgba(7, 7, 7, .95)),
    url("/images/redesign/section-citizenship.webp") center / cover no-repeat;
}

.flip-card--gold .flip-card__face::before {
  background:
    linear-gradient(rgba(114, 76, 24, .76), rgba(58, 39, 15, .94)),
    url("/images/redesign/section-land.webp") center / cover no-repeat;
}

.lineage-doctrine {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.lineage-doctrine__panel ul {
  margin: 0;
  padding-left: 1.2rem;
}

.lineage-doctrine__panel li {
  margin-bottom: .75rem;
}

.lineage-doctrine__panel--dark {
  color: var(--paper);
  background:
    linear-gradient(rgba(37, 42, 36, .92), rgba(37, 42, 36, .9)),
    var(--texture-forest);
}

.lineage-doctrine__panel--dark h2 {
  color: var(--paper);
}

.lineage-doctrine__panel--dark p {
  color: rgba(255, 248, 233, .86);
}

/* =========================
   Community pages
   ========================= */
.community-page main {
  width: 100%;
  padding: 0;
}

.community-hero {
  position: relative;
  min-height: clamp(320px, 42vw, 500px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(13, 14, 11, .8), rgba(13, 14, 11, .3)),
    url("/images/redesign/section-community.webp") center / cover no-repeat;
}

.community-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 100px;
  background: var(--brush-edge) center bottom / 100% 100% no-repeat;
}

.community-hero__copy {
  position: relative;
  z-index: 1;
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  padding: clamp(52px, 8vw, 100px) 0 clamp(96px, 12vw, 142px);
  color: var(--paper);
}

.community-hero h1 {
  max-width: 860px;
  color: var(--paper);
}

.community-hero p:not(.page-kicker) {
  max-width: 680px;
  color: rgba(255, 248, 233, .88);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.community-panel {
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  padding: var(--section-y) 0;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(280px, .72fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: stretch;
}

.community-message,
.community-side-note,
.calendar-shell,
.calendar-note {
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(58, 63, 56, .15);
  border-radius: var(--radius-md);
  background:
    linear-gradient(rgba(255, 252, 244, .8), rgba(255, 252, 244, .8)),
    var(--texture-paper);
  box-shadow: var(--shadow-card);
}

.community-message h2,
.calendar-shell h2 {
  max-width: 760px;
}

.community-side-note {
  color: var(--paper);
  background:
    linear-gradient(rgba(37, 42, 36, .92), rgba(37, 42, 36, .9)),
    var(--texture-forest);
}

.community-side-note h2,
.community-side-note h3 {
  color: var(--paper);
}

.community-side-note p,
.community-side-note li {
  color: rgba(255, 248, 233, .86);
}

.community-side-note ul {
  margin: 18px 0 0;
  padding-left: 1.2rem;
}

.community-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.calendar-layout {
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  padding: var(--section-y) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .42fr);
  gap: 24px;
}

.calendar-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.calendar-header h2 {
  margin-bottom: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(58, 63, 56, .15);
  border-radius: var(--radius-md);
  background: rgba(255, 252, 244, .56);
}

.calendar-weekday,
.calendar-day {
  min-height: 108px;
  padding: 10px;
  border-right: 1px solid rgba(58, 63, 56, .12);
  border-bottom: 1px solid rgba(58, 63, 56, .12);
}

.calendar-weekday:nth-child(7n),
.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-weekday {
  min-height: auto;
  color: var(--copper);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
  background: rgba(199, 169, 97, .12);
}

.calendar-day {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 252, 244, .5);
}

.calendar-day.is-muted {
  background: rgba(58, 63, 56, .04);
}

.calendar-day__number {
  color: var(--ink);
  font-weight: 800;
}

.calendar-event {
  display: block;
  padding: 6px 7px;
  border-radius: var(--radius-sm);
  color: var(--paper);
  background: var(--forest-deep);
  font-size: .74rem;
  line-height: 1.2;
}

.calendar-event--holiday {
  color: var(--ink);
  background: rgba(199, 169, 97, .45);
}

.calendar-event--note {
  background: var(--copper-deep);
}

.event-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.event-list li {
  padding: 14px 0;
  border-bottom: 1px solid rgba(58, 63, 56, .12);
}

.event-list strong {
  display: block;
  color: var(--ink);
}

.event-list span {
  color: var(--muted);
}

.involved-layout {
  display: grid;
  grid-template-columns: minmax(230px, .75fr) minmax(0, 1.8fr);
  gap: clamp(28px, 5vw, 60px);
  align-items: start;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.action-card {
  min-height: 280px;
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 252, 244, .78), rgba(255, 252, 244, .78)),
    var(--texture-paper);
  border: 1px solid rgba(58, 63, 56, .15);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: transform .22s ease, box-shadow .22s ease;
}

.action-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 38px rgba(35, 31, 22, .18);
}

.action-card svg {
  color: var(--forest-deep);
  margin-bottom: 20px;
}

.route-section {
  padding: 0 0 var(--section-y);
}

.route-heading {
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto 24px;
}

.route-grid {
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.route-card {
  position: relative;
  min-height: 230px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--paper);
  border-radius: var(--radius-md);
  border: 1px solid rgba(58, 63, 56, .15);
  background: var(--forest-deep);
  text-decoration: none;
  box-shadow: var(--shadow-card);
}

.route-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.route-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 14, 11, .08), rgba(13, 14, 11, .82));
}

.route-card:hover img {
  transform: scale(1.05);
}

.route-card span {
  position: relative;
  z-index: 1;
  display: block;
  padding: 24px;
}

.route-card strong {
  display: block;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.55rem;
  line-height: 1;
  text-transform: uppercase;
}

.route-card small {
  color: rgba(255, 248, 233, .8);
}

.mailing-strip {
  color: var(--paper);
  background:
    linear-gradient(90deg, rgba(116, 48, 28, .95), rgba(45, 34, 25, .95)),
    var(--texture-forest);
}

.mailing-inner {
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  min-height: 104px;
  display: grid;
  grid-template-columns: auto 1fr minmax(320px, .95fr);
  gap: 24px;
  align-items: center;
  padding: 22px 0;
}

.mail-icon {
  width: 74px;
  height: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--paper);
  border: 1px solid rgba(242, 241, 236, .35);
  background: var(--forest-deep);
}

.mailing-strip h2 {
  margin: 0 0 4px;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1.35rem;
  text-transform: none;
}

.mailing-strip p {
  margin: 0;
  color: rgba(255, 248, 233, .82);
}

.mail-form {
  display: flex;
}

.mail-form input {
  min-height: 52px;
  flex: 1;
  border: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 0 16px;
  background: var(--paper);
}

.mail-form .button {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* =========================
   Footer
   ========================= */
.site-footer-rich {
  color: rgba(255, 248, 233, .86);
  background:
    linear-gradient(rgba(13, 14, 11, .94), rgba(13, 14, 11, .96)),
    var(--texture-forest),
    var(--charcoal);
  border-top: 1px solid rgba(199, 169, 97, .25);
}

.footer-inner {
  width: min(var(--site-max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr .75fr .9fr .75fr 1fr;
  gap: 28px;
  padding: clamp(38px, 6vw, 70px) 0;
}

.footer-brand {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.footer-brand img {
  width: 104px;
  height: 104px;
  object-fit: contain;
  padding: 0;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .28));
}

.footer-title {
  margin: 0 0 8px;
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 2rem;
  letter-spacing: .22em;
  line-height: 1;
}

.footer-inner h3 {
  color: var(--tvk-gold);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.footer-inner ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-inner a {
  color: rgba(255, 248, 233, .84);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--tvk-gold);
}

.footer-mark {
  text-align: right;
}

.footer-mark strong {
  display: block;
  color: var(--tvk-gold);
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.05;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.footer-bottom {
  border-top: 1px solid rgba(242, 241, 236, .12);
  padding: 14px var(--page-pad);
  text-align: center;
  color: rgba(255, 248, 233, .64);
  font-size: .82rem;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 1080px) {
  .home-hero {
    --hero-image: url("/images/redesign/hero-image-tablet.webp");
    --hero-gradient: linear-gradient(90deg, rgba(13, 14, 11, .94) 0%, rgba(13, 14, 11, .76) 44%, rgba(13, 14, 11, .16) 76%);
    --hero-image-position: right top;
    --hero-image-size: auto 100%;
    --hero-copy-width: min(56vw, 620px);
    --hero-copy-pad-y: clamp(30px, 4.5vw, 52px);
    --hero-copy-pad-x: clamp(24px, 4vw, 44px);
    --hero-panel-top: -42px;
    --hero-panel-right: -34px;
    --hero-panel-bottom: -42px;
    --hero-panel-left: -50vw;
    --hero-panel-radius: clamp(56px, 8vw, 84px);
  }

  .nav-menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .nav-shell {
    min-height: 56px;
    justify-content: flex-end;
  }

  .nav-list {
    position: absolute;
    left: 16px;
    right: 16px;
    top: calc(100% - 1px);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 14px;
    background:
      linear-gradient(rgba(244, 239, 227, .98), rgba(244, 239, 227, .98)),
      var(--texture-paper);
    border: 1px solid rgba(58, 63, 56, .16);
    box-shadow: var(--shadow-soft);
  }

  .nav-bar.nav-open .nav-list {
    display: flex;
  }

  .has-submenu {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .submenu {
    position: static;
    grid-column: 1 / -1;
    min-width: 0;
    box-shadow: none;
    margin: 0 0 8px;
  }

  .has-submenu:hover .submenu {
    display: none;
  }

  .has-submenu.open .submenu,
  .has-submenu:focus-within .submenu {
    display: block;
  }

  .nav-list a {
    min-height: 42px;
  }

  .principles-inner {
    grid-template-columns: 1fr 1fr;
  }

  .quote-block,
  .land-medallion {
    grid-column: 1 / -1;
  }

  .pillar-grid,
  .action-grid,
  .route-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lineage-intro,
  .lineage-doctrine,
  .community-panel,
  .calendar-layout,
  .flip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-mark {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .home-hero {
    --hero-image: url("/images/redesign/hero-image-mobile.webp");
    --hero-gradient: linear-gradient(180deg, rgba(13, 14, 11, .36) 0%, rgba(13, 14, 11, .46) 34%, rgba(13, 14, 11, .2) 100%);
    --hero-image-position: center top;
    --hero-image-size: cover;
    --hero-copy-width: min(100%, calc(100vw - 32px));
    --hero-copy-pad-y: clamp(28px, 8vw, 42px);
    --hero-copy-pad-x: clamp(22px, 7vw, 34px);
    --hero-panel-top: -26px;
    --hero-panel-right: -14px;
    --hero-panel-bottom: -30px;
    --hero-panel-left: -16px;
    --hero-panel-radius: clamp(34px, 9vw, 54px);
    min-height: clamp(760px, 125vh, 980px);
  }

  .site-title {
    font-size: 1.35rem;
    letter-spacing: .16em;
  }

  .site-subtitle {
    letter-spacing: .22em;
  }

  .site-logo {
    width: 68px;
    height: 68px;
  }

  .hero-panel {
    align-items: flex-start;
    justify-content: center;
    width: calc(100% - 28px);
    padding-top: clamp(150px, 28vh, 230px);
    padding-bottom: clamp(98px, 18vh, 150px);
  }

  .hero-copy::before {
    border-radius: 0 var(--hero-panel-radius) var(--hero-panel-radius) 0 / 0 34% 34% 0;
  }

  .hero-copy h1 {
    font-size: clamp(3.15rem, 14vw, 5.25rem);
    line-height: .94;
  }

  .hero-kicker {
    font-size: clamp(.82rem, 3.4vw, .95rem);
  }

  .hero-copy p {
    font-size: clamp(1rem, 4.1vw, 1.2rem);
  }

  .hero-dots {
    left: var(--page-pad);
  }

  .identity-layout,
  .involved-layout,
  .mailing-inner,
  .record-note-inner,
  .grid {
    grid-template-columns: 1fr;
  }

  .pillar-grid,
  .action-grid,
  .route-grid,
  .lineage-intro,
  .lineage-doctrine,
  .community-panel,
  .calendar-layout,
  .flip-grid,
  .principles-inner,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    display: block;
    border: 0;
    background: transparent;
  }

  .calendar-weekday {
    display: none;
  }

  .calendar-day {
    min-height: auto;
    margin-bottom: 10px;
    border: 1px solid rgba(58, 63, 56, .12);
    border-radius: var(--radius-sm);
  }

  .calendar-day.is-muted:empty,
  .calendar-day.is-muted:not(:has(.calendar-event)) {
    display: none;
  }

  .flip-card {
    min-height: 360px;
  }

  .lineage-hero {
    min-height: 520px;
  }

  .pillar-card,
  .principle-item,
  .quote-block {
    border-right: 0;
    border-bottom: 1px solid rgba(58, 63, 56, .13);
  }

  .principle-item,
  .quote-block {
    border-bottom-color: rgba(242, 241, 236, .16);
  }

  .mail-form {
    flex-direction: column;
    gap: 10px;
  }

  .mail-form input,
  .mail-form .button {
    border-radius: var(--radius-sm);
  }

  .block-text {
    text-align: left;
  }

  .seal-float {
    float: none;
    display: block;
    margin: 0 auto 18px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy,
  .identity-copy,
  .pillar-card,
  .action-card {
    animation: riseIn .7s ease both;
  }

  .pillar-card:nth-child(2),
  .action-card:nth-child(2) { animation-delay: .08s; }
  .pillar-card:nth-child(3),
  .action-card:nth-child(3) { animation-delay: .14s; }
  .pillar-card:nth-child(4),
  .action-card:nth-child(4) { animation-delay: .2s; }

  @keyframes riseIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
