/* Chill Forever: guild site styles. See docs/design.md */

/* Fonts (self-hosted, SIL OFL 1.1; licences next to the files) */
@font-face {
  font-family: "Grenze";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/grenze-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: "Grenze";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/grenze-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;
}
@font-face {
  font-family: "Alegreya Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/alegreya-sans-400-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: "Alegreya Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/alegreya-sans-400-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;
}
@font-face {
  font-family: "Alegreya Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/alegreya-sans-700-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: "Alegreya Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/alegreya-sans-700-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;
}

/* Tokens */
:root {
  --night: #120a1a;    /* page ground, matches the logo's black edge */
  --dusk: #3a1a5c;     /* section band */
  --fel: #9b5cff;      /* focus ring, channel tint */
  --fel-text: #c3a2ff; /* violet text on night/dusk */
  --blood: #c8102e;    /* primary action */
  --blood-deep: #9e0c24;
  --bone: #ece6de;     /* body text */
  --ash: #a79db3;      /* secondary text */

  --font-display: "Grenze", "Palatino Linotype", Georgia, serif;
  --font-body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;

  --measure: 40rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --space-section: clamp(4rem, 10vw, 7rem);

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

h1,
h2 {
  margin: 0;
}

h2,
.h2-like {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-block-end: 1.5rem;
}

p {
  margin: 0 0 1rem;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--fel-text);
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 3px solid var(--fel);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Hero: the logo is the one loud thing on the page */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1.5rem;
  min-height: min(100svh, 64rem);
  padding: clamp(1.5rem, 5vw, 3rem) var(--gutter) clamp(3rem, 8vw, 5rem);
  text-align: center;
}

/* Purple fire from the logo, carried a little way into the page */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 60% 50% at 50% 38%, rgb(155 92 255 / 0.2), transparent 70%);
  pointer-events: none;
}

.hero__title {
  width: min(90vw, 34rem);
}

.hero__logo {
  width: 100%;
  /* Feather the square artwork's black edge into the page */
  -webkit-mask-image: radial-gradient(circle closest-side, #000 82%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 82%, transparent 100%);
}

.hero__intro {
  max-width: 34rem;
}

.hero__lead {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.75rem);
  line-height: 1.25;
  margin-block-end: 0.75rem;
  text-wrap: balance;
}

.nowrap {
  white-space: nowrap;
}

.hero__intro p:not(.hero__lead) {
  color: var(--ash);
  margin-block-end: 2rem;
}

@media (prefers-reduced-motion: no-preference) {
  /* Short on purpose: on slow phones a long reveal plays out before the image arrives */
  .hero__logo {
    animation: rise-from-dark 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  /* The Discord button must never wait on the logo */
  .hero__intro {
    animation: fade-in 0.4s ease-out 0.1s both;
  }
}

@keyframes rise-from-dark {
  from {
    opacity: 0;
    transform: translateY(2rem) scale(0.96);
    filter: brightness(0.25) saturate(0.5);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* Buttons */
.button {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border: 2px solid var(--blood);
  border-radius: 3px;
  background: var(--blood);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  background: var(--blood-deep);
  border-color: var(--blood-deep);
}

.button--quiet {
  background: transparent;
  border-color: var(--bone);
  color: var(--bone);
}

.button--quiet:hover {
  background: rgb(236 230 222 / 0.1);
  border-color: var(--bone);
}

/* Sections: one left-aligned column; bands run full width */
.section {
  padding-block: var(--space-section);
  padding-inline: max(var(--gutter), (100% - var(--measure)) / 2);
}

/* Two plain sections in a row share one gap, not two */
.section:not(.section--band) + .section:not(.section--band) {
  padding-block-start: 0;
}

.section > :last-child {
  margin-block-end: 0;
}

.section__lead {
  font-size: 1.15em;
  margin-block-end: 2rem;
}

.section--band {
  background: var(--dusk);
}

.section--band p {
  margin-block-end: 2rem;
}

/* Roster groups */
.roster {
  margin: 2.5rem 0 0;
}

.roster > div {
  padding-block: 1rem;
  border-top: 1px solid rgb(236 230 222 / 0.15);
}

.roster dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.2;
}

.roster dd {
  margin: 0.25rem 0 0;
  color: var(--ash);
}

@media (min-width: 40rem) {
  .roster > div {
    display: grid;
    grid-template-columns: 11rem 1fr;
    gap: 1.5rem;
    align-items: baseline;
  }

  .roster dd {
    margin: 0;
  }
}

/* Code of conduct: diamond markers echo the crest */
.rules {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rules li {
  position: relative;
  padding-inline-start: 1.75rem;
  margin-block-end: 1rem;
  /* Leave room above a linked rule so the rules before it stay in view */
  scroll-margin-block-start: 30vh;
}

/* A shared link to one rule (/#pravidlo-4) highlights that rule */
.rules li:target {
  margin-inline: -0.75rem;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  border-radius: 3px;
  background: rgb(155 92 255 / 0.22);
  outline: 2px solid var(--fel);
}

.rules li:target::before {
  left: 0.95rem;
  top: calc(0.5rem + 0.6em);
}

.rules li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.6em;
  width: 0.5em;
  height: 0.5em;
  background: var(--blood);
  transform: rotate(45deg);
}

/* High-contrast mode drops background colours: keep the markers visible */
@media (forced-colors: active) {
  .rules li::before {
    forced-color-adjust: none;
    background: CanvasText;
  }

  .rules li:target {
    outline-color: Highlight;
  }
}

/* Discord channel, styled the way Discord shows a mention */
.channel {
  padding: 0 0.3em;
  border-radius: 3px;
  background: rgb(155 92 255 / 0.3);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

/* Footer */
.footer {
  padding: 3rem var(--gutter) 4rem;
  padding-inline: max(var(--gutter), (100% - var(--measure)) / 2);
  border-top: 1px solid rgb(236 230 222 / 0.15);
  color: var(--ash);
  font-size: 0.875rem;
}

.footer__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--bone);
  margin-block-end: 0.5rem;
}

.footer p:last-child {
  margin: 0;
  max-width: 34rem;
}

/* Simple pages (404) */
.page-simple {
  display: grid;
  align-content: center;
  min-height: 100svh;
  padding-inline: max(var(--gutter), (100% - var(--measure)) / 2);
}
