/* Riseforge website – a Riddersoft game. Brand tokens from brand/brand.md. */
@font-face { font-family: "Alfa Slab One"; src: url("/fonts/alfa-slab-one-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/fonts/lexend-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/fonts/lexend-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/fonts/lexend-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/fonts/lexend-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --rf-bg: #EEF6F3; --rf-panel: #FFFFFF; --rf-border: #CFE2DC;
  --rf-text: #13302A; --rf-text-muted: #4A625C; --rf-iron: #2B373D;
  --rf-primary: #0B7468; --rf-primary-hover: #12A594; --rf-primary-deep: #075A51; --rf-on-primary: #FFFFFF;
  --rf-accent: #F2622E; --rf-accent-strong: #B8401A; --rf-accent-deep: #8E3013; --rf-spark: #FFC23D;
  --rf-sky: #BFE8DF; --rf-sky-ray: #DDF3EC;
  --rf-success: #2E7D32; --rf-success-bg: #7CC46A;
  --rf-warning: #8A5A00; --rf-warning-bg: #F6C445;
  --rf-danger: #C0352B; --rf-danger-bg: #F2A79B;
  --rf-shallows: #7FD6CF; --rf-sea: #2B93B5; --rf-deep: #1B5F86;
  --rf-grass: #8BCB5A; --rf-forest: #4E9A47; --rf-sand: #F2E2AE; --rf-rock: #A5AEA9;
  --rf-era-founding: #8B5A2B; --rf-era-iron: #C2410C; --rf-era-classical: #557219; --rf-era-medieval: #7A3A8C; --rf-era-sail: #1D63A6;
  --rf-night: #1E2A2F; --rf-night-panel: #2B3A40; --rf-night-text: #EAF4F1; --rf-night-muted: #A9C2BB;
  --rf-font-display: "Alfa Slab One", Georgia, serif;
  --rf-font-ui: "Lexend", system-ui, sans-serif;
  --rf-radius: 14px; --rf-radius-sm: 8px;
  --wrap: 1160px; --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--rf-bg); color: var(--rf-text); font: 400 16px/1.6 var(--rf-font-ui); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: var(--rf-primary); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--rf-primary-deep); }
:focus-visible { outline: 3px solid var(--rf-iron); outline-offset: 3px; border-radius: 4px; }
.on-dark :focus-visible, .site-footer :focus-visible { outline-color: var(--rf-spark); }
h1, h2, .display { font-family: var(--rf-font-display); font-weight: 400; line-height: 1.12; letter-spacing: 0.005em; margin: 0 0 .5em; }
h1 { font-size: clamp(34px, 6vw, 62px); }
h2 { font-size: clamp(26px, 3.6vw, 40px); }
h3 { font: 600 20px/1.3 var(--rf-font-ui); margin: 0 0 .4em; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--rf-text-muted); }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--rf-text-muted); max-width: 56ch; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--rf-iron); color: #fff; padding: 10px 16px; border-radius: var(--rf-radius-sm); z-index: 50; }
.skip:focus { top: 12px; color: #fff; }

/* Buttons: chunky, with a pressed-metal bottom edge */
.btn { --b: var(--rf-primary); --bd: var(--rf-primary-deep); display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 10px 22px; border: 0; border-radius: 12px; background: var(--b); color: var(--rf-on-primary); font: 600 16px/1.2 var(--rf-font-ui); text-decoration: none; cursor: pointer; box-shadow: inset 0 -4px 0 var(--bd); transition: transform .08s ease, background-color .15s ease; }
.btn:hover { color: #fff; background: color-mix(in srgb, var(--b) 88%, #000); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--bd); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .65; cursor: progress; }
.btn-forge { --b: var(--rf-accent-strong); --bd: var(--rf-accent-deep); }
.btn-iron { --b: var(--rf-iron); --bd: #182024; }
.btn-danger { --b: var(--rf-danger); --bd: #8E2620; }
.btn-big { min-height: 60px; padding: 14px 34px; font-size: 19px; border-radius: 14px; box-shadow: inset 0 -5px 0 var(--bd); }
.btn-ghost { background: transparent; color: var(--rf-text); box-shadow: inset 0 0 0 2px var(--rf-border); }
.btn-ghost:hover { background: var(--rf-panel); color: var(--rf-text); }
.btn-link { background: none; border: 0; padding: 10px 4px; min-height: 44px; color: var(--rf-primary); font: 500 15px var(--rf-font-ui); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--rf-bg) 94%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rf-border); }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--rf-iron); margin-right: auto; min-height: 44px; }
.brand img { width: 40px; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-word { font-family: var(--rf-font-display); font-size: 24px; color: var(--rf-iron); }
.brand-endorse { font: 500 12px/1.4 var(--rf-font-ui); color: var(--rf-text-muted); margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--rf-text); text-decoration: none; font-weight: 500; }
.nav a:not(.btn):hover { background: var(--rf-panel); }
.nav a[aria-current="page"] { color: var(--rf-primary); box-shadow: inset 0 -3px 0 var(--rf-primary); border-radius: 0; }
.lang { display: inline-flex; padding: 3px; background: var(--rf-panel); border: 1px solid var(--rf-border); border-radius: 12px; }
.lang button { min-width: 44px; min-height: 40px; border: 0; background: none; border-radius: 9px; font: 600 14px var(--rf-font-ui); color: var(--rf-text-muted); cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--rf-iron); color: #fff; }
.menu { position: relative; display: none; }
.menu summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; cursor: pointer; border: 1px solid var(--rf-border); background: var(--rf-panel); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary svg { width: 22px; height: 22px; }
.menu-panel { position: absolute; right: 0; top: 56px; width: min(280px, calc(100vw - 32px)); background: var(--rf-panel); border: 1px solid var(--rf-border); border-radius: var(--rf-radius); padding: 8px; box-shadow: 0 12px 30px -12px rgba(19, 48, 42, .35); display: grid; gap: 2px; }
.menu-panel a { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 10px; color: var(--rf-text); text-decoration: none; font-weight: 500; }
.menu-panel a:hover { background: var(--rf-bg); }
.menu-panel .lang { margin: 8px 6px 4px; align-self: start; width: max-content; }
@media (max-width: 760px) {
  .site-header .nav a.nav-link, .site-header .nav > .lang { display: none; }
  .menu { display: block; }
  .brand-word { font-size: 21px; }
  .brand img { width: 36px; height: 36px; }
  .site-header .btn { padding: 10px 16px; }
}
@media (max-width: 380px) { .brand-endorse { font-size: 11px; } .site-header .wrap { gap: 8px; } }

/* Footer */
.site-footer { background: var(--rf-iron); color: var(--rf-night-text); margin-top: 0; }
.site-footer .wrap { display: grid; gap: 28px; padding-block: 44px 28px; grid-template-columns: 1.3fr 1fr 1fr; }
.site-footer a { color: var(--rf-night-text); }
.site-footer a:hover { color: #fff; }
.footer-brand img { width: 200px; height: auto; margin-bottom: 12px; }
.footer-brand p { color: var(--rf-night-muted); font-size: 15px; max-width: 34ch; }
.footer-endorse { font-weight: 500; color: var(--rf-night-muted); }
.footer-endorse a { color: var(--rf-night-text); }
.site-footer h2 { font: 600 15px/1.4 var(--rf-font-ui); color: var(--rf-night-muted); margin: 0 0 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.site-footer li a:hover { text-decoration: underline; }
.footer-base { grid-column: 1 / -1; border-top: 1px solid var(--rf-night-panel); padding-top: 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--rf-night-muted); font-size: 14px; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* Forms and panels (login, account, reset) */
.page-plain { padding-block: clamp(28px, 6vw, 64px); }
.panel { background: var(--rf-panel); border: 1px solid var(--rf-border); border-radius: var(--rf-radius); padding: clamp(20px, 4vw, 36px); }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field > label, .field > .label { font-weight: 600; font-size: 15px; }
.hint { font-size: 13.5px; color: var(--rf-text-muted); margin: 0; }
.input, select.input { width: 100%; min-height: 50px; padding: 12px 14px; font: 400 16px var(--rf-font-ui); color: var(--rf-text); background: #fff; border: 2px solid var(--rf-border); border-radius: 10px; }
.input:hover { border-color: #A9CBC1; }
.input:focus { outline: none; border-color: var(--rf-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rf-primary) 25%, transparent); }
.input[aria-invalid="true"] { border-color: var(--rf-danger); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2313302A' stroke-width='2.2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 84px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 44px; min-width: 72px; border: 0; background: none; color: var(--rf-primary); font: 600 14px var(--rf-font-ui); cursor: pointer; border-radius: 8px; }
.check { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; margin-bottom: 12px; min-height: 44px; font-size: 15px; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--rf-primary); cursor: pointer; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-height: 20px; margin: 0; }
.status-line[data-state="ok"] { color: var(--rf-success); }
.status-line[data-state="bad"] { color: var(--rf-danger); }
.status-line[data-state="ok"]::before, .status-line[data-state="bad"]::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.meter span { height: 6px; border-radius: 3px; background: var(--rf-border); }
.meter[data-level="1"] span:nth-child(-n+1) { background: var(--rf-danger); }
.meter[data-level="2"] span:nth-child(-n+2) { background: var(--rf-warning-bg); }
.meter[data-level="3"] span:nth-child(-n+3) { background: var(--rf-success-bg); }
.meter[data-level="4"] span { background: var(--rf-success); }
.alert { border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; font-size: 15px; border: 1px solid; }
.alert[hidden] { display: none; }
.alert-error { background: #FCEBE8; border-color: var(--rf-danger-bg); color: #7E1F18; }
.alert-ok { background: #EAF6E6; border-color: var(--rf-success-bg); color: #1F5A23; }
.alert-info { background: #FFF6DE; border-color: var(--rf-warning-bg); color: #5C3C00; }
.note { background: var(--rf-bg); border-left: 4px solid var(--rf-spark); border-radius: 0 10px 10px 0; padding: 14px 16px; font-size: 15px; margin-bottom: 18px; }
.note p:last-child { margin: 0; }

/* Prose pages (rules, privacy) */
.prose { max-width: 70ch; }
.prose h1 { font-size: clamp(32px, 5vw, 48px); }
.prose h2 { font-size: clamp(22px, 2.6vw, 28px); margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.draft-banner { display: flex; gap: 12px; align-items: flex-start; background: #FFF6DE; border: 1px solid var(--rf-warning-bg); color: #5C3C00; border-radius: 12px; padding: 14px 16px; margin-bottom: 28px; font-size: 15px; }
.draft-banner strong { color: var(--rf-warning); }
.todo { background: var(--rf-warning-bg); color: var(--rf-text); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.loading { color: var(--rf-text-muted); }

/* Riddersoft Games portal look (portal, login, account, privacy): calm Riddersoft off-white, Lexend only */
.theme-portal { --rf-bg: #F8F7F4; --rf-border: #E3DFD6; --rf-text: #1C2427; --rf-text-muted: #545C5F; }
.theme-portal h1, .theme-portal h2 { font-family: var(--rf-font-ui); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.theme-portal .prose h1, .theme-portal .page-plain h1 { font-size: clamp(30px, 4.4vw, 44px); }
.theme-portal .site-header { background: color-mix(in srgb, #F8F7F4 94%, transparent); }
.theme-portal .lang button[aria-pressed="true"] { background: var(--rf-iron); }
.brand-portal img { width: 36px; height: 36px; }
.portal-word { font: 700 20px/1 var(--rf-font-ui); letter-spacing: -0.02em; color: var(--rf-text); }
.portal-word span, .footer-word span { font-weight: 400; color: var(--rf-text-muted); }
.footer-word { font: 700 24px/1.2 var(--rf-font-ui); letter-spacing: -0.02em; color: #fff; margin-bottom: 10px; }
.footer-word span { color: var(--rf-night-muted); }
.theme-portal .site-footer { background: #1C2427; }
.theme-portal .site-footer .footer-base { border-top-color: #33403F; }
@media (max-width: 760px) { .theme-portal .site-header .nav > .lang { display: none; } .portal-word { font-size: 18px; } }
