:root {
  --dark-forest: #1F4342;
  --deep-teal: #146665;
  --primary-teal: #24867E;
  --muted-teal: #517774;
  --warm-gold: #DCCDA7;
  --cream: #F5ECCB;
  --off-white: #F9F6F0;
  --black: #030303;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--dark-forest);
  color: var(--off-white);
  line-height: 1.7;
}

h1, h2, h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--warm-gold);
  font-weight: 600;
  line-height: 1.2;
}

a { color: var(--warm-gold); }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
header {
  background: var(--deep-teal);
  border-bottom: 4px solid var(--warm-gold);
}
header .wrap {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: .5rem 1.5rem; padding-top: 1rem; padding-bottom: 1rem;
}
.brand { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.6rem; color: var(--off-white); text-decoration: none; font-weight: 600; }
nav a { margin-left: 1.25rem; text-decoration: none; color: var(--cream); font-size: .95rem; }
nav a:hover { color: var(--warm-gold); text-decoration: underline; }

/* Hero */
.hero { text-align: center; padding: 4.5rem 0 4rem; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0 0 .5rem; }
.hero p { max-width: 560px; margin: 0 auto 1.75rem; color: var(--cream); font-size: 1.15rem; }

.btn {
  display: inline-block; padding: .75rem 1.75rem; border-radius: 4px;
  background: var(--warm-gold); color: var(--dark-forest);
  text-decoration: none; font-weight: 700;
}
.btn:hover { background: var(--cream); }

/* Sections */
section { padding: 3rem 0; border-top: 1px solid var(--muted-teal); }
section h2 { font-size: 2.2rem; margin-top: 0; text-align: center; }

.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--deep-teal); border: 1px solid var(--muted-teal); border-radius: 6px; padding: 1.5rem; }
.card h3 { margin-top: 0; }

footer { background: var(--black); color: var(--muted-teal); text-align: center; padding: 1.5rem 1rem; font-size: .9rem; border-top: 4px solid var(--warm-gold); }

/* Inner pages */
.page { padding: 3rem 0; }
.page h1 { font-size: clamp(2rem, 5vw, 3rem); text-align: center; margin-top: 0; }
.page h2 { text-align: left; font-size: 1.7rem; }
.prose { max-width: 720px; margin: 0 auto; }
.prose ul { padding-left: 1.25rem; }
.note { background: var(--deep-teal); border-left: 4px solid var(--warm-gold); padding: 1rem 1.25rem; border-radius: 4px; margin: 1.5rem 0; }
.soon { color: var(--cream); font-style: italic; }
.btn.outline { background: transparent; color: var(--warm-gold); border: 2px solid var(--warm-gold); }
.btn.outline:hover { background: var(--warm-gold); color: var(--dark-forest); }
nav a.current { color: var(--warm-gold); border-bottom: 2px solid var(--warm-gold); }

/* Community forms */
nav a.join { background: var(--warm-gold); color: var(--dark-forest); padding: .3rem .9rem; border-radius: 4px; font-weight: 700; }
nav a.join:hover { background: var(--cream); text-decoration: none; }
.prose.narrow { max-width: 480px; }
.form label { display: block; margin: 0 0 1rem; font-weight: 500; }
.form input:not([type=checkbox]), .form select {
  display: block; width: 100%; margin-top: .3rem; padding: .65rem .75rem;
  border: 1px solid var(--muted-teal); border-radius: 4px; font: inherit;
  background: var(--off-white); color: var(--black);
}
.form label.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.form label.check input { margin-top: .35rem; }
.form-msg { min-height: 1.5rem; margin: 1rem 0 0; }
.form-msg.ok { color: var(--cream); }
.form-msg.err { color: #ffd9a8; }
.small { font-size: .9rem; color: var(--cream); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--muted-teal); }
th { color: var(--warm-gold); }
:focus-visible { outline: 3px solid var(--warm-gold); outline-offset: 2px; }

/* Logo and footer */
.brand { display: flex; align-items: center; gap: .6rem; }
.brand img { width: 52px; height: 52px; display: block; }
footer p { margin: .4rem auto; max-width: 720px; }
footer .disclaimer { color: var(--cream); }
footer a { color: var(--warm-gold); }

/* Posts */
.stack > * + * { margin-top: 1rem; }
.post-card h3 { margin: 0 0 .25rem; }
.post-card a { color: var(--warm-gold); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--muted-teal); }
.small-btn { padding: .35rem .9rem; font-size: .9rem; cursor: pointer; font-family: inherit; margin-right: .4rem; }
button.btn { cursor: pointer; font: inherit; font-weight: 700; border: 0; }
button.btn.outline { border: 2px solid var(--warm-gold); }
textarea { display: block; width: 100%; margin-top: .3rem; padding: .65rem .75rem; border: 1px solid var(--muted-teal); border-radius: 4px; font: inherit; background: var(--off-white); color: var(--black); }

/* About */
.lead { font-size: 1.2rem; color: var(--cream); }
.page .prose h2 { margin-top: 2.2rem; padding-bottom: .3rem; border-bottom: 1px solid var(--muted-teal); }

/* Library */
.center { text-align: center; }
.sr-only { position: absolute; left: -9999px; }
.lib { display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem; align-items: start; margin-top: 1.5rem; }
.lib-side input[type=search] { width: 100%; padding: .65rem .75rem; border: 1px solid var(--muted-teal); border-radius: 4px; font: inherit; background: var(--off-white); color: var(--black); }
.lib-list { margin-top: .75rem; display: flex; flex-direction: column; gap: .4rem; max-height: 70vh; overflow-y: auto; }
.lib-item { display: block; padding: .6rem .75rem; border: 1px solid var(--muted-teal); border-radius: 6px; text-decoration: none; color: var(--off-white); background: var(--deep-teal); }
.lib-item:hover, .lib-item.active { border-color: var(--warm-gold); }
.lib-item.active { background: var(--primary-teal); }
.lib-ep { display: block; font-size: .8rem; color: var(--warm-gold); letter-spacing: .04em; text-transform: uppercase; }
.lib-title { display: block; font-size: .95rem; line-height: 1.35; }
.lib-head h2 { margin: .2rem 0 1rem; font-size: 1.9rem; }
.lib-actions .btn { margin: 0 .5rem .5rem 0; }
.lib-frame { width: 100%; height: 80vh; min-height: 560px; border: 1px solid var(--muted-teal); border-radius: 6px; background: #fff; }
@media (max-width: 800px) { .lib { grid-template-columns: 1fr; } .lib-list { max-height: 40vh; } .lib-frame { height: 70vh; } }

/* Post copyright line */
.post-copy { font-size: .8rem; color: var(--cream); opacity: .8; margin-top: 2rem; border-top: 1px solid var(--muted-teal); padding-top: .75rem; }

.post-copy.notice { margin: 0 0 1rem; padding-top: 0; border-top: 0; }
