@font-face {
  font-family: "Barlow Condensed";
  src: url("/assets/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/assets/dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #10100f;
  --panel: #171614;
  --text: #f6f0e7;
  --muted: #c2b8aa;
  --accent: #f1ab5d;
  --line: #382f27;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
  --emblem: url("/assets/death-watch-emblem.png") center / contain no-repeat;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--text); font: 400 1rem/1.6 var(--body); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #ffc37c; outline-offset: 5px; }

.shell { width: min(100% - 5rem, 75rem); margin-inline: auto; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  z-index: 10;
  inset: 0 auto auto 1rem;
  padding: .6rem 1rem;
  background: var(--accent);
  color: var(--background);
  transform: translateY(-120%);
}
.skip-link:focus { transform: translateY(.5rem); }

.site-header {
  position: relative;
  z-index: 2;
  background: #11110f;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.75rem;
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  justify-self: start;
  text-decoration: none;
  white-space: nowrap;
}

.identity-mark {
  background-color: var(--accent);
  mask: var(--emblem);
  width: 2.5rem;
  height: 2.5rem;
}

.identity-type { display: flex; flex-direction: column; line-height: 1; }
.identity-type strong { font: 700 1.45rem/.95 var(--display); letter-spacing: .075em; text-transform: uppercase; }
.identity-type small { color: var(--muted); font-size: .75rem; margin-top: .35rem; letter-spacing: .18em; text-transform: uppercase; }

.site-nav { display: flex; align-items: center; gap: clamp(1.15rem, 3vw, 2.7rem); }
.site-nav a {
  color: var(--muted);
  padding-block: .4rem;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}
.site-nav a:hover { color: var(--text); }
.menu-toggle { display: none; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 3.15rem;
  padding: .75rem 1.25rem;
  border: 1px solid transparent;
  border-radius: .15rem;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s;
}

.button-primary { background: var(--accent); color: #201304; }
.button-primary:hover { background: #ffc47f; }
.button-secondary { color: var(--text); border-color: #675344; background: #171410a6; }
.button-secondary:hover { color: var(--accent); border-color: var(--accent); background: #231a12; }
.button-header { justify-self: end; min-height: 2.6rem; max-width: 100%; padding: .55rem .85rem; border-color: #725136; color: var(--accent); background: transparent; overflow-wrap: anywhere; }
.button-header:hover { border-color: var(--accent); background: #241a12; }
.button:disabled { cursor: wait; opacity: .65; }

.profile-icon { position: relative; width: 1rem; height: 1rem; flex-shrink: 0; }
.profile-icon::before, .profile-icon::after { position: absolute; content: ""; border: 1px solid currentColor; }
.profile-icon::before { width: .42rem; height: .42rem; border-radius: 50%; top: 0; left: .29rem; }
.profile-icon::after { width: .83rem; height: .42rem; border-radius: .55rem .55rem .1rem .1rem; bottom: 0; left: .085rem; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }

.hero {
  position: relative;
  isolation: isolate;
  background: #0e0d0b;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, #09080775, transparent 76%),
    linear-gradient(0deg, #100e0bd4, transparent 35%),
    url("/assets/frontiera.png") 68% center / cover no-repeat;
}

.hero-inner { min-height: clamp(31rem, 49vw, 41rem); display: grid; align-items: center; padding-block: 4rem; }
.hero-copy { max-width: 53rem; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--accent);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.45;
  text-transform: uppercase;
}
.eyebrow > span { flex: 0 0 1.2rem; height: 1px; background: var(--accent); }
.hero h1 { font-size: clamp(5.25rem, 10vw, 9.5rem); line-height: .86; letter-spacing: -.018em; margin-block: 1rem 1.15rem; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-motto { font: 700 clamp(1.65rem, 3.5vw, 2.25rem)/1.1 var(--display); text-transform: uppercase; letter-spacing: .055em; }
.hero-description { max-width: 31rem; color: var(--muted); margin-top: 1rem; font-size: 1.125rem; }
.hero .actions { margin-top: 2rem; }

.hero-identifier { border-top: 1px solid #8c67434f; background: #12100dda; }
.identifier-inner {
  min-height: 3.5rem;
  padding-block: .65rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .35rem 1.25rem;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
}
.identifier-inner strong { margin-inline-start: .65rem; color: var(--accent); letter-spacing: .1em; }
.identifier-inner i { margin-inline: .6rem; display: inline-block; width: .24rem; height: .24rem; background: var(--accent); vertical-align: middle; transform: rotate(45deg); }

.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section-copy { max-width: 42rem; }
.section h2, .rsi-dialog h2 {
  font-size: clamp(2.8rem, 5.8vw, 5.25rem);
  line-height: .97;
  margin-block: .7rem 1.1rem;
}
.section h2 span, .rsi-dialog h2 span { color: var(--accent); }
.section-copy p:not(.eyebrow) { color: var(--muted); font-size: 1.0625rem; max-width: 38rem; }
.section-copy p + p:not(.eyebrow) { margin-top: .9rem; }
.text-link { color: var(--accent); text-underline-offset: .3em; font-weight: 700; }
.text-link:hover { color: #ffd2a3; }
.section-copy .text-link { display: inline-block; margin-top: 1.5rem; }

.organization-inner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); align-items: center; gap: 4rem; }
.insignia {
  display: grid;
  place-items: center;
  min-height: 17rem;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse, #68422745, transparent 65%),
    repeating-linear-gradient(0deg, transparent 0 19px, #be8d5418 20px),
    repeating-linear-gradient(90deg, transparent 0 19px, #be8d5418 20px),
    #151311;
}

.insignia-frame {
  display: grid;
  place-items: center;
  width: 10.5rem;
  aspect-ratio: 1;
  border: 1px solid #855d3d;
  outline: 1px solid #5c412e;
  outline-offset: .6rem;
  border-radius: 50%;
}

.insignia-mark { display: block; width: 7.5rem; height: 7.5rem; mask: var(--emblem); background: linear-gradient(#ffd08f, #a86734); }

.houses { background: #151412; border-block: 1px solid var(--line); }
.house-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 0; margin: 2rem 0 0; list-style: none; }
.house-card {
  min-height: 9.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1.65rem;
  border: 1px solid var(--line);
  border-bottom: 2px solid #795233;
  background: linear-gradient(135deg, #231a13, #181614 60%);
}
.house-card h3 { font-size: clamp(1.55rem, 3.2vw, 2.5rem); line-height: 1; }
.house-symbol { display: block; flex: 0 0 1.7rem; height: 1.7rem; background: var(--accent); }
.symbol-vizla { clip-path: polygon(0 0, 50% 49%, 100% 0, 100% 29%, 50% 86%, 0 29%); }
.symbol-kast { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%, 50% 0, 50% 23%, 23% 50%, 50% 77%, 77% 50%, 50% 23%); }
.symbol-medkarn { clip-path: polygon(0 20%, 25% 20%, 50% 49%, 75% 20%, 100% 20%, 100% 45%, 50% 100%, 0 45%); }

.recruitment-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  padding: clamp(1.5rem, 4vw, 4rem);
  background: radial-gradient(ellipse at 100% 100%, #3d2517, transparent 72%), var(--panel);
  border: 1px solid #725034;
}
.recruitment-panel .actions { flex: 0 0 auto; padding-bottom: .25rem; }

.site-footer { border-top: 1px solid var(--line); background: #0d0d0c; }
.footer-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5rem 3rem; padding-block: 2rem; }
.footer-inner > p { color: var(--muted); font-size: .8125rem; max-width: 35rem; }
.footer-inner > .text-link { white-space: nowrap; font-size: .875rem; }

.rsi-dialog {
  width: min(32.5rem, 100% - 2rem);
  max-height: calc(100% - 2rem);
  padding: 0;
  color: var(--text);
  background: var(--panel);
  border: 1px solid #775437;
  box-shadow: 0 1rem 5rem #000b;
}
.rsi-dialog::backdrop { background: #080706cc; backdrop-filter: blur(4px); }
.dialog-content { position: relative; padding: clamp(1.3rem, 4vw, 2.75rem); }
.close-button {
  position: absolute;
  right: .75rem;
  top: .65rem;
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: .15rem;
  color: var(--text);
  background: transparent;
  font-size: 1.65rem;
  line-height: 1;
}
.close-button:hover { background: #37271b; color: var(--accent); }
.rsi-dialog h2 { font-size: clamp(3rem, 7vw, 4.4rem); }
.rsi-dialog p:not(.eyebrow) { color: var(--muted); }
.rsi-dialog label { display: block; margin-block: 1.25rem .35rem; font-weight: 700; }
.rsi-dialog input { width: 100%; min-height: 2.85rem; padding: .65rem .85rem; border: 1px solid #6d5544; background: #0e0d0c; color: var(--text); border-radius: .15rem; }
.rsi-dialog input::placeholder { color: #a59a8d; }
.rsi-dialog p.form-error { color: #ffad9e; margin: .6rem 0; }
.rsi-dialog p.form-status { color: var(--accent); margin-bottom: .85rem; }
.rsi-dialog .form-error:empty { visibility: hidden; }
.rsi-dialog .form-status:empty { margin: 0; }
#rsi-form > .button { margin-top: .55rem; }
.oauth-option { padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); margin-bottom: 1.1rem; }
.oauth-option .button { margin-top: .65rem; }
.rsi-dialog p.oauth-environment { margin-bottom: .35rem; font-size: .875rem; font-weight: 700; color: var(--accent); }
.button-citizenid { background: #212126; color: #f0f0f0; border-color: #62626c; }
.button-citizenid:hover { background: #0e0e0f; border-color: #f0f0f0; }
.button-citizenid img { flex-shrink: 0; object-fit: contain; }
.profile-preview { border-left: 2px solid var(--accent); padding: .5rem 0 .5rem 1rem; margin-top: 1.35rem; overflow-wrap: anywhere; }
.profile-preview .actions { margin-top: .75rem; }
.rsi-dialog p.linked-handle { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.rsi-dialog p.verified-label { color: var(--accent); font-size: .875rem; margin-bottom: .25rem; }

@media (max-width: 60rem) {
  .shell { width: calc(100% - 3rem); }
  .organization-inner { gap: 2rem; }
  .recruitment-panel { flex-direction: column; align-items: start; }
  .recruitment-panel .actions { padding-bottom: 0; }
}

@media (max-width: 48rem) {
  .header-inner { grid-template-columns: minmax(0, 1fr) minmax(0, auto) auto; gap: .7rem; min-height: 4.4rem; }
  .menu-toggle {
    grid-column: 3;
    grid-row: 1;
    display: inline-flex;
    min-height: 2.6rem;
    align-items: center;
    gap: .45rem;
    padding: .4rem .45rem;
    background: transparent;
    color: var(--text);
    border: 0;
    font-size: .875rem;
  }
  .menu-icon { width: 1rem; height: .65rem; border-block: 1px solid currentColor; }
  .button-header { grid-column: 2; grid-row: 1; max-width: 46vw; overflow-wrap: anywhere; }
  .site-nav { display: none; }
  .site-nav.is-open {
    display: grid;
    grid-column: 1 / -1;
    gap: 0;
    padding-block: .4rem .75rem;
    border-top: 1px solid var(--line);
  }
  .site-nav a { padding-block: .65rem; }
  .hero::before {
    background:
      linear-gradient(90deg, #090807c2, #0908070d 95%),
      linear-gradient(0deg, #100e0bee, transparent 60%),
      url("/assets/frontiera.png") 72% center / cover no-repeat;
  }
  .hero-inner { min-height: 33rem; }
  .hero h1 { max-width: 32rem; font-size: clamp(4.65rem, 13vw, 7.25rem); }
  .organization-inner { grid-template-columns: 1fr; }
  .insignia { min-height: 14rem; }
  .house-card { flex-wrap: wrap; min-height: 7.5rem; padding: 1rem; }
  .footer-inner { grid-template-columns: 1fr auto; }
  .footer-inner p { grid-row: 2; grid-column: 1 / -1; }
}

@media (max-width: 31rem) {
  .shell { width: calc(100% - 2rem); }
  .identity { gap: .32rem; }
  .identity-mark { width: 1.8rem; height: 1.8rem; }
  .identity-type strong { font-size: 1.1rem; letter-spacing: .025em; }
  .identity-type small { font-size: .625rem; }
  .button-header { padding-inline: .55rem; font-size: .8125rem; }
  .button-header .profile-icon { display: none; }
  .hero-inner { min-height: 29rem; padding-block: 3rem; }
  .hero h1 { font-size: clamp(4rem, 15.5vw, 4.9rem); }
  .hero-description { font-size: 1rem; }
  .house-grid { grid-template-columns: 1fr; }
  .house-card { min-height: 4.5rem; }
  .rsi-dialog .eyebrow { padding-right: 1.5rem; }
}

@media (max-width: 23rem) {
  .header-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 43%) auto; gap: .5rem; }
  .menu-toggle { gap: 0; min-width: 2.6rem; justify-content: center; font-size: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
