/* index — this page's own styles; the tokens are tokens.css, the header, footer and buttons site.css */
/* restore the original gold accents + light footer wordmark in dark */
[data-theme="dark"] .news-tag, [data-theme="dark"] .cta-steps li::before, [data-theme="dark"] .cta-step-body code { color: var(--gold-hi); }
/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink) var(--grain-dark);
  color: var(--bone);
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: 1.7;
  overflow-x: hidden;
}
/* Parchment ground — light mode only */
html:not([data-theme="dark"]) body {
  background-color: var(--ink);
  background-image:
  radial-gradient(125% 90% at 50% -8%, rgba(255,251,238,.28), transparent 58%),
  radial-gradient(110% 120% at 50% 118%, rgba(74,54,22,.045), transparent 55%),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='pm' filterUnits='userSpaceOnUse' x='0' y='0' width='600' height='600'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.01' numOctaves='4' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .30 0 0 0 0 .20 0 0 0 0 .08 0 0 0 .08 0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='gamma' amplitude='1.1' exponent='.8'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23pm)'/%3E%3C/svg%3E"),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='pg' filterUnits='userSpaceOnUse' x='0' y='0' width='200' height='200'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .22 0 0 0 0 .10 0 0 0 .022 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23pg)'/%3E%3C/svg%3E");
  background-size: cover, cover, 600px 600px, 200px 200px;
  background-repeat: no-repeat, no-repeat, repeat, repeat;
  background-attachment: fixed, fixed, scroll, scroll;
}
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.12; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 2px; }
.num { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.eyebrow {
  display: inline-block; font-family: var(--f-title); font-weight: 600;
  font-size: var(--t-xs); letter-spacing: .22em; text-transform: uppercase; color: var(--faint);
}
/* ============ Hero ============ */
.hero {
  position: relative; isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--header-h) + var(--s5)) 0 var(--s3);
  text-align: center; overflow: hidden;
}
.hero-art { position: absolute; inset: 0; z-index: -2; }
.hero-art img, .hero-video {
  /* decorative backdrop: deliberate cover crop of the 16:9 footage */
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%;
  filter: var(--grade);
}
.hero-video { opacity: 0; transition: opacity var(--dur-m) var(--ease-out); }
.hero-video.is-playing { opacity: 1; }
/* over the video (and the still before it): a 40% black veil that softens the footage behind the words */
.hero-art::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--grain-dark);
}
.hero > .wrap { margin-block: auto; }
.hero-inner { display: flex; flex-direction: column; align-items: center; max-width: 940px; margin-inline: auto; }
.hero-sub {
  font-family: var(--f-title); font-size: clamp(1rem, .9rem + .5vw, 1.25rem); font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold-hi);
  text-shadow: 0 2px 16px rgba(0, 0, 0, .7); margin-bottom: var(--s2);
}
.hero-title {
  font-family: var(--f-hero); font-size: clamp(3.25rem, 1.6rem + 6vw, 7rem); font-weight: 400;
  line-height: .98; letter-spacing: .01em; color: var(--on-dark); text-shadow: 0 4px 24px rgba(0, 0, 0, .7);
}
.hero-lead {
  margin-top: var(--s3); max-width: 46ch; font-size: clamp(1.125rem, 1rem + .4vw, 1.3125rem);
  line-height: 1.55; color: var(--on-dark); text-shadow: 0 2px 14px rgba(0, 0, 0, .7);
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 20px; margin-top: var(--s4); }
/* Hero divider — gilded rampart with a banner valance hung from it */
.hero-divider { position: relative; z-index: 3; margin-top: -16px; pointer-events: none; }
.hero-divider .merlons {
  height: 16px; background: linear-gradient(180deg, var(--btn-rule-color), var(--gold-hi));
  -webkit-mask: linear-gradient(#000 0 0) bottom / 100% 6px no-repeat, repeating-linear-gradient(90deg, #000 0 16px, transparent 16px 32px) top / 100% 10px no-repeat;
  mask: linear-gradient(#000 0 0) bottom / 100% 6px no-repeat, repeating-linear-gradient(90deg, #000 0 16px, transparent 16px 32px) top / 100% 10px no-repeat;
}
.hero-divider .valance {
  height: 34px; background: var(--grain-dark), linear-gradient(180deg, var(--btn-red), var(--btn-red-deep)); border-top: 2px solid var(--btn-rule-color);
  -webkit-mask: radial-gradient(circle 14px at 16px 100%, transparent 96%, #000 100%) 0 0 / 32px 100% repeat-x;
  mask: radial-gradient(circle 14px at 16px 100%, transparent 96%, #000 100%) 0 0 / 32px 100% repeat-x;
}
/* ============ Section scaffold ============ */
.section { padding-block: clamp(var(--s6), 10vw, var(--s7)); scroll-margin-top: var(--header-h); }
.section-head { max-width: 62ch; }
.section-head.centered { margin-inline: auto; text-align: center; }
.section-title { font-family: var(--f-hero); font-weight: 400; font-size: clamp(2.5rem, 1.7rem + 3vw, 3.75rem); letter-spacing: .01em; color: var(--bone); margin-top: 14px; }
.section-standfirst { margin-top: var(--s1); font-size: 1.1875rem; line-height: 1.55; color: var(--muted); }
.rule-gold { width: 56px; height: 2px; background: var(--gold-hi); border: 0; margin: 0 0 4px; }
.centered .rule-gold { margin-inline: auto; }
/* ============ Feature cards (image-led, real KCD2 screenshots) ============ */
.feature-grid { margin-top: var(--s5); display: grid; gap: var(--s2); grid-template-columns: repeat(3, 1fr); }
.feature-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  transition: border-color var(--dur-s) var(--ease-out), transform var(--dur-s) var(--ease-out);
}
.feature-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-raised); }
.feature-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  filter: var(--grade);
  transition: transform 640ms var(--ease-out);
}
.feature-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
  var(--grain-dark),
  linear-gradient(180deg, rgba(11,10,9,.08) 0%, rgba(11,10,9,0) 38%, rgba(11,10,9,.58) 100%);
}
.feature-band {
  position: relative; padding: 11px var(--s3);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--f-title); font-size: var(--t-xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--btn-on-red);
  background: var(--btn-cloth), linear-gradient(135deg, var(--btn-red), var(--btn-red-deep));
}
.feature-band::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--btn-rule-color), transparent); }
.feature-body { padding: var(--s3) var(--s3) var(--s4); display: flex; flex-direction: column; gap: 10px; }
.feature-body h3 { font-family: var(--f-title); font-weight: 700; font-size: 1.375rem; color: var(--bone); }
.feature-body p { font-size: 1.0625rem; line-height: 1.55; color: var(--muted); }
/* ============ News ============ */
.news-grid { margin-top: var(--s5); display: grid; gap: var(--s2); grid-template-columns: repeat(3, 1fr); }
.news-card {
  display: flex; flex-direction: column; gap: 14px; padding: var(--s3);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  text-decoration: none; color: inherit;
  transition: border-color var(--dur-s) var(--ease-out), background var(--dur-s) var(--ease-out), transform var(--dur-s) var(--ease-out);
}
@media (hover: hover) {
  .news-card:hover { border-color: var(--border-hi); background: var(--surface-hi); transform: translateY(-2px); }
}
.news-meta { display: flex; align-items: center; gap: 12px; font-family: var(--f-title); font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.news-tag { color: var(--btn-red); }
.news-card h3 { font-family: var(--f-title); font-weight: 700; font-size: 1.3125rem; color: var(--bone); line-height: 1.2; }
.news-card p { font-size: 1.0625rem; line-height: 1.5; color: var(--muted); }
.news-card .read { margin-top: auto; font-family: var(--f-title); font-size: var(--t-xs); letter-spacing: .06em; color: var(--bone); }
.news-note { margin-top: var(--s3); font-size: var(--t-sm); color: var(--muted); font-style: italic; }
/* ============ CTA band ============ */
.cta { position: relative; background: var(--bg-raised); border-block: 1px solid var(--border); overflow: hidden; }
.cta::before { content: ""; position: absolute; inset: 0; background: var(--grain-dark); opacity: .6; pointer-events: none; }
.cta .wrap { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); align-items: center; }
.cta-steps { list-style: none; counter-reset: step; margin: var(--s3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.cta-steps li { counter-increment: step; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: baseline; }
.cta-steps li::before {
  content: counter(step); font-family: var(--f-title); font-weight: 700; font-size: 1.125rem; color: var(--btn-red);
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-hi); border-radius: 999px;
}
.cta-step-title { font-family: var(--f-title); font-weight: 600; font-size: 1.1875rem; color: var(--bone); }
.cta-step-body { color: var(--muted); font-size: 1.0625rem; line-height: 1.5; margin-top: 4px; }
.cta-step-body code { font-family: var(--f-title); font-size: .9em; letter-spacing: .02em; color: var(--btn-red); background: var(--surface); padding: 1px 7px; border-radius: 4px; }
.cta-aside { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }
.cta-aside .section-title { margin-top: 10px; }
.cta-aside .btn-primary { margin-top: var(--s1); }
/* ============ Great houses (heraldic banner, drag-to-scroll) ============ */
.house-row { position: relative; margin-top: var(--s5); }
.house-track { display: flex; gap: var(--s2); overflow-x: auto; scroll-snap-type: x proximity; scroll-behavior: smooth; padding: 6px 2px 14px; scrollbar-width: none; cursor: grab; }
.house-track::-webkit-scrollbar { display: none; }
.house-track.dragging { cursor: grabbing; scroll-behavior: auto; scroll-snap-type: none; user-select: none; }
/* centre the row when it fits; auto margins collapse to 0 once it overflows, so scrolling still reaches the first card */
.house-card:first-child { margin-inline-start: auto; }
.house-card:last-child { margin-inline-end: auto; }
.house-card { scroll-snap-align: start; flex: 0 0 auto; width: 190px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 10px 8px; }
.house-flag { display: grid; place-items: center; }
.house-arms { height: 152px; width: auto; -webkit-user-drag: none; user-select: none; pointer-events: none; filter: drop-shadow(0 10px 16px rgba(0,0,0,.5)); }
.house-body { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.house-name { font-family: var(--f-hero); font-size: 1.75rem; line-height: 1; color: var(--bone); }
.house-map { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--f-title); font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em; color: var(--bone); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--gold-hi) 60%, transparent); text-underline-offset: 4px; transition: text-decoration-color var(--dur-s) var(--ease-out); }
@media (hover: hover) {
  .house-map:hover { text-decoration-color: var(--gold-hi); }
}
/* ============ Reveal-on-scroll ============ */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity var(--dur-l) var(--ease-out), transform var(--dur-l) var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
/* ============ Responsive ============ */
@media (max-width: 960px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr; }
  .cta .wrap { grid-template-columns: 1fr; gap: var(--s3); }
}
@media (max-width: 767px) {
  .feature-grid { grid-template-columns: 1fr; }
  .hero-actions .btn-primary, .hero-actions .btn-secondary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; }
}
/* a house with no arms of its own: a plain red heater shield with its initial */
.house-blank {
  display: grid; place-items: center; width: 113px; height: 152px; font-family: var(--f-hero); font-size: 4rem; line-height: 1; color: var(--gold-hi);
  background: var(--btn-cloth), linear-gradient(180deg, var(--btn-red), var(--btn-red-deep));
  clip-path: path("M0 0H113V82C113 122 84 144 56.5 152C29 144 0 122 0 82Z"); text-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.houses[hidden] { display: none; }
