/* cosystrategy.com - hand-written, no framework.
   Palette follows Floatwood: pine forest, cream timber, wood browns, ink outlines, river blue. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces.ttf") format("truetype-variations"), url("/fonts/Fraunces.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito.ttf") format("truetype-variations"), url("/fonts/Nunito.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --night: #131e15;
  --bg: #172419;
  --pine: #243a28;
  --pine-2: #2c4731;
  --pine-3: #375a3d;
  --moss: #6f9a58;
  --cream: #fff6e2;
  --cream-2: #e9dfc7;
  --cream-3: #b9b19c;
  --timber: #f3d9a4;
  --wood: #8b5a2e;
  --wood-2: #a26b39;
  --wood-3: #c99a5e;
  --ink: #341f11;
  --ink-2: #24150b;
  --river: #4fa3c7;
  --river-2: #8fd0ea;
  --river-deep: #1f5c7a;
  --coral: #f0a078;
  --ok: #a8d98e;

  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px -12px rgb(0 0 0 / 55%);
  --gutter: clamp(16px, 4vw, 32px);
  --max: 1160px;
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 10% -10%, rgb(111 154 88 / 12%), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgb(79 163 199 / 8%), transparent 60%);
  background-repeat: no-repeat;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

main {
  flex: 1;
}

main:focus {
  outline: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-variation-settings: "SOFT" 100, "WONK" 0;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.45rem, 3.6vw, 2.1rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--river-2);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--cream);
}

:focus-visible {
  outline: 3px solid var(--river-2);
  outline-offset: 3px;
  border-radius: 4px;
}

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.9em;
  background: rgb(0 0 0 / 28%);
  padding: 0.1em 0.4em;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--cream);
  color: var(--ink);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.narrow {
  max-width: 820px;
}

.center {
  text-align: center;
}

.muted {
  color: var(--cream-3);
}

.small {
  font-size: 0.875rem;
}

.eyebrow {
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wood-3);
  margin-bottom: 0.5rem;
}

.lede {
  font-size: clamp(1.08rem, 2.4vw, 1.25rem);
  color: var(--cream-2);
  max-width: 62ch;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(19 30 21 / 88%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgb(255 246 226 / 7%);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  flex-wrap: wrap;
  padding-block: 0.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--cream);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  transition: transform 0.6s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.brand:hover .brand-mark {
  transform: rotate(-35deg);
}

.brand-name {
  font-family: var(--font-head);
  font-variation-settings: "SOFT" 100;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.brand-name span {
  color: var(--timber);
  font-weight: 600;
}

.site-nav {
  display: flex;
  gap: 0.15rem;
  flex-wrap: wrap;
  margin-inline: -0.6rem;
}

.site-nav a {
  color: var(--cream-2);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  transition: background-color 0.2s, color 0.2s;
}

.site-nav a:hover {
  background: rgb(255 246 226 / 8%);
  color: var(--cream);
}

.site-nav a[aria-current="page"] {
  background: var(--pine-2);
  color: var(--timber);
  box-shadow: inset 0 0 0 1px rgb(243 217 164 / 25%);
}

/* ---------- buttons ---------- */

.btn {
  --lift: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.7rem 1.35rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: 3px solid var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s;
}

/* The plank: like the "A COSY TIMBER IDLER" sign under the logo. */
.btn-plank {
  color: var(--cream);
  background-color: var(--wood);
  background-image:
    linear-gradient(180deg, rgb(255 255 255 / 10%), transparent 45%),
    repeating-linear-gradient(180deg, transparent 0 7px, rgb(52 31 17 / 28%) 7px 8px, transparent 8px 13px);
  box-shadow: 0 var(--lift) 0 var(--ink), 0 10px 18px -8px rgb(0 0 0 / 60%);
  text-shadow: 0 2px 0 rgb(52 31 17 / 70%);
}

.btn-plank:hover {
  color: var(--cream);
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 calc(var(--lift) + 1px) 0 var(--ink), 0 14px 22px -10px rgb(0 0 0 / 65%);
}

.btn-plank:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn-ghost {
  color: var(--timber);
  background: rgb(19 30 21 / 55%);
  border-color: rgb(243 217 164 / 45%);
  border-width: 2px;
}

.btn-ghost:hover {
  color: var(--cream);
  border-color: var(--timber);
  background: rgb(19 30 21 / 80%);
}

.btn-small {
  --lift: 3px;
  min-height: 38px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
}

.btn-icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  filter: drop-shadow(0 2px 0 rgb(52 31 17 / 70%));
}

.btn:disabled {
  cursor: progress;
  filter: saturate(0.6) brightness(0.9);
  transform: none;
}

.link-arrow {
  font-weight: 800;
  text-decoration: none;
}

.link-arrow::after {
  content: " \2192";
  display: inline-block;
  transition: transform 0.2s;
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(2.5rem, 9vw, 6.5rem) 0 clamp(3rem, 8vw, 5.5rem);
  text-align: center;
  border-bottom: 3px solid var(--ink);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
  transform: scale(1.06);
  animation: drift 40s ease-in-out infinite alternate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 42%, rgb(19 30 21 / 50%) 0%, rgb(19 30 21 / 76%) 55%, rgb(19 30 21 / 94%) 100%),
    linear-gradient(180deg, transparent 60%, var(--bg));
}

@keyframes drift {
  from {
    transform: scale(1.06) translateX(-1.2%);
  }
  to {
    transform: scale(1.1) translateX(1.2%);
  }
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-logo {
  margin: 0 0 1rem;
  width: min(640px, 88vw);
}

.hero-logo img {
  width: 100%;
  filter: drop-shadow(0 12px 18px rgb(0 0 0 / 45%));
}

.hero-pitch {
  font-family: var(--font-head);
  font-variation-settings: "SOFT" 100;
  font-weight: 500;
  font-size: clamp(1.2rem, 3.4vw, 1.65rem);
  line-height: 1.35;
  max-width: 30ch;
  margin-bottom: 1.6rem;
  text-shadow: 0 2px 10px rgb(0 0 0 / 60%);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}

.hero-meta {
  color: var(--cream-2);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  margin: 0;
}

.page-hero {
  padding: clamp(2rem, 7vw, 4.25rem) 0 clamp(1rem, 3vw, 1.5rem);
}

.page-hero h1 {
  margin-bottom: 0.4em;
}

.page-hero .btn {
  margin-top: 0.5rem;
}

.page-hero-game {
  text-align: center;
}

.page-hero-game .lede {
  margin-inline: auto;
}

.page-logo {
  width: min(520px, 84vw);
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 10px 16px rgb(0 0 0 / 40%));
}

.quick-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.4rem 0 0;
  padding: 0;
}

.quick-facts div {
  background: var(--pine);
  border: 1px solid rgb(255 246 226 / 9%);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  display: flex;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.quick-facts dt {
  color: var(--wood-3);
  font-weight: 800;
}

.quick-facts dd {
  margin: 0;
  font-weight: 700;
}

/* ---------- sections ---------- */

.section {
  padding: clamp(2.25rem, 6vw, 4.5rem) 0;
}

.section-head {
  max-width: 60ch;
  margin-bottom: 1.75rem;
}

.section-head p {
  color: var(--cream-2);
}

/* A wooden board behind screenshots: dark planks with ink seams. */
.section-board {
  background-color: #2a1a0f;
  background-image:
    linear-gradient(180deg, rgb(0 0 0 / 35%), transparent 18%, transparent 82%, rgb(0 0 0 / 35%)),
    repeating-linear-gradient(180deg, #3a2414 0 92px, #24150b 92px 95px),
    repeating-linear-gradient(90deg, rgb(255 255 255 / 1.5%) 0 2px, transparent 2px 9px);
  border-block: 3px solid var(--ink-2);
}

.section-board .section-head p {
  color: var(--timber);
}

/* ---------- features ---------- */

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.feature {
  background: var(--pine);
  border: 1px solid rgb(255 246 226 / 8%);
  border-radius: var(--radius);
  padding: 1.35rem 1.3rem 1.1rem;
  box-shadow: var(--shadow);
}

.feature p {
  color: var(--cream-2);
  margin: 0;
  font-size: 0.98rem;
}

.feature-title {
  font-size: 1.2rem;
  margin: 0.75rem 0 0.35rem;
}

.feature-icon {
  width: 46px;
  height: 46px;
  padding: 6px;
  border-radius: 12px;
  background: var(--pine-3);
  box-shadow: inset 0 0 0 2px rgb(52 31 17 / 45%);
}

.icon-log {
  color: var(--wood-2);
}

.icon-axe {
  color: #c7d3d6;
}

.icon-leaf {
  color: var(--moss);
}

.icon-clock {
  color: var(--timber);
}

/* ---------- screenshots ---------- */

.photo {
  position: relative;
  display: block;
  border: 4px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 16px 28px -14px rgb(0 0 0 / 80%);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.photo img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.photo:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 34px -14px rgb(0 0 0 / 85%);
}

.photo-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.6rem 0.9rem 0.6rem;
  background: linear-gradient(180deg, transparent, rgb(20 12 6 / 88%));
  color: var(--cream);
  font-weight: 700;
  font-size: 0.92rem;
}

.pinboard {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: grid;
  gap: clamp(1.25rem, 3vw, 1.75rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.pinboard li {
  position: relative;
}

/* Pinned slightly askew, like photos on the wall of the mess hut. */
.pinboard li:nth-child(4n + 1) .photo {
  transform: rotate(-0.8deg);
}

.pinboard li:nth-child(4n + 2) .photo {
  transform: rotate(0.6deg);
}

.pinboard li:nth-child(4n + 3) .photo {
  transform: rotate(0.5deg);
}

.pinboard li:nth-child(4n) .photo {
  transform: rotate(-0.5deg);
}

.pinboard li .photo:hover {
  transform: translateY(-3px) rotate(0deg);
}

/* A brass tack at the top of each photo. */
.pinboard li::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: -7px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f5df9c, #b2843a 60%, #6b4a1c);
  box-shadow: 0 2px 2px rgb(0 0 0 / 60%);
}

.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

/* ---------- lightbox (dialog built by lightbox.ts) ---------- */

.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(0.5rem, 3vw, 2rem);
  border: 0;
  background: transparent;
  color: var(--cream);
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: rgb(10 14 10 / 92%);
}

.lightbox-figure {
  margin: 0;
  max-width: min(1600px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

.lightbox-img {
  max-height: calc(100vh - 7rem);
  width: auto;
  border: 4px solid var(--ink);
  border-radius: 10px;
  background: var(--ink);
  box-shadow: 0 30px 60px -20px #000;
}

.lightbox figcaption {
  text-align: center;
  font-weight: 700;
  padding-inline: 3.5rem;
}

.lightbox-count {
  color: var(--cream-3);
  font-weight: 600;
  margin-left: 0.4rem;
}

.lightbox-btn {
  position: fixed;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--wood);
  color: var(--cream);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  display: grid;
  place-items: center;
  padding: 0 0 4px;
}

.lightbox-btn:hover {
  filter: brightness(1.12);
}

.lightbox-prev {
  left: clamp(6px, 2vw, 24px);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: clamp(6px, 2vw, 24px);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-close {
  right: clamp(6px, 2vw, 24px);
  top: clamp(6px, 2vw, 24px);
}

/* ---------- Floatwood page ---------- */

.story {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.prose h2 {
  margin-top: 1.8em;
  color: var(--timber);
}

.prose > h2:first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  color: var(--cream-2);
  max-width: 68ch;
}

.prose strong {
  color: var(--cream);
}

.prose ul {
  padding-left: 1.2rem;
}

.prose li {
  margin-bottom: 0.4em;
}

.clip {
  margin: 0 0 1.5rem;
  border: 4px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  background: var(--ink);
  max-width: 616px;
  box-shadow: var(--shadow);
}

.clip img {
  width: 100%;
  aspect-ratio: 616 / 346;
}

.story-side {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.card {
  background: var(--pine);
  border: 1px solid rgb(255 246 226 / 8%);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 3vw, 1.5rem);
  box-shadow: var(--shadow);
  margin: 0;
}

.card-title {
  font-size: 1.3rem;
  color: var(--timber);
}

.ticks {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ticks li {
  position: relative;
  padding-left: 1.7rem;
  margin-bottom: 0.6rem;
  color: var(--cream-2);
}

/* Each bullet is a tiny log end. */
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.38em;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: radial-gradient(circle, var(--wood-3) 0 18%, var(--timber) 19% 52%, var(--wood) 53%);
  box-shadow: 0 0 0 1.5px var(--ink);
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid rgb(255 246 226 / 10%);
}

.req-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--pine);
  font-size: 0.97rem;
}

.req-table th,
.req-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgb(255 246 226 / 7%);
}

.req-table thead th {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--river-2);
  background: var(--pine-2);
}

.req-table tbody th {
  color: var(--wood-3);
  font-weight: 800;
  white-space: nowrap;
}

.req-table tr:last-child th,
.req-table tr:last-child td {
  border-bottom: 0;
}

.cta {
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

.cta p {
  color: var(--cream-2);
}

/* ---------- studio blurb ---------- */

.studio {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  max-width: 880px;
}

.studio-mark {
  width: 84px;
  height: 84px;
}

.studio p {
  color: var(--cream-2);
}

.studio-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-weight: 800;
}

/* ---------- fact sheet ---------- */

.fact-sheet {
  max-width: 820px;
}

.facts {
  margin: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 1fr;
  padding: 0.55rem 0;
  border-bottom: 1px dashed rgb(255 246 226 / 14%);
}

.facts div:last-child {
  border-bottom: 0;
}

.facts dt {
  color: var(--wood-3);
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ---------- forms ---------- */

.support-layout {
  display: grid;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  align-items: start;
}

.support-form-wrap {
  min-width: 0;
}

.form {
  background: var(--pine);
  border: 1px solid rgb(255 246 226 / 8%);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 4vw, 2rem);
  box-shadow: var(--shadow);
}

.form-row {
  display: grid;
  gap: 0 1.1rem;
}

.field {
  margin-bottom: 1.15rem;
  min-width: 0;
}

.field label {
  display: block;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.optional {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--cream-3);
  margin-left: 0.3rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--cream);
  background: var(--night);
  border: 2px solid #4a3a28;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field textarea {
  resize: vertical;
  min-height: 7rem;
  line-height: 1.5;
}

.field select {
  appearance: none;
  padding-right: 2.4rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--timber) 50%),
    linear-gradient(135deg, var(--timber) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.field select option {
  background: var(--night);
  color: var(--cream);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #7d7766;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--wood-2);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--river);
  box-shadow: 0 0 0 3px rgb(79 163 199 / 30%);
}

.field [aria-invalid="true"] {
  border-color: var(--coral);
}

.field-hint {
  color: var(--cream-3);
  font-size: 0.86rem;
  margin: 0.35rem 0 0;
}

.counter.is-low {
  color: var(--coral);
}

.field-error {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  color: var(--coral);
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0.4rem 0 0;
}

.field-error::before {
  content: "!";
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--coral);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 900;
  transform: translateY(-1px);
}

/* Honeypot: off-screen rather than display:none, which some bots look for. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 0.5rem;
}

.form-actions p {
  margin: 0;
  flex: 1 1 220px;
}

.when-busy {
  display: none;
}

.htmx-request .when-idle {
  display: none;
}

.htmx-request .when-busy {
  display: inline;
}

.form-alert:empty {
  display: none;
}

.alert {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
}

.alert p {
  margin: 0;
}

.alert:focus {
  outline: none;
}

.alert-error {
  background: rgb(240 160 120 / 12%);
  border: 2px solid rgb(240 160 120 / 55%);
}

.alert-icon {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--coral);
  margin-top: 2px;
}

.success {
  text-align: center;
  padding-block: 2.2rem;
}

.success:focus {
  outline: none;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  padding: 14px;
  color: var(--ink);
  background: var(--ok);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--ink);
}

.success p {
  color: var(--cream-2);
  max-width: 52ch;
  margin-inline: auto;
}

.ticket-ref {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: var(--timber);
  background: rgb(0 0 0 / 25%);
  padding: 0.1em 0.45em;
  border-radius: 6px;
  letter-spacing: 0.04em;
}

/* ---------- admin ---------- */

.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filters a {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  color: var(--cream-2);
  border: 1px solid rgb(255 246 226 / 15%);
}

.filters a[aria-current="page"] {
  background: var(--pine-2);
  color: var(--timber);
}

.tickets {
  display: grid;
  gap: 0.9rem;
}

.ticket {
  background: var(--pine);
  border: 1px solid rgb(255 246 226 / 8%);
  border-left: 5px solid var(--river);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  scroll-margin-top: 5rem;
}

.ticket.is-closed {
  border-left-color: var(--cream-3);
  opacity: 0.78;
}

.ticket-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  font-size: 0.86rem;
  color: var(--cream-3);
}

.ticket-subject {
  font-size: 1.15rem;
  margin: 0.55rem 0 0.25rem;
  overflow-wrap: anywhere;
}

.ticket-from {
  color: var(--cream-2);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.ticket details {
  margin-bottom: 0.75rem;
}

.ticket summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--river-2);
}

.ticket h3 {
  font-size: 1rem;
  margin-top: 1rem;
}

.ticket-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--night);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin: 0.6rem 0;
  color: var(--cream-2);
}

.tag {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  background: var(--pine-3);
  color: var(--cream);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.tag-open {
  background: var(--river-deep);
}

.tag-closed {
  background: #4b4a40;
}

/* ---------- river divider + footer ---------- */

.river {
  position: relative;
  height: 64px;
  overflow: hidden;
  background: var(--bg);
}

.river-banks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.river-water {
  fill: var(--river-deep);
}

.river-glint {
  fill: none;
  stroke: var(--river-2);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.45;
}

.river-log {
  --d: 0;
  position: absolute;
  top: 27px;
  left: 0;
  width: 46px;
  height: 11px;
  border-radius: 4px;
  background: var(--wood);
  border: 2px solid var(--ink);
  animation: float-log 46s linear infinite;
  animation-delay: calc(var(--d) * -9.2s);
}

.river-log::after {
  content: "";
  position: absolute;
  right: -4px;
  top: -2px;
  width: 7px;
  height: 11px;
  border-radius: 50%;
  background: var(--timber);
  border: 2px solid var(--ink);
}

.river-log.is-short {
  width: 32px;
  top: 33px;
}

.river-log.d1 {
  --d: 1;
  top: 21px;
}

.river-log.d2 {
  --d: 2;
  top: 31px;
}

.river-log.d3 {
  --d: 3;
}

.river-log.d4 {
  --d: 4;
  top: 24px;
}

@keyframes float-log {
  0% {
    transform: translateX(-60px) rotate(-4deg);
  }
  25% {
    transform: translateX(25vw) translateY(3px) rotate(3deg);
  }
  50% {
    transform: translateX(50vw) translateY(-2px) rotate(-2deg);
  }
  75% {
    transform: translateX(75vw) translateY(2px) rotate(4deg);
  }
  100% {
    transform: translateX(calc(100vw + 60px)) rotate(-3deg);
  }
}

.site-footer {
  background: var(--night);
  margin-top: auto;
}

.site-footer-inner {
  display: grid;
  gap: 1.25rem;
  padding-block: 2rem 2.5rem;
}

.footer-brand {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  color: var(--cream-3);
  font-size: 0.95rem;
}

.footer-brand p {
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font-weight: 800;
}

.footer-nav a {
  color: var(--timber);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--cream);
  text-decoration: underline;
}

.footer-copy {
  color: var(--cream-3);
  font-size: 0.85rem;
  margin: 0;
}

/* ---------- status pages ---------- */

.status-page {
  padding-block: clamp(3rem, 10vw, 7rem);
}

.status-page .lede {
  margin-inline: auto;
}

.status-page .hero-actions {
  margin-top: 1.5rem;
}

/* ---------- larger screens ---------- */

@media (min-width: 720px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .studio {
    grid-template-columns: auto 1fr;
    gap: 2rem;
  }

  .studio-mark {
    width: 110px;
    height: 110px;
  }

  .facts div {
    grid-template-columns: 9.5rem 1fr;
    gap: 1rem;
  }

  .site-footer-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .footer-copy {
    grid-column: 1 / -1;
  }
}

@media (min-width: 960px) {
  .story {
    grid-template-columns: minmax(0, 1fr) 340px;
  }


  .support-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .support-side {
    position: sticky;
    top: 5.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .river-log { transform: translateX(8vw); }
  .river-log.d1 { transform: translateX(27vw); }
  .river-log.d2 { transform: translateX(49vw); }
  .river-log.d3 { transform: translateX(68vw); }
  .river-log.d4 { transform: translateX(86vw); }
}

.field-hint .counter {
  display: block;
  margin-top: 0.2rem;
}

/* "a lot of coffee energy drinks": the struck word stays readable but recedes. */
.footer-brand s {
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgb(240 160 120 / 75%);
  opacity: 0.7;
}
