/* The Conservatory of Fancy — core stylesheet */

@font-face {
  font-family: "system-serif";
  src: local("Georgia");
}

:root {
  --paper: #f4ecdc;
  --paper-dim: #ece1cc;
  --ink: #2b241a;
  --ink-soft: #4a4030;
  --brass: #8a6d3b;
  --brass-deep: #6b5228;
  --line: #c9b998;
  --shadow: rgba(43, 36, 26, 0.15);
  --max-width: 46rem;
}

/* Deep green & gold dark theme — follows system preference by default,
   or is set explicitly via [data-theme] from the optional toggle script. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #060f0a;
    --paper-dim: #030907;
    --ink: #e9e4d3;
    --ink-soft: #bcb6a0;
    --brass: #c9a44c;
    --brass-deep: #e0b954;
    --line: #2e4536;
    --shadow: rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  --paper: #101c15;
  --paper-dim: #0a1510;
  --ink: #e9e4d3;
  --ink-soft: #bcb6a0;
  --brass: #c9a44c;
  --brass-deep: #e0b954;
  --line: #2e4536;
  --shadow: rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--brass-deep);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

a:hover,
a:focus {
  color: var(--ink);
  text-decoration-color: var(--brass);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brass-deep);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--paper);
  padding: 0.5rem 1rem;
  z-index: 100;
  border: 1px solid var(--brass);
}

/* ---------- Site header ---------- */

.site-header {
  position: relative;
  border-bottom: 3px double var(--brass);
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
}

.theme-toggle {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  background: var(--paper-dim);
  color: var(--brass-deep);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--brass);
  color: var(--ink);
}

/* Hide the toggle entirely without JS — it has no effect until the script runs. */
.no-js .theme-toggle {
  display: none;
}

.site-header__ornament {
  font-size: 1.1rem;
  color: var(--brass);
  letter-spacing: 0.3em;
  margin: 0 0 0.75rem;
}

.site-title {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.9rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 400;
}

.site-title a {
  color: var(--ink);
  text-decoration: none;
}

.site-subtitle {
  margin: 0.6rem 0 0;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

/* ---------- Navigation ---------- */

.site-nav {
  border-bottom: 1px solid var(--line);
  background: var(--paper-dim);
}

.site-nav__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.5rem;
  margin: 0;
  padding: 0.75rem 1rem;
  max-width: 60rem;
  margin-inline: auto;
}

.site-nav__list a {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.site-nav__list a:hover,
.site-nav__list a:focus,
.site-nav__list a[aria-current="page"] {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

/* ---------- Main content ---------- */

main {
  flex: 1;
  width: 100%;
}

.wrap {
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 2.5rem 1.5rem 4rem;
}

.wrap--wide {
  max-width: 60rem;
}

h1, h2, h3 {
  font-weight: 400;
  line-height: 1.25;
  color: var(--ink);
}

.page-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
}

.page-kicker {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.78rem;
  color: var(--brass-deep);
  margin: 0 0 0.4rem;
}

.lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 38rem;
}

hr.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

hr.rule--ornate {
  border: none;
  text-align: center;
  margin: 2.5rem 0;
  color: var(--brass);
  font-size: 1.2rem;
}
hr.rule--ornate::before {
  content: "\2766";
}

/* ---------- Story listings ---------- */

.tale-list {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}

.tale-list__item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}
.tale-list__item:first-child {
  border-top: 1px solid var(--line);
}

.tale-list__title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.tale-list__title a {
  text-decoration: none;
}
.tale-list__title a:hover {
  text-decoration: underline;
}

.tale-list__meta {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brass-deep);
  margin: 0 0 0.4rem;
}

.tale-list__desc {
  color: var(--ink-soft);
  margin: 0;
}

.draft-flag {
  display: inline-block;
  border: 1px solid var(--brass);
  color: var(--brass-deep);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.5rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* ---------- Section links / room cards (no boxy cards, just rules) ---------- */

.room-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

@media (min-width: 40rem) {
  .room-links {
    grid-template-columns: 1fr 1fr;
  }
}

.room-link {
  border: 1px solid var(--line);
  padding: 1.5rem;
  background: rgba(255,255,255,0.15);
}

.room-link h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.room-link p {
  color: var(--ink-soft);
}

.room-link a.go {
  text-decoration: none;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Story reading page ---------- */

.story-header {
  text-align: center;
  margin-bottom: 2rem;
}

.story-title {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 0 0 0.75rem;
}

.story-meta {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brass-deep);
}

.story-body {
  font-size: 1.15rem;
  line-height: 1.85;
  max-width: 38rem;
  margin-inline: auto;
}

.story-body p {
  margin: 0 0 1.4rem;
}

.story-body p:first-of-type::first-letter {
  font-size: 3.2rem;
  float: left;
  line-height: 0.8;
  padding-right: 0.5rem;
  padding-top: 0.15rem;
  color: var(--brass-deep);
  font-weight: 400;
}

.story-body h2 {
  margin-top: 2.5rem;
  font-size: 1.3rem;
  text-align: center;
}

.story-body blockquote {
  border-left: 3px solid var(--line);
  margin-left: 0;
  padding-left: 1.25rem;
  color: var(--ink-soft);
  font-style: italic;
}

.story-nav {
  max-width: 38rem;
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 3px double var(--brass);
  text-align: center;
  padding: 1.75rem 1rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: var(--paper-dim);
}

.site-footer a {
  color: var(--ink-soft);
}

/* ---------- Utility ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
