/* Omun — homepage
   Page colour #0B0710. Header follows the Spectrum Patronum pattern:
   fixed bar, social slot at the left, icon menu in the centre, language globe at the right.
   Type is self-hosted Cinzel (OFL). No external fonts or requests. */

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/cinzel-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/cinzel-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0B0710;
  --text: #F3EEE6;
  --muted: #D7D0C6;
  --line: rgba(243, 238, 230, 0.16);
  --hover: rgba(243, 238, 230, 0.08);
  --font: "Cinzel", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --header-h: 3.4rem;
  /* Button fill. Cream text on this red is about 10.6:1. */
  --blood: #6E0B14;
  --blood-hover: #8A1220;
  /* Hairlines and focus rings. #6E0B14 on #0B0710 is only 1.6:1, so these
     use a lighter blood red that stays above 3:1 on the page and the panel. */
  --blood-line: #C41E28;
  --accent: var(--blood-line);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.6;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: var(--blood);
  color: var(--text);
}

img,
video {
  max-width: 100%;
}

.skip {
  position: fixed;
  left: 1rem;
  top: 0.6rem;
  z-index: 40;
  padding: 0.55rem 0.85rem;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-150%);
}

.skip:focus {
  transform: none;
}

/* Header — same slots and metrics as Spectrum Patronum */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: var(--header-h);
  padding: 0.2rem max(0.4rem, env(safe-area-inset-right)) 0.2rem max(0.4rem, env(safe-area-inset-left));
  padding-top: max(0.2rem, env(safe-area-inset-top));
  background: var(--bg);
  pointer-events: none;
}

.site-header .social,
.site-header .icon-nav,
.site-header .lang {
  pointer-events: auto;
}

.site-header .social {
  justify-self: start;
}

.site-header .icon-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-header .lang {
  justify-self: end;
}

.social ul,
.icon-nav ul {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social ul {
  gap: 0.15rem;
}

.icon-nav ul {
  gap: 0.05rem;
}

.social a,
.icon-nav > ul > li > a,
.icon-nav > ul > li > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(243, 238, 230, 0.45);
  font: inherit;
  line-height: 0;
  text-decoration: none;
  cursor: pointer;
}

.social a {
  width: 2.75rem;
  height: 2.75rem;
}

.icon-nav > ul > li > a,
.icon-nav > ul > li > button {
  width: 2.35rem;
  height: 2.35rem;
}

.social a:hover,
.social a:focus-visible,
.icon-nav > ul > li > a:hover,
.icon-nav > ul > li > a:focus-visible,
.icon-nav > ul > li > button:hover,
.icon-nav > ul > li > button:focus-visible,
.icon-nav > ul > li > button[aria-expanded="true"] {
  color: var(--text);
}

.lang {
  position: relative;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.lang-btn:hover,
.lang-btn[aria-expanded="true"] {
  background: var(--hover);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 40;
  min-width: 11.5rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: #16121c;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.lang-menu[hidden] {
  display: none;
}

.lang-menu a {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.lang-menu a[aria-selected="true"] {
  box-shadow: inset 2px 0 0 var(--blood-line);
  background: rgba(243, 238, 230, 0.06);
}

.lang-menu a:hover {
  background: var(--hover);
}

/* Homepage lockup */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(var(--header-h) + env(safe-area-inset-top) + 0.75rem)
    max(1.25rem, env(safe-area-inset-right))
    calc(1.5rem + env(safe-area-inset-bottom))
    max(1.25rem, env(safe-area-inset-left));
}

.lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(86vw, 38rem, 74vh);
  margin: 0;
  font-weight: 500;
}

/* The animated mark is a button. Idle layout matches the old span:
   the frame holds the aspect ratio, the button fills it, and the
   spark game (loaded on click) is a sibling layered on top. */
.mark-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 800 / 602;
  background: transparent;
}

.mark {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 0;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.mark::-moz-focus-inner {
  border: 0;
  padding: 0;
}

.mark.is-quiet {
  visibility: hidden;
  pointer-events: none;
}

.logo-still,
.logo-motion {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  background-color: transparent;
}

.logo-motion {
  display: none;
  pointer-events: none;
}

.mark.is-playing .logo-motion {
  display: block;
}

.mark.is-playing .logo-still {
  visibility: hidden;
}

.wordmark-title {
  width: 62%;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: 0;
}

.wordmark {
  display: block;
  width: 100%;
  height: auto;
  margin-top: clamp(0.85rem, 2.2vw, 1.5rem);
}

@media (max-height: 520px) {
  .hero {
    padding-top: calc(var(--header-h) + 0.35rem);
    padding-bottom: 0.75rem;
  }

  .lockup {
    width: min(70vw, 52vh);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .logo-motion,
  .mark.is-playing .logo-motion {
    display: none !important;
  }

  .mark.is-playing .logo-still {
    visibility: visible;
  }

  .mark.is-quiet.is-playing .logo-still,
  .mark.is-quiet .logo-motion {
    visibility: hidden !important;
  }
}

/* Contact panel — same layout as Spectrum Patronum, blood red instead of yellow. */
.contact-backdrop {
  position: fixed;
  z-index: 35;
  top: calc(var(--header-h) + env(safe-area-inset-top));
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
  cursor: default;
}

.contact-backdrop[hidden] {
  display: none;
}

.contact-panel {
  position: fixed;
  z-index: 45;
  top: calc(var(--header-h) + env(safe-area-inset-top) + 0.25rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(28rem, calc(100vw - 1.5rem));
  max-height: calc(100dvh - var(--header-h) - env(safe-area-inset-top) - 1rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.9rem 0.95rem 1rem;
  text-align: left;
  background: #16121c;
  border: 1px solid var(--line);
  border-top: 2px solid var(--blood-line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
}

.contact-panel[hidden] {
  display: none;
}

.contact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.contact-head h2 {
  margin: 0;
  font-family: var(--font);
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.contact-close:hover,
.contact-close:focus-visible {
  background: var(--hover);
  color: var(--text);
}

.contact-form {
  margin: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 0.7rem;
}

.field {
  min-width: 0;
  margin: 0 0 0.7rem;
}

.field label {
  display: inline-block;
  margin-bottom: 0.28rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.opt {
  margin-left: 0.35rem;
  color: rgba(215, 208, 198, 0.62);
  font-size: 0.8rem;
}

.field input,
.field textarea {
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 7, 16, 0.72);
  color: var(--text);
  color-scheme: dark;
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
}

.field textarea {
  min-height: 6.4rem;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline-offset: 1px;
  border-color: rgba(196, 30, 40, 0.9);
}

.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px #120e18 inset;
}

.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

.attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: 1px dashed rgba(243, 238, 230, 0.45);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.attach-btn:hover,
.attach-btn:focus-visible {
  background: var(--hover);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

.file-list {
  margin: 0.45rem 0 0;
  padding: 0;
  list-style: none;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-remove {
  flex: 0 0 auto;
  margin: 0;
  min-height: 2.25rem;
  padding: 0.35rem 0.15rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.file-remove:hover,
.file-remove:focus-visible {
  color: var(--text);
}

.file-total {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.consent {
  margin: 0.85rem 0 0.9rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.consent input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.15rem 0.45rem 0 0;
  vertical-align: top;
  accent-color: var(--blood-line);
}

.consent a,
.form-notice a {
  color: var(--text);
}

.form-notice {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.form-notice p {
  margin: 0 0 0.45rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.contact-send {
  min-height: 2.75rem;
  margin: 0;
  padding: 0.65rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--blood);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.contact-send:hover,
.contact-send:focus-visible {
  background: var(--blood-hover);
  color: var(--text);
}

.contact-send:disabled {
  opacity: 0.65;
  cursor: progress;
}

.form-status {
  margin: 0;
  font-size: 0.92rem;
}

.form-status:not(:empty) {
  margin-top: 0.75rem;
}

.form-status.is-ok {
  color: #b7e7c3;
}

.form-status.is-error {
  color: #f2c1ae;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 0 1.25rem calc(1.4rem + env(safe-area-inset-bottom));
  text-align: center;
}

.site-footer a {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-underline-offset: 0.22em;
}

.site-footer a:hover,
.site-footer a[aria-current="page"] {
  color: var(--text);
}

.legal-page {
  max-width: 42rem;
  margin: 0 auto;
  padding: calc(var(--header-h) + env(safe-area-inset-top) + 1.5rem) 1.4rem 1.5rem;
}

.legal-home {
  margin: 0 0 1.75rem;
  text-align: center;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-home a {
  color: var(--text);
  text-decoration: none;
}

.legal-page h1 {
  margin: 0 0 1.25rem;
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: center;
  line-height: 1.3;
}

.legal-page p {
  color: var(--muted);
}

.legal-page a {
  color: var(--text);
}

@media (max-width: 520px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .contact-send {
    width: 100%;
  }

  .contact-panel {
    width: calc(100vw - 0.9rem);
    padding: 0.8rem 0.75rem 0.9rem;
  }
}

/* Hidden spark game. The script is loaded on the first click;
   these rules only apply once .spark exists. */
html.spark-lock,
html.spark-lock body {
  overflow: hidden;
  overscroll-behavior: none;
}

html.spark-lock .hero {
  touch-action: none;
}

.spark {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #0B0710;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.spark canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: transparent;
}

.spark-bar {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 3;
  display: flex;
  gap: 0.3rem;
}

.spark-icon,
.spark-pad button,
.spark-restart {
  margin: 0;
  border: 2px solid rgba(243, 238, 230, 0.85);
  background: rgba(11, 7, 16, 0.82);
  color: #F3EEE6;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  cursor: pointer;
}

.spark-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 999px;
}

.spark-icon:hover,
.spark-icon:focus-visible,
.spark-pad button:hover,
.spark-pad button:focus-visible,
.spark-restart:hover,
.spark-restart:focus-visible {
  background: #6E0B14;
  color: #F3EEE6;
}

.spark-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.spark-help {
  width: min(34rem, 94%);
  margin: 0.7rem 0 0;
  padding: 0 0.4rem;
  color: #F3EEE6;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  line-height: 1.35;
  text-align: center;
}

.spark-pad {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 0.4rem;
  z-index: 3;
  transform: translateX(-50%);
  grid-template-columns: 2.75rem 2.75rem 2.75rem;
  grid-template-areas:
    ". up ."
    "left down right";
  gap: 0.3rem;
}

.spark-pad button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 10px;
  touch-action: manipulation;
}

.spark-pad button[data-dir="up"] { grid-area: up; }
.spark-pad button[data-dir="down"] { grid-area: down; }
.spark-pad button[data-dir="left"] { grid-area: left; }
.spark-pad button[data-dir="right"] { grid-area: right; }

.spark-over {
  position: absolute;
  left: 50%;
  bottom: 11%;
  z-index: 4;
  transform: translateX(-50%);
}

.spark-over[hidden] {
  display: none;
}

.spark-restart {
  min-height: 2.75rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@media (pointer: coarse), (max-width: 720px) {
  .spark-pad {
    display: grid;
    position: fixed;
    bottom: max(0.45rem, env(safe-area-inset-bottom));
    z-index: 40;
  }
}

@media (max-height: 640px) {
  .spark-help {
    display: none;
  }
}
