@import url('../fonts/alegreya-sans.css');
/* Valdris public homepage + legal pages. Mobile first; one self-hosted web font (Alegreya Sans, /fonts); images lazy except the hero. */
:root { --v-charcoal: #2a2925; --v-gold: #b98e39; /* Phase 8: measured from the logo (bin/measure-logo.php) */ --ink: #efe6d2; --dim: #b9ad94; --gold: var(--v-gold); --bg: #14110d; --bg2: #1d1913; --line: #3a3226; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 60px; }
/* numfig1 (houses2): lining + tabular figures everywhere (HUD, tables, prices, timers, counts). The self-hosted Alegreya Sans
   woff2 files carry lnum/tnum (checked with fontTools). font-feature-settings is set too because the many `font:` shorthands
   reset font-variant-numeric on descendants but leave font-feature-settings (inherited) alone. */
:root { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
body.home, body.legal { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 'Valdris Num', 'Alegreya Sans', sans-serif; }
a { color: var(--gold); }
img { max-width: 100%; height: auto; display: block; }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 .5em; color: #f6ecd3; letter-spacing: .02em; }
h3, h4 { margin: .2em 0 .4em; }
.dim { color: var(--dim); }
.wrap { max-width: 1500px; margin: 0 auto; padding: 0 20px; }
.btn { display: inline-block; background: linear-gradient(#e2b54a, #a77a1c); color: #1a1206; text-decoration: none; font-weight: bold; padding: .8em 2.2em; border-radius: 6px; border: 1px solid #f3d27d; box-shadow: 0 4px 18px #0008; font-family: inherit; font-size: 1.1rem; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.small { padding: .35em 1em; font-size: .95rem; }

.top { position: sticky; top: 0; z-index: 10; background: #120f0bdd; backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.top nav { display: flex; align-items: center; gap: 16px; max-width: 1500px; margin: 0 auto; padding: 8px 20px; height: 52px; }
.top .brand img { height: 32px; width: auto; }
.top .links { display: flex; gap: 18px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.top .links a { color: var(--ink); text-decoration: none; white-space: nowrap; font-size: .95rem; }
.top .links a:hover { color: var(--gold); }
.me { position: relative; }
.me summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border: 1px solid var(--line); border-radius: 20px; }
.me summary::-webkit-details-marker { display: none; }
.me summary img { width: 28px; height: 28px; border-radius: 50%; background: #000; }
.me summary span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .menu { position: absolute; right: 0; top: 110%; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-width: 180px; box-shadow: 0 8px 24px #000a; }
.me .menu a, .me .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; color: var(--ink); background: none; border: 0; font: inherit; text-decoration: none; cursor: pointer; border-radius: 4px; }
.me .menu a:hover, .me .menu button:hover { background: #2a241b; }

.hero { position: relative; min-height: min(88vh, 820px); display: flex; align-items: center; overflow: hidden; }
.hero .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #0d0b08e6 0%, #0d0b0899 45%, #0d0b0800 75%), linear-gradient(0deg, var(--bg) 0, #0000 22%); }
.hero .inner { position: relative; z-index: 1; padding: 40px 20px 60px max(20px, calc((100vw - 1500px) / 2 + 20px)); max-width: 640px; }
.hero .logo { width: min(520px, 80vw); filter: drop-shadow(0 6px 24px #000); }
.hero .tag { font-size: 1.2rem; margin: .4em 0 1.2em; text-shadow: 0 2px 8px #000; }
.hero .logins { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.err { color: #ff8a80; } .note { color: var(--dim); }

.kingdoms { position: relative; padding: 80px 0; background-color: #100d0a; background-image: linear-gradient(#14110de0, #14110d22), var(--bg); background-image: linear-gradient(#14110de0, #14110d22), image-set(var(--bgw) type('image/webp'), var(--bg) type('image/jpeg')); background-size: cover; background-position: center right; background-attachment: fixed; }
.parallax { background-color: #100d0a; background-image: linear-gradient(#14110de0, #14110d22), var(--bg); background-image: linear-gradient(#14110de0, #14110d22), image-set(var(--bgw) type('image/webp'), var(--bg) type('image/jpeg')); background-size: cover; background-position: center right; background-attachment: fixed; }
.parallax .band { background: transparent; } .parallax #modes { padding-top: 0; } /* Commanders + PvE/PvP read as one section */
.lead { font-size: 1.12rem; max-width: 760px; }
.crests { display: flex; justify-content: center; margin: 30px 0 40px; }
.crests picture { margin: 0 -18px; }
.crests .crest { width: clamp(90px, 17vw, 190px); filter: drop-shadow(0 8px 16px #000c); transition: transform .3s; }
.crests .c1, .crests .c3 { transform: translateY(18px) rotate(-4deg); } .crests .c2 { transform: scale(1.12); z-index: 1; position: relative; }
.crests .crest-myrrhal, .crests .crest-draeven { position: relative; z-index: 2; } /* scaled up via inline scale (Home::CREST_SCALE) */
.crests .crest:hover { transform: translateY(-6px) scale(1.06); }
.cards.k { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.cards.k article { background: #1b1711e8; border: 1px solid var(--line); border-top: 4px solid var(--kc); border-radius: 8px; padding: 14px; }
.cards.k h3 { display: flex; align-items: center; gap: 8px; } .cards.k .ki { width: 40px; height: 40px; }
.cards.k ul { padding-left: 1.1em; margin: .3em 0 0; font-size: .93rem; } .up::marker { color: #7cc36b; } .down::marker { color: #e57373; }
.cards.k p { margin: 0; font-style: italic; }

.band { padding: 80px 0; } .band.alt { background: var(--bg2); }
.two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; } .two.rev > :first-child { order: 0; }
.collage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 10px 24px; }
.collage figure { margin: 0 -10px 18px; text-align: center; transform: rotate(calc((var(--i) - 2.5) * 1.4deg)); }
.collage figure:nth-child(even) { margin-top: 22px; }
.collage img { width: 100%; max-width: 150px; margin: 0 auto; border: 3px solid var(--rc); border-radius: 8px; box-shadow: 0 0 0 1px #000, 0 10px 22px #000c, 0 0 14px color-mix(in srgb, var(--rc) 45%, transparent); }
.collage figcaption { font-size: .9rem; margin-top: 6px; } .collage small, .blds small { display: block; color: var(--dim); font-size: .78rem; }
.pc { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; } .pc.one { grid-template-columns: 1fr; } .pc ul { padding-left: 1.1em; margin: 0; } .pc h4 { color: var(--gold); }
.rar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; } .rar span { border: 2px solid var(--rc); border-radius: 12px; padding: 1px 9px; font-size: .8rem; text-transform: capitalize; }
.stewards { display: flex; justify-content: center; } .stewards figure { margin: 0 -10px; text-align: center; } .stewards img { width: clamp(100px, 14vw, 160px); box-shadow: 0 0 0 1px #000, 0 10px 22px #000c; border: 2px solid #8a7550; border-radius: 6px; } .stewards figcaption { font-size: .9rem; margin-top: 6px; }
.stewards figure:nth-child(2) { transform: translateY(-16px); z-index: 1; }
.blds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 30px 0; }
.blds figure { margin: 0; background: radial-gradient(ellipse at 50% 70%, #3a3122 0, #1d1913 70%); border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 12px; text-align: center; }
.blds img { margin: 0 auto; max-height: 220px; width: auto; }
.what { columns: 2 280px; padding-left: 1.1em; } .what li { margin-bottom: .5em; break-inside: avoid; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.modes article { position: relative; border-radius: 12px; overflow: hidden; min-height: 340px; display: flex; align-items: flex-end; border: 1px solid var(--line); }
.modes picture { position: absolute; inset: 0; } .modes .cover { width: 100%; height: 100%; object-fit: cover; }
.modes article > div { position: relative; padding: 24px; background: linear-gradient(0deg, #0d0b08f0 30%, #0000); width: 100%; }
.foot { border-top: 1px solid var(--line); padding: 30px 0; text-align: center; color: var(--dim); } .foot img { margin: 0 auto 8px; }

.legal main { max-width: 820px; margin: 0 auto; padding: 40px 20px 80px; } .legal .draft { border: 2px dashed #ff9800; background: #2a1e0c; padding: 10px 14px; border-radius: 8px; }
.legal h1 { color: #f6ecd3; } .legal header { padding: 14px 20px; border-bottom: 1px solid var(--line); } .legal header img { height: 32px; width: auto; }

@media (max-width: 820px) {
  .top .links { display: none; }
  .top nav { justify-content: space-between; }
  .two, .modes, .pc { grid-template-columns: 1fr; gap: 28px; }
  .two.rev > :first-child { order: 1; }
  .kingdoms, .parallax { background-attachment: scroll; }
  .hero { min-height: min(78vh, 640px); } .hero::after { background: linear-gradient(0deg, var(--bg) 0, #0d0b08aa 40%, #0d0b0866 100%); }
  .hero .inner { padding: 30px 20px 50px; text-align: center; margin: 0 auto; } .hero .logo { margin: 0 auto; } .hero .logins { align-items: center; }
  .band, .kingdoms { padding: 54px 0; }
  .crests picture { margin: 0 -12px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .kingdoms, .parallax { background-attachment: scroll; } }
.legal mark.ph { background: #ffd23f; color: #111; padding: 0 3px; border-radius: 3px; font-weight: bold; }
/* art v21: kingdom bonus art on top of each Kingdoms card */
.cards.k .kb img { display: block; width: calc(100% + 28px); max-width: none; height: auto; aspect-ratio: 16 / 10; object-fit: cover; margin: -14px -14px 10px; border-radius: 4px 4px 0 0; }
/* art v22: sign-in backdrop behind the login panel (logged out) */
.hero.signin { background-color: #0d0b08; background-image: var(--sbj); background-image: image-set(var(--sbw) type("image/webp"), var(--sbj) type("image/jpeg")); background-size: cover; background-position: center; }
.hero.signin > picture { display: none; }

/* houses2: kingdom bonus cards (portrait: icon / title / value) + mouse-following tooltip */
.cards.k ul.hbon { list-style: none; padding: 0; margin: .7em 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; font-size: 1rem; }
.hb { min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 6px 2px 5px; background: #120f0bcc; border: 1px solid #b98e3955; border-radius: 6px; cursor: help; }
.hb:hover, .hb:focus { border-color: #e0b85a; outline: none; background: #1d1812; }
.hb .hbi { width: 44px; height: 44px; display: block; }
.hb b { overflow-wrap: anywhere; hyphens: auto; font-size: .72rem; line-height: 1.15; font-weight: 600; color: #e8dcc0; }
.hb .hv { margin-top: auto; font-size: 1.05rem; font-weight: 700; color: #e0b85a; font-variant-numeric: lining-nums tabular-nums; }
.htip { position: fixed; z-index: 1000; box-sizing: border-box; width: max-content; max-width: min(420px, 90vw); white-space: normal; overflow-wrap: anywhere; padding: 8px 11px; background: #15110cf2; color: #efe6d0; border: 1px solid #b98e39; border-radius: 6px; font-size: 1rem; line-height: 1.35; pointer-events: none; box-shadow: 0 4px 16px #000a; }
/* homecards1: Stewards (inside Buildings) + Army Commanders as in-game roster cards: portrait, name, rank, then trait cards
   (icon + value underneath, pro = green inner glow, con = red; hover = #htip bold name + description). Same rules as game.css
   .trait.tcard, a little smaller. Trait icons also lead each Talents / Quirks / Traits list item. */
.stw { margin-top: 40px; } .stw h3 { margin: 0 0 .4em; font-size: 1.6rem; color: var(--gold); }
.hcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.hcard { margin: 0; padding: 8px 6px 8px; text-align: center; background: #15110ce6; border: 1px solid #6d5a33; border-radius: 8px; box-shadow: 0 8px 20px #000a; }
.hcard img:not(.tci) { display: block; width: 100%; max-width: 128px; height: auto; margin: 0 auto; border: 2px solid var(--rc, #8a7550); border-radius: 6px; box-shadow: 0 0 0 1px #000, 0 0 10px color-mix(in srgb, var(--rc, #8a7550) 40%, transparent); }
.hcard figcaption { margin-top: 5px; font-weight: 700; font-size: .92rem; color: #f0e2c0; } .hcard small { display: block; font-weight: 400; color: var(--dim); font-size: .74rem; }
.tcards { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; margin-top: 6px; }
.trait.tcard { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; width: 40px; padding: 2px 1px 1px; box-sizing: border-box; border-radius: 5px; border: 1px solid #5a4a2a; background: #15110c; cursor: help;
  font: 700 .66rem/1.1 'Valdris Num', 'Alegreya Sans', sans-serif; }
.trait.tcard.pro { box-shadow: inset 0 0 8px #3fbf4fcc; border-color: #3f7a3a; color: #8fd18f; }
.trait.tcard.con { box-shadow: inset 0 0 8px #e5392fcc; border-color: #8a2e28; color: #ff7a6e; }
.trait.tcard:hover, .trait.tcard:focus-visible { border-color: #e0b84a; outline: none; }
.trait.tcard .tci { width: 32px; height: 32px; display: block; border-radius: 4px; object-fit: contain; }
.trait.tcard .tph { display: flex; align-items: center; justify-content: center; font-style: normal; font-size: .72rem; color: #d8c08a; background: radial-gradient(circle at 50% 40%, #3a2f1c, #1b1610); border: 1px solid #6d5a33; box-sizing: border-box; }
.trait.tcard .tcv { white-space: nowrap; }
.htip b { color: #ffd98a; }
ul.tl { list-style: none; padding-left: 0; } ul.tl li { display: flex; align-items: center; gap: 8px; margin-bottom: .35em; } ul.tl picture { flex: none; line-height: 0; }
.lti { width: 26px; height: 26px; border-radius: 4px; flex: none; }
@media (max-width: 700px) { .hcards { gap: 8px; } }
/* homecards1: match the in-game roster card (.vcard): rarity top edge + frame, gold bold name, class / tier line */
.hcard { border-top: 3px solid var(--rc, #6d5a33); } .hcard img:not(.tci) { border-width: 3px; }
.hcard .vname { display: block; font-weight: 700; color: #f3d27a; line-height: 1.15; } .hcard .vcls { color: #cbbd98; margin-top: 2px; }
/* traitpct1: smaller value under the trait icon so '+13.3%' / '1.1%/h' fit with padding; value repeated in the tooltip */
.trait.tcard .tcv { font-size: .8em; letter-spacing: -.02em; max-width: 100%; padding: 0 .15em; box-sizing: border-box; overflow: hidden; }
.htip .tipv { font-weight: 700; } .htip .tipv.pro { color: #6fdc6f; } .htip .tipv.con { color: #ff6a5e; }
/* landtrait1: trait icons never take the card rarity frame; same as the in-game trait box (only the pro green / con red inner glow on the box) */
.hcard .trait.tcard .tci { border: 0; box-shadow: none; margin: 0; max-width: none; border-radius: 4px; }
