/* Dulwich Castle — site styles
   Palette sampled from the castle illustration. */

/* Self-hosted fonts (Latin subset, SIL Open Font License) */
@font-face {
  font-family: "Grenze Gotisch";
  src: url("../fonts/grenze-gotisch-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("../fonts/alegreya-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("../fonts/alegreya-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("../fonts/alegreya-sans-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --ink: #0f0c12;        /* page background */
  --ink-raised: #18131c; /* panels */
  --line: #2d2532;       /* rules and borders */
  --stone: #8e8a94;      /* secondary text */
  --bone: #ede6da;       /* primary text */
  --pink: #e74d89;       /* tentacle pink */
  --pink-deep: #7e1f49;  /* shadow under the wordmark */
  --gold: #ffd82f;       /* wing / eye gold */

  --font-display: "Grenze Gotisch", "Iowan Old Style", Georgia, serif;
  --font-body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --font-label: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;

  --gutter: clamp(16px, 5vw, 64px);
  --measure: 1120px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.label {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pink);
  margin-bottom: 0.9rem;
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.2vw, 2.9rem);
  line-height: 1.05;
  margin-bottom: 1rem;
}

/* ── Top bar ─────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 20px var(--gutter);
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
}
.topbar__nav { display: flex; gap: 1.5rem; }
.topbar__nav a { text-decoration: none; transition: color 0.15s; }
.topbar__nav a:hover { color: var(--gold); }

/* ── Hero: wordmark behind the castle ───── */
.hero {
  --word: clamp(4.4rem, 17vw, 12.5rem);
  display: grid;
  justify-items: center;
  padding: clamp(8px, 3vw, 32px) var(--gutter) clamp(64px, 9vw, 120px);
  text-align: center;
  isolation: isolate;
  position: relative;
}

/* faint pink bloom behind the art */
.hero::before {
  content: "";
  position: absolute;
  inset: 10% 15% 20%;
  background: radial-gradient(closest-side, rgba(231, 77, 137, 0.16), transparent);
  z-index: -2;
}

.hero__name {
  display: contents;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--word);
  line-height: 0.8;
}

.hero__word {
  display: block;
  color: var(--bone);
  text-shadow: 0.035em 0.045em 0 var(--pink-deep);
  z-index: -1;
  white-space: nowrap;
}
.hero__word--top { grid-row: 1; }
.hero__word--bottom { grid-row: 3; }

.hero__art {
  grid-row: 2;
  width: min(540px, 80vw, 58svh);
  /* wings reach up into "Dulwich"; the castle's rocks sit over "Castle" */
  margin-top: calc(var(--word) * -0.2);
  margin-bottom: calc(var(--word) * -0.36);
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.6));
  animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero__tagline {
  grid-row: 4;
  margin-top: 1.6rem;
  font-family: var(--font-label);
  font-weight: 500;
  font-size: clamp(0.78rem, 1.6vw, 0.95rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

/* ── The forge: upcoming game + signup ──── */
.forge {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  max-width: var(--measure);
  margin: 0 auto clamp(64px, 9vw, 120px);
  margin-inline: max(var(--gutter), calc((100% - var(--measure)) / 2));
  background: var(--ink-raised);
  border: 1px solid var(--line);
}

.forge__art {
  display: grid;
  place-items: center;
  min-height: 300px;
  border-right: 1px solid var(--line);
  /* engraved cross-hatching, echoing the illustration's linework */
  background:
    repeating-linear-gradient(45deg, transparent 0 7px, rgba(142, 138, 148, 0.09) 7px 8px),
    repeating-linear-gradient(-45deg, transparent 0 7px, rgba(142, 138, 148, 0.06) 7px 8px),
    #120e15;
}

.forge__seal {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone);
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  background: var(--ink);
  transform: rotate(-4deg);
}

.forge__body {
  padding: clamp(28px, 4vw, 52px);
}
.forge__body > p:not(.label) {
  color: #c9c2b8;
  max-width: 44ch;
}

/* ── Signup ─────────────────────────────── */
.signup { margin-top: 1.75rem; }

.signup__label {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.45rem;
}

.signup__row {
  display: flex;
  gap: 0;
  max-width: 460px;
}

.signup input[type="email"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  color: var(--bone);
  background: var(--ink);
  border: 1px solid #4a4250;
  border-right: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 0;
}
.signup input[type="email"]::placeholder { color: #6f6a75; }
.signup input[type="email"]:focus-visible { outline-offset: 0; }
.signup input[aria-invalid="true"] { border-color: var(--pink); }

.signup button {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--gold);
  border: 1px solid var(--gold);
  padding: 0 1.25rem;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
}
.signup button:hover { background: #ffe466; }
.signup button:disabled { opacity: 0.6; cursor: progress; }

.signup__note {
  margin-top: 0.7rem;
  font-size: 0.9rem;
  color: var(--stone);
}

.signup__status:empty { display: none; }
.signup__status {
  margin-top: 0.9rem;
  font-weight: 500;
}
.signup__status[data-state="ok"] { color: var(--gold); }
.signup__status[data-state="error"] { color: var(--pink); }

.signup__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Contact ────────────────────────────── */
.contact {
  max-width: var(--measure);
  margin-inline: max(var(--gutter), calc((100% - var(--measure)) / 2));
  padding-bottom: clamp(64px, 9vw, 120px);
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(24px, 4vw, 48px);
  border-top: 1px solid var(--line);
}
.contact-list li { border-bottom: 1px solid var(--line); }

.contact-link {
  display: grid;
  gap: 0.1rem;
  padding: 1rem 0;
  text-decoration: none;
}
.contact-link__name {
  font-weight: 700;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
  transition: color 0.15s;
}
.contact-link__name::after {
  content: " →";
  color: var(--pink);
}
.contact-link__hint { color: var(--stone); font-size: 0.95rem; }
.contact-link:hover .contact-link__name { color: var(--gold); }

/* ── Footer ─────────────────────────────── */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 24px var(--gutter);
  border-top: 1px solid var(--line);
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6f6a75;
}

/* ── Small screens ──────────────────────── */
@media (max-width: 760px) {
  .topbar__where { display: none; }
  .topbar { justify-content: flex-end; }
  .forge,
  .contact-list { grid-template-columns: 1fr; }
  .forge__art {
    min-height: 160px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 420px) {
  .signup__row { flex-direction: column; gap: 8px; }
  .signup input[type="email"] { border-right: 1px solid #4a4250; }
  .signup button { padding: 0.8rem; }
}

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