/* Second Nature Dojo — public site. "Dojo at night" identity:
   warm near-black / aged paper, brass + muted belt-red, Oswald over Spectral. */

:root {
  color-scheme: light dark;
  /* Light — "dojo by day": aged paper, ink, brass, muted belt-red */
  --ink:      #211b13;
  --paper:    #f4efe3;
  --surface:  #ebe4d3;
  --rule:     #d8cfba;
  --muted:    #6f6553;
  --brass:    #8a6a1c;
  --brass-dim:#a98a3d;
  --belt:     #8f3a2d;
  --focus:    #8a6a1c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Dark — "dojo at night" (the app's own appearance) */
    --ink:      #ede5d5;
    --paper:    #141009;
    --surface:  #1d1710;
    --rule:     #342c20;
    --muted:    #938870;
    --brass:    #c9a24b;
    --brass-dim:#8a7440;
    --belt:     #b3503f;
    --focus:    #c9a24b;
  }
}
:root[data-theme="dark"] {
  --ink:      #ede5d5;
  --paper:    #141009;
  --surface:  #1d1710;
  --rule:     #342c20;
  --muted:    #938870;
  --brass:    #c9a24b;
  --brass-dim:#8a7440;
  --belt:     #b3503f;
  --focus:    #c9a24b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.72 "Spectral", Georgia, "Times New Roman", serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
[hidden] { display: none !important; }

a { color: var(--ink); text-decoration-color: var(--brass-dim); text-underline-offset: .18em; }
a:hover { text-decoration-color: var(--brass); }
::selection { background: var(--brass); color: var(--paper); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 1px; }

.skip {
  position: absolute; left: .5rem; top: .5rem; z-index: 40;
  background: var(--ink); color: var(--paper);
  padding: .5rem .8rem; border-radius: 5px; text-decoration: none;
  font-family: "Oswald", "Arial Narrow", sans-serif; font-size: .8rem;
  letter-spacing: .08em; text-transform: uppercase;
  transform: translateY(-150%);
}
.skip:focus { transform: none; }

/* ---- Top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.4rem;
  padding: .85rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  font-size: .95rem; color: var(--ink); text-decoration: none; margin-right: auto;
}
.wordmark span { color: var(--brass); }
.topbar nav {
  display: flex; flex-wrap: wrap; gap: .4rem 1.15rem;
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 400; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
}
.topbar nav a { text-decoration: none; color: var(--muted); white-space: nowrap; }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: .35em;
}

/* ---- Shell ---- */
.shell {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 clamp(1.15rem, 5vw, 2.5rem);
  position: relative;
}
.page { padding: 3.4rem 0 4rem; }

/* ---- Embusen rail: the page you're on, as a step along the path ---- */
.rail {
  position: fixed;
  left: max(1rem, calc((100vw - 46rem) / 2 - 2.6rem));
  top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 1.35rem;
  padding: 1.1rem 0;
  z-index: 15;
}
.rail::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; margin-left: -1px; background: var(--rule);
}
.rail a {
  position: relative; width: 10px; height: 10px; border-radius: 50%;
  background: var(--paper); box-shadow: 0 0 0 2px var(--rule);
  transition: background .25s ease, box-shadow .25s ease, transform .25s ease;
}
.rail a:hover { box-shadow: 0 0 0 2px var(--brass-dim); }
.rail a[aria-current="page"] {
  background: var(--brass); box-shadow: 0 0 0 2px var(--brass); transform: scale(1.35);
}
.rail a::after {
  content: attr(data-label);
  position: absolute; left: 1.4rem; top: 50%; transform: translateY(-50%);
  padding: .2rem .45rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 4px;
  font: 500 .62rem/1 "Oswald", "Arial Narrow", sans-serif;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); white-space: nowrap;
  opacity: 0; transition: opacity .18s ease; pointer-events: none;
}
.rail a:hover::after, .rail a:focus-visible::after { opacity: 1; }
@media (max-width: 72rem) { .rail { display: none; } }

/* ---- Type ---- */
.eyebrow {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 500; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--brass); margin: 0 0 .9rem;
  display: flex; align-items: center; gap: .6rem;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--belt); flex: none;
}

h1 {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 500; font-size: clamp(2rem, 4.6vw, 2.9rem); line-height: 1.06;
  letter-spacing: .01em; margin: .1rem 0 .5rem; text-wrap: balance;
}
.page-index h1 { font-size: clamp(2.6rem, 7vw, 4rem); line-height: 1.02; }
h2 {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 500; font-size: clamp(1.4rem, 3vw, 1.8rem); line-height: 1.14;
  margin: 2.2rem 0 .6rem; text-wrap: balance;
}
h3 {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 500; font-size: 1rem; letter-spacing: .05em; text-transform: uppercase;
  margin: 1.9rem 0 .5rem;
}
p { margin: .75rem 0; max-width: 40rem; }
strong { font-weight: 600; }

.lede { font-size: 1.22rem; line-height: 1.6; color: var(--ink); }
.tagline {
  font-style: italic; font-size: 1.3rem; color: var(--muted);
  margin: 0 0 1.5rem; padding-left: 1rem; border-left: 2px solid var(--belt);
}
.meta {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}

/* ---- Overview ---- */
.platforms {
  display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.6rem 0 .5rem;
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
}
.platforms span {
  border: 1px solid var(--rule); border-radius: 999px;
  padding: .32rem .8rem; color: var(--muted);
}
.jump { list-style: none; margin: 2.4rem 0 0; padding: 0; border-top: 1px solid var(--rule); max-width: 40rem; }
.jump a {
  display: grid; grid-template-columns: 1fr auto; column-gap: 1rem;
  padding: 1rem .2rem; border-bottom: 1px solid var(--rule);
  text-decoration: none; color: var(--ink);
}
.jump a:hover { background: color-mix(in srgb, var(--brass) 8%, transparent); }
.jump b {
  grid-column: 1; font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 500; font-size: 1.05rem; letter-spacing: .02em;
}
.jump em {
  grid-column: 2; grid-row: 1; align-self: center; font-style: normal;
  color: var(--brass); font-size: 1.1rem;
}
.jump span { grid-column: 1; color: var(--muted); font-size: .95rem; margin-top: .15rem; }

/* ---- Feature list ---- */
.features { list-style: none; margin: 1rem 0 0; padding: 0; max-width: 40rem; }
.features li {
  display: grid; grid-template-columns: auto 1fr; gap: .8rem;
  padding: .85rem 0; border-bottom: 1px solid var(--rule);
}
.features li::before {
  content: ""; margin-top: .55rem; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brass); flex: none;
}
.features b {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 500; letter-spacing: .02em; display: block; font-size: 1.02rem;
}
.features span { color: var(--muted); font-size: .97rem; }
.inline-pro {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 500; font-size: .58rem; letter-spacing: .14em; text-transform: uppercase;
  background: var(--belt); color: #f4efe3;
  padding: .16rem .42rem; border-radius: 3px; vertical-align: middle;
  position: relative; top: -1px;
}

/* ---- Free / Pro ---- */
.tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 1rem; max-width: 40rem; }
.tiers > div { padding: 1.1rem 1.3rem 1.4rem; }
.tiers > div:first-child { border-right: 1px solid var(--rule); padding-left: 0; }
.tiers h3 { margin-top: 0; }
.tiers h3 .tag {
  font-size: .62rem; letter-spacing: .16em; padding: .18rem .5rem; margin-left: .5rem;
  border-radius: 3px; vertical-align: middle;
}
.tag.free { background: var(--surface); color: var(--muted); }
.tag.pro  { background: var(--belt); color: #f4efe3; }
.tiers ul { list-style: none; margin: .5rem 0 0; padding: 0; }
.tiers li { padding: .4rem 0; font-size: .95rem; color: var(--muted); border-bottom: 1px solid var(--rule); }
.tiers li:last-child { border-bottom: 0; }
@media (max-width: 34rem) {
  .tiers { grid-template-columns: 1fr; }
  .tiers > div:first-child { border-right: 0; border-bottom: 1px solid var(--rule); padding-left: 1.3rem; }
}

/* ---- Privacy ---- */
.page-privacy h2 { color: var(--ink); font-size: 1rem; letter-spacing: .05em; text-transform: uppercase; margin: 2rem 0 .5rem; }
.page-privacy ul { padding-left: 1.2rem; max-width: 40rem; }
.page-privacy li { margin: .35rem 0; }
.callout {
  background: var(--surface); border: 1px solid var(--rule);
  border-left: 3px solid var(--brass);
  padding: 1rem 1.15rem; margin: 1.3rem 0; max-width: 40rem;
  font-size: .99rem;
}
.callout strong {
  display: block; font-family: "Oswald", "Arial Narrow", sans-serif;
  letter-spacing: .08em; text-transform: uppercase; font-size: .8rem;
  color: var(--brass); margin-bottom: .3rem;
}

/* ---- Errata form ---- */
.form-wrap {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  padding: clamp(1.15rem, 4vw, 1.8rem); margin-top: 1.3rem; max-width: 40rem;
}
form { display: grid; gap: 1.05rem; }
.field { display: grid; gap: .35rem; }
.field label {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-size: .8rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink);
}
.field .hint { font-size: .82rem; color: var(--muted); font-style: italic; }
.req { color: var(--belt); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.05rem; }
@media (max-width: 34rem) { .row { grid-template-columns: 1fr; } }

input, select, textarea {
  font: 400 1rem/1.5 "Spectral", Georgia, serif;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 5px;
  padding: .6rem .7rem; width: 100%;
}
textarea { resize: vertical; min-height: 6.5rem; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brass); outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 25%, transparent);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 2rem;
}

button {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 500; font-size: .9rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--paper); background: var(--belt);
  border: 0; border-radius: 5px; padding: .8rem 1.4rem;
  cursor: pointer; justify-self: start;
  transition: filter .15s ease;
}
button:hover { filter: brightness(1.08); }
button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--rule); }

.form-error { color: var(--belt); font-size: .9rem; font-style: italic; margin: 0; }
.sent {
  background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--brass);
  border-radius: 6px; padding: 1rem 1.15rem; margin-top: 1rem;
}
.sent h3 { margin-top: 0; }
.sent pre {
  white-space: pre-wrap; word-break: break-word;
  font: 400 .86rem/1.55 "Spectral", Georgia, serif; color: var(--muted);
  background: var(--surface); border: 1px solid var(--rule); border-radius: 5px;
  padding: .8rem; margin: .7rem 0; max-height: 15rem; overflow: auto;
}
.sent-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.sent-actions a.btnlink {
  font-family: "Oswald", "Arial Narrow", sans-serif; font-size: .8rem; letter-spacing: .09em;
  text-transform: uppercase; text-decoration: none; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 5px; padding: .55rem 1rem;
}

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--rule); margin-top: 2rem; }
.site-footer .shell { padding-top: 1.7rem; padding-bottom: 2.6rem; }
.site-footer p { color: var(--muted); font-size: .92rem; }
.site-footer .meta { display: block; margin-top: .6rem; }
