/* ==========================================================================
   ORIGIN ROHAN · shared design system
   Refined dark fantasy: warm black, antique gold, crimson.
   Display: Cinzel · Accent: Cormorant Garamond · Interface: Inter
   Loaded by every public page through partials/site.php.
   ========================================================================== */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-width: 320px;
    color: var(--text-soft);
    background:
        radial-gradient(1100px 560px at 50% -180px, rgba(127, 26, 42, .2), transparent 70%),
        var(--ink-900);
    font: 400 16px/1.65 var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
/* A whisper of grain keeps the large dark fields from looking flat. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .92 0 0 0 0 .8 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; }
h1, h2, h3, h4, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--gold-300); text-decoration: none; }
a:hover { color: var(--gold-200); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { color: #1d1307; background: var(--gold-400); }
:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }

.shell { width: min(var(--shell), 100% - var(--gutter) * 2); margin-inline: auto; }
.shell-narrow { width: min(820px, 100% - var(--gutter) * 2); margin-inline: auto; }
.icon { flex: 0 0 auto; display: block; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 300; padding: 10px 16px; color: #1d1307; background: var(--gold-300); border-radius: var(--radius-sm); font-weight: 600; transition: top .15s ease; }
.skip-link:focus { top: 12px; color: #1d1307; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type ---------- */
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--gold-500);
    font: 600 12px/1.2 var(--font-body);
    letter-spacing: .26em;
    text-transform: uppercase;
}
.kicker::before { content: ''; width: 28px; height: 1px; background: currentColor; opacity: .75; }
.title {
    color: var(--text);
    font: 600 clamp(28px, 3.4vw, 44px)/1.14 var(--font-display);
    letter-spacing: .025em;
    text-wrap: balance;
}
.title-sm { font-size: clamp(21px, 2.2vw, 27px); }
.gilded, .title em {
    font-style: normal;
    color: var(--gold-300);
    background: linear-gradient(180deg, #f8ebc8 0%, #dcbb78 52%, #a67f3d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.lead { color: var(--text-soft); font: 500 clamp(19px, 1.7vw, 23px)/1.5 var(--font-accent); text-wrap: pretty; }
.muted { color: var(--text-mute); }
.num { font-variant-numeric: tabular-nums; }

/* Diamond divider used under section titles. */
.ornament { display: flex; align-items: center; gap: 14px; color: var(--gold-500); }
.ornament::before, .ornament::after { content: ''; width: min(110px, 20vw); height: 1px; background: linear-gradient(90deg, transparent, var(--gold-600)); }
.ornament::after { transform: scaleX(-1); }
.ornament i { width: 9px; height: 9px; transform: rotate(45deg); background: var(--crimson-500); border: 1px solid var(--gold-400); box-shadow: 0 0 0 3px rgba(196, 155, 82, .12); }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(64px, 8.5vw, 116px) 0; }
.section-tight { padding: clamp(44px, 6vw, 76px) 0; }
.section-alt { background: linear-gradient(180deg, rgba(7, 5, 4, .55), rgba(7, 5, 4, .2)); border-block: 1px solid var(--line-soft); }
.section-head { display: grid; gap: 16px; max-width: 720px; margin-bottom: clamp(32px, 4.5vw, 56px); }
.section-head.is-center { justify-items: center; margin-inline: auto; text-align: center; }
.section-head.is-center .kicker::after { content: ''; width: 28px; height: 1px; background: currentColor; opacity: .75; }
.section-head.is-split { max-width: none; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.section-head.is-split > div { display: grid; gap: 14px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: 700 13px/1 var(--font-display);
    letter-spacing: .13em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .16s ease, filter .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold {
    color: #1d1307;
    background: linear-gradient(180deg, #f5e3ae 0%, #dcb96f 46%, #b88b41 100%);
    border-color: #f6e7c1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -2px 0 rgba(96, 66, 22, .4), 0 10px 26px rgba(0, 0, 0, .4);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .3);
}
.btn-gold:hover { color: #1d1307; filter: brightness(1.08); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -2px 0 rgba(96, 66, 22, .4), 0 14px 32px rgba(196, 155, 82, .22); }
.btn-ghost { color: var(--gold-300); background: rgba(12, 9, 8, .45); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--gold-200); background: rgba(196, 155, 82, .13); border-color: var(--gold-400); }
.btn-crimson { color: #fff1e6; background: linear-gradient(180deg, #b93044, #7f1a2a); border-color: var(--crimson-400); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 10px 26px rgba(0, 0, 0, .4); }
.btn-crimson:hover { color: #fff; filter: brightness(1.12); transform: translateY(-1px); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 12px; letter-spacing: .11em; }
.btn-lg { min-height: 56px; padding: 0 30px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; filter: grayscale(.4); transform: none; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; color: var(--gold-300); font: 600 13px/1.2 var(--font-body); letter-spacing: .1em; text-transform: uppercase; }
.link-arrow .icon { transition: transform .16s ease; }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- Surfaces ---------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.card-pad { padding: clamp(20px, 2.6vw, 32px); }
/* Gilded corner brackets for hero-level panels. */
.card-framed::before, .card-framed::after { content: ''; position: absolute; width: 22px; height: 22px; border: 1px solid var(--gold-500); pointer-events: none; }
.card-framed::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius); }
.card-framed::after { right: -1px; bottom: -1px; border-top: 0; border-left: 0; border-bottom-right-radius: var(--radius); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.card-head h3 { color: var(--text); font: 600 19px/1.25 var(--font-display); letter-spacing: .05em; }
.card-head .icon { color: var(--gold-500); }

.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; color: var(--gold-300); background: rgba(12, 9, 8, .55); border: 1px solid var(--line-strong); border-radius: 999px; font: 600 12px/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.pill-ok { color: var(--ok); border-color: rgba(132, 211, 162, .38); }
.status-dot { display: inline-block; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(132, 211, 162, .6); animation: status-pulse 2s ease-out infinite; }
@keyframes status-pulse { to { box-shadow: 0 0 0 9px rgba(132, 211, 162, 0); } }

/* Label / value ledger. */
.ledger { display: grid; }
.ledger > div { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.ledger > div:last-child { border-bottom: 0; }
.ledger dt { color: var(--text-mute); font-size: 14px; }
.ledger dd { color: var(--text); font-weight: 600; text-align: right; }

/* Tick list. */
.ticks { display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 22px; color: var(--text-soft); }
.ticks li::before { content: ''; position: absolute; left: 3px; top: .62em; width: 7px; height: 7px; transform: rotate(45deg); background: var(--gold-500); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; }
.field > label, .label { color: var(--text-mute); font: 600 12px/1.2 var(--font-body); letter-spacing: .12em; text-transform: uppercase; }
.input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    color: var(--text);
    background: rgba(7, 5, 4, .62);
    border: 1px solid rgba(220, 187, 120, .26);
    border-radius: var(--radius-sm);
    font: 400 15px/1.4 var(--font-body);
    transition: border-color .16s ease, box-shadow .16s ease;
}
.input::placeholder { color: var(--text-faint); }
.input:hover { border-color: rgba(220, 187, 120, .42); }
.input:focus { outline: 0; border-color: var(--gold-400); box-shadow: 0 0 0 3px rgba(220, 187, 120, .16); }
.input:disabled { color: var(--text-faint); cursor: wait; }
textarea.input { min-height: 150px; resize: vertical; }
.form-stack { display: grid; gap: 14px; }
.form-note { color: var(--text-mute); font-size: 13px; line-height: 1.5; }
.notice { padding: 12px 15px; color: var(--text-soft); background: rgba(7, 5, 4, .55); border: 1px solid var(--line-strong); border-left: 3px solid var(--gold-500); border-radius: var(--radius-sm); font-size: 14px; }
.notice-ok { color: #c9f1d6; border-color: rgba(132, 211, 162, .32); border-left-color: var(--ok); }
.notice-bad { color: #ffd7d9; border-color: rgba(207, 74, 87, .4); border-left-color: var(--crimson-400); }

/* CAPTCHA block shared by both registration forms. */
.captcha { display: grid; gap: 10px; padding: 14px; background: rgba(7, 5, 4, .5); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.captcha-challenge { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.captcha-challenge > div { display: grid; gap: 6px; min-width: 0; }
.captcha-challenge strong { color: var(--text); font: 600 14px/1.3 var(--font-body); }
.captcha-challenge img { border-radius: 3px; }
.captcha-refresh { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; color: var(--gold-300); background: rgba(12, 9, 8, .6); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); transition: background-color .16s ease, border-color .16s ease; }
.captcha-refresh:hover { background: rgba(196, 155, 82, .14); border-color: var(--gold-400); }

/* ---------- Toast ---------- */
.site-toast { position: fixed; z-index: 400; right: 24px; bottom: 24px; max-width: min(440px, calc(100% - 32px)); padding: 14px 18px; color: var(--text); background: var(--ink-750); border: 1px solid var(--line-strong); border-left: 3px solid var(--gold-500); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 15px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.site-toast.is-visible { opacity: 1; transform: translateY(0); }
.site-toast.toast-success { border-left-color: var(--ok); }
.site-toast.toast-error { border-left-color: var(--crimson-400); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 200; background: rgba(12, 9, 8, .9); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease; }
.site-header.is-overlay { position: fixed; right: 0; left: 0; background: linear-gradient(180deg, rgba(7, 5, 4, .82), rgba(7, 5, 4, 0)); border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.site-header.is-overlay.is-scrolled, .site-header.is-overlay.is-open { background: rgba(12, 9, 8, .93); border-bottom-color: var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 12px 34px rgba(0, 0, 0, .4); }
.site-header-inner { display: flex; align-items: center; gap: 28px; min-height: var(--header-h); }
.brand { display: block; flex: 0 0 auto; line-height: 0; }
.brand img { width: auto; height: 62px; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .6)); }
.site-nav { display: flex; align-items: center; gap: clamp(16px, 2.3vw, 34px); margin-inline: auto; }
.site-nav a { position: relative; padding: 10px 0; color: var(--text-soft); font: 600 13px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; transition: color .16s ease; }
.site-nav a::after { content: ''; position: absolute; right: 0; bottom: 0; left: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-400), transparent); opacity: 0; transform: scaleX(.4); transition: opacity .18s ease, transform .18s ease; }
.site-nav a:hover, .site-nav a.is-active { color: var(--gold-200); }
.site-nav a:hover::after, .site-nav a.is-active::after { opacity: 1; transform: scaleX(1); }
.site-header-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.site-header-actions .btn span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.nav-toggle { display: none; place-items: center; width: 42px; height: 42px; color: var(--gold-300); background: rgba(12, 9, 8, .5); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.nav-toggle .icon-close, .site-header.is-open .nav-toggle .icon-menu { display: none; }
.site-header.is-open .nav-toggle .icon-close { display: block; }

/* ---------- Inner-page hero ---------- */
.page-hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(56px, 8vw, 104px) 0 clamp(44px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.page-hero::before { content: ''; position: absolute; inset: 0; z-index: -2; background: url('img/hero-rohan.jpg') center 38% / cover no-repeat; opacity: .5; }
.page-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(12, 9, 8, .97) 0%, rgba(12, 9, 8, .82) 46%, rgba(12, 9, 8, .55) 100%), linear-gradient(0deg, var(--ink-900) 0%, transparent 46%); }
.page-hero-copy { display: grid; gap: 18px; max-width: 760px; }
.page-hero h1 { color: var(--text); font: 700 clamp(34px, 5.4vw, 66px)/1.06 var(--font-display); letter-spacing: .02em; text-wrap: balance; }
.page-hero h1 em { font-style: normal; color: var(--gold-300); background: linear-gradient(180deg, #f8ebc8 0%, #dcbb78 52%, #a67f3d 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.page-hero .lead { max-width: 620px; }
.page-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(40px, 6vw, 80px); background: linear-gradient(180deg, rgba(7, 5, 4, .4), var(--ink-950)); border-top: 1px solid var(--line-strong); }
.footer-top { display: grid; grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(130px, 1fr)); gap: 36px; padding: clamp(40px, 5vw, 64px) 0 36px; }
.footer-brand img { width: auto; height: 96px; margin-left: -10px; }
.footer-brand p { max-width: 330px; margin-top: 10px; color: var(--text-mute); font-size: 14px; }
.footer-col { display: grid; align-content: start; gap: 11px; }
.footer-col h2 { margin-bottom: 6px; color: var(--gold-400); font: 600 13px/1.2 var(--font-display); letter-spacing: .18em; text-transform: uppercase; }
.footer-col a { justify-self: start; color: var(--text-soft); font-size: 15px; }
.footer-col a:hover { color: var(--gold-200); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding: 20px 0 26px; color: var(--text-mute); border-top: 1px solid var(--line-soft); font-size: 13px; }
.footer-realm { display: inline-flex; align-items: center; gap: 9px; }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
    .site-nav-download { display: none; }
}
@media (max-width: 920px) {
    :root { --header-h: 68px; }
    .brand img { height: 54px; }
    .nav-toggle { display: grid; }
    .site-header-inner { justify-content: space-between; gap: 14px; }
    .site-nav { position: absolute; top: 100%; right: 0; left: 0; display: none; gap: 0; margin: 0; padding: 6px var(--gutter) 18px; background: rgba(12, 9, 8, .98); border-bottom: 1px solid var(--line-strong); box-shadow: 0 24px 40px rgba(0, 0, 0, .5); }
    .site-header.is-open .site-nav { display: grid; }
    .site-nav a { padding: 16px 2px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
    .site-nav a::after { display: none; }
    .site-nav-download { display: block; }
    .footer-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    :root { --gutter: 18px; }
    body { font-size: 15.5px; }
    .header-signin { display: none; }
    .brand img { height: 48px; }
    .section-head.is-split { grid-template-columns: 1fr; align-items: start; }
    .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
    .footer-brand img { height: 80px; }
    .site-toast { right: 16px; bottom: 16px; left: 16px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
