/* Shirou Day Online - shared site styles (Unlimited Blade Works dusk) */
:root {
  --night: #0b0708;
  --dusk: #1a0f16;
  --plum: #2b1724;
  --rust: #8c2a1c;
  --blood: #b8321f;
  --ember: #e8a64a;
  --gold: #f3c983;
  --steel: #eee5d6;
  --ash: #a3968a;
  --line: rgba(238, 229, 214, 0.13);
  --line-hot: rgba(232, 166, 74, 0.45);
  --bronze: #c98a5a;
  --silver: #c9d1db;
  --goldr: #f1c55b;
  --diamond: #8fe3f0;
  --serif: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", "Segoe UI", system-ui, sans-serif;
  --display: "Rajdhani", "Zen Kaku Gothic New", "Segoe UI", sans-serif;
  --wrap: min(1180px, 100% - 2rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--steel);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  background:
    radial-gradient(ellipse 120% 60% at 50% 0%, rgba(140, 42, 28, 0.25), transparent 60%),
    linear-gradient(180deg, var(--dusk) 0%, var(--night) 900px);
  background-color: var(--night);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--ember); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Ember particles (canvas behind everything) ---------- */
#embers {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.page { position: relative; z-index: 1; }

/* ---------- Top nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(11, 7, 8, 0.88), rgba(11, 7, 8, 0.6));
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 58px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--steel);
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.05rem;
  white-space: nowrap;
}
.brand img { width: 40px; height: 40px; object-fit: contain; }
.nav-links {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  list-style: none;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
}
.nav-links a {
  display: block;
  padding: 0.4rem 0.8rem;
  color: var(--ash);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.95rem;
  position: relative;
}
.nav-links a:hover { color: var(--steel); }
.nav-links a[aria-current="page"] { color: var(--steel); }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ember), transparent);
}
@media (max-width: 640px) {
  .brand span { display: none; }
  .nav-links a { padding: 0.4rem 0.55rem; font-size: 0.85rem; letter-spacing: 0.08em; }
}

/* ---------- Buttons ---------- */
.btn {
  --cut: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: #1a0b06;
  background: linear-gradient(180deg, var(--gold), var(--ember));
  border: 0;
  padding: 0.75rem 1.6rem;
  cursor: pointer;
  clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%);
  transition: filter 0.15s, transform 0.15s;
}
.btn:hover { color: #1a0b06; filter: brightness(1.1); transform: translateY(-1px); }
.btn.ghost {
  color: var(--steel);
  background: rgba(238, 229, 214, 0.06);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn.ghost:hover { color: var(--steel); background: rgba(238, 229, 214, 0.12); }
.btn.small { font-size: 0.85rem; padding: 0.5rem 1.1rem; --cut: 9px; }

/* ---------- Section titles ---------- */
.wrap { width: var(--wrap); margin: 0 auto; }
.section { padding: clamp(3.5rem, 8vw, 6rem) 0 0; }
.kicker {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ember);
  font-size: 0.95rem;
  letter-spacing: 0.35em;
  margin-bottom: 0.4rem;
}
.title {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
  margin: 0;
}
.lead { color: var(--ash); max-width: 60ch; margin: 1rem 0 0; }
.section-head { margin-bottom: 2rem; }
.section-head.center { text-align: center; }
.section-head.center .lead { margin-left: auto; margin-right: auto; }

/* The blade divider: long sword drawn in SVG */
.blade {
  display: block;
  width: min(520px, 80%);
  height: 22px;
  margin: 1.1rem 0 0;
  color: var(--ember);
}
.section-head.center .blade { margin-left: auto; margin-right: auto; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(2rem, 5vw, 3rem);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-img, url("img/cover.webp")) center 70% / cover no-repeat;
  opacity: 0.35;
  mask-image: linear-gradient(180deg, #000 30%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent);
}
.page-hero .wrap { position: relative; }
.page-hero .title { font-size: clamp(2.6rem, 8vw, 5rem); }
.chant {
  font-family: var(--serif);
  font-style: normal;
  color: var(--gold);
  opacity: 0.85;
  letter-spacing: 0.04em;
  margin: 1.2rem 0 0;
}

/* ---------- Footer ---------- */
footer {
  margin-top: clamp(4rem, 10vw, 7rem);
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
  color: var(--ash);
  font-size: 0.9rem;
}
.footer-inner {
  width: var(--wrap);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
  align-items: flex-start;
}
footer p { margin: 0.25rem 0; }
.footer-chant {
  font-family: var(--serif);
  color: var(--gold);
  opacity: 0.7;
  font-size: 1rem;
}

/* ---------- Keys ---------- */
kbd {
  display: inline-block;
  min-width: 1.9em;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9em;
  line-height: 1.6;
  padding: 0 0.45em;
  color: var(--steel);
  border: 1px solid rgba(238, 229, 214, 0.25);
  border-bottom-width: 3px;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(238, 229, 214, 0.1), rgba(238, 229, 214, 0.03));
}
kbd.pad {
  border-radius: 999px;
  min-width: 1.75em;
  border-bottom-width: 1px;
}
kbd.pad.a { color: #8fdc6e; border-color: #8fdc6e66; }
kbd.pad.b { color: #f0705a; border-color: #f0705a66; }
kbd.pad.x { color: #6fb2f2; border-color: #6fb2f266; }
kbd.pad.y { color: #f2d06f; border-color: #f2d06f66; }
code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.92em;
}

/* ---------- Card frame shared look ---------- */
/*
 * Cut-corner card. The 1px border is transparent so backgrounds (fill, images) stay strictly inside it;
 * the visible frame is the ::after ring drawn on top, diagonals included, with a thicker gold band
 * on the top-right cut. Card variants recolor it with --rim.
 */
.card {
  /* opaque on purpose (= the line colors over --night): the ring hides any image under the cut corners */
  --rim: #302a28;
  --rim-hot: #6e4f26;
  position: relative;
  isolation: isolate;
  background: linear-gradient(180deg, rgba(43, 23, 36, 0.55), rgba(20, 11, 14, 0.75)) padding-box;
  border: 1px solid transparent;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
.card::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(225deg, var(--rim-hot) 0 20px, var(--rim) 21px);
  /* outer outline, then the inner one: evenodd keeps only the ring between them */
  clip-path: polygon(evenodd,
    0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px), 0 0,
    1px 1px, calc(100% - 25px) 1px, calc(100% - 1px) 25px, calc(100% - 1px) calc(100% - 1px),
    18.4px calc(100% - 1px), 1px calc(100% - 18.4px), 1px 1px);
  transition: background 0.2s;
}

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