/* Kettlewood — shared stylesheet (site + rules). No external resources. */

:root {
  --bg: #1d2a24;          /* deep forest green */
  --bg-raised: #24352d;   /* cards */
  --bg-sunk: #16211c;     /* code, footer */
  --text: #f3e6cf;        /* cream */
  --text-muted: #c9bda6;  /* cream, dimmed (AA on --bg) */
  --accent: #e0823d;      /* copper / ember */
  --accent-soft: #f0a468; /* ember, lighter (hover) */
  --verdigris: #3f8f7f;   /* decoration only: borders, bullets */
  --verdigris-text: #7cc4b3; /* verdigris readable as text (AA on --bg) */
  --radius: 10px;
  --measure: 42rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, Menlo, monospace;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  /* Footer stays at the bottom on short pages. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; width: 100%; }

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

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-soft); }
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--bg); padding: .5rem 1rem; z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */

.banner { margin: 0; background: var(--bg-sunk); border-bottom: 3px solid var(--verdigris); }
.banner img {
  width: 100%;
  /* Narrow screens: keep the wordmark readable by cropping the sides. */
  min-height: 7.5rem;
  max-height: 16rem;
  object-fit: cover;
  object-position: center;
}

.masthead {
  background: var(--bg-sunk);
  border-bottom: 3px solid var(--verdigris);
  padding: 1.75rem 1rem 1.5rem;
  text-align: center;
}
.masthead .wordmark {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 7vw, 3rem);
  letter-spacing: .02em;
  line-height: 1.1;
}
.masthead .wordmark a { color: var(--text); text-decoration: none; }
.masthead p { margin: .35rem 0 0; color: var(--text-muted); }

/* ---------- Layout ---------- */

main, .wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1rem;
}

section { padding: 2rem 0 0.5rem; }

h1, h2, h3 { font-family: var(--font-serif); line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); margin: 2rem 0 .75rem; }
h2 {
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  margin: 0 0 1rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--verdigris);
}
h3, h2.rule {
  font-size: 1.15rem;
  margin: 1.75rem 0 .4rem;
  padding: 0;
  border: 0;
  color: var(--accent);
}

.tagline {
  font-size: clamp(1.15rem, 3.6vw, 1.35rem);
  font-family: var(--font-serif);
  text-align: center;
  margin: 2rem auto 0;
  max-width: 34rem;
}

.lead { color: var(--text-muted); }

/* ---------- Server address ---------- */

.address {
  margin: 1.5rem auto 0;
  padding: 1.1rem 1rem;
  text-align: center;
  background: var(--bg-raised);
  border: 1px solid var(--verdigris);
  border-radius: var(--radius);
}
.address .label {
  display: block;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--verdigris-text);
}
.address code {
  display: inline-block;
  margin-top: .35rem;
  padding: .4rem .8rem;
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, 5vw, 1.6rem);
  color: var(--text);
  background: var(--bg-sunk);
  border-radius: 6px;
  /* No JS "copy" button: one tap/click selects the whole address. */
  -webkit-user-select: all;
  user-select: all;
  word-break: break-all;
}
.address small { display: block; margin-top: .45rem; color: var(--text-muted); }

/* ---------- Lists ---------- */

.features { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.features li {
  background: var(--bg-raised);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .75rem 1rem;
}
.features strong { color: var(--text); }

.steps { padding-left: 1.4rem; margin: 0; }
.steps li { margin: .4rem 0; }
.steps li::marker { color: var(--accent); font-weight: 700; }

ul.plain { padding-left: 1.2rem; }
ul.plain li { margin: .35rem 0; }
ul.plain li::marker { color: var(--verdigris-text); }

code { font-family: var(--font-mono); font-size: .92em; }

/* ---------- Links grid ---------- */

.links { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; grid-template-columns: 1fr; }

.btn {
  display: block;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  background: var(--accent);
  color: var(--bg);
  border: 2px solid var(--accent);
}
.btn:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--bg); }
.btn .sub { display: block; font-weight: 400; font-size: .85rem; }

.soon {
  display: block;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-muted);
  border: 2px dashed var(--verdigris);
}
.soon .sub { display: block; font-size: .85rem; font-style: italic; }

/* ---------- Rules page ---------- */

.why { color: var(--text-muted); font-style: italic; }

.notice {
  margin: 2.5rem 0 1rem;
  padding: 1.1rem 1.2rem;
  background: var(--bg-raised);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
}
.notice h2 { border: 0; padding: 0; margin: 0 0 .5rem; font-size: 1.25rem; }
.notice p { margin: .4rem 0; }

.version { color: var(--text-muted); font-size: .9rem; margin: 1.5rem 0; }

hr { border: 0; border-top: 1px solid var(--verdigris); margin: 2.5rem 0 0; }

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

footer {
  margin-top: 3rem;
  padding: 1.5rem 1rem 2rem;
  background: var(--bg-sunk);
  border-top: 3px solid var(--verdigris);
  color: var(--text-muted);
  font-size: .9rem;
  text-align: center;
}
footer p { margin: .35rem auto; max-width: var(--measure); }

/* ---------- Wider screens ---------- */

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

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color .15s ease, border-color .15s ease; }
}

/* tableaux du guide (wiki) */
table { border-collapse: collapse; margin: 1rem 0; width: 100%; max-width: 32rem; }
th, td { text-align: left; padding: .35rem .75rem; border-bottom: 1px solid rgba(124, 196, 179, .25); }
th { color: #7cc4b3; font-weight: 600; }

/* bannière et menu, comme sur kettlewood.org et le guide */
.banner { margin: 0; background: var(--bg-sunk); border-bottom: 3px solid var(--verdigris); }
.banner img {
  width: 100%;
  /* Narrow screens: keep the wordmark readable by cropping the sides. */
  min-height: 7.5rem;
  max-height: 16rem;
  object-fit: cover;
  object-position: center;
}
.banner img { display: block; }
.banner + .masthead { padding: .45rem 1rem .55rem; }
.banner + .masthead p { margin: 0; }

/* ---------- Forms (rules confirmation, end-of-beta survey) ---------- */
fieldset { border: 1px solid var(--verdigris); border-radius: var(--radius); margin: 0 0 1.25rem; padding: .75rem 1rem 1rem; }
legend { padding: 0 .35rem; font-weight: 600; }
fieldset label { display: inline-block; margin: .2rem 0; }
textarea, input[type="email"] {
  width: 100%; box-sizing: border-box; margin-top: .35rem; padding: .55rem .7rem;
  background: var(--bg-sunk); color: var(--text); border: 1px solid var(--verdigris); border-radius: var(--radius);
  font: inherit;
}
textarea { resize: vertical; min-height: 6rem; }
label.nps { margin-right: .7rem; white-space: nowrap; }
button[type="submit"] {
  background: var(--accent); color: var(--bg); border: 0; border-radius: var(--radius);
  padding: .65rem 1.4rem; font: inherit; font-weight: 700; cursor: pointer;
}
button[type="submit"]:hover { background: var(--accent-soft); }
