/* oddknight — shared styles for oddknight.com pages */

:root {
  --paper: #EFE9DC;
  --ink: #262019;
  --ink-soft: #6A604D;
  --rule: #D8CFBC;
  --dots: #C4B89E;
  --accent: #7A5420;
  /* System sans-serif: already on every device, so nothing to download */
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1E1A14;
    --ink: #ECE3D2;
    --ink-soft: #A89E86;
    --rule: #3A3328;
    --dots: #51483A;
    --accent: #D6A855;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------- Mark + wordmark ---------- */
.mark { color: var(--accent); flex-shrink: 0; }
.wordmark {
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink);
}

/* ---------- Menu (shared hover effect) ---------- */
.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem;
}
.menu a {
  position: relative;
  display: inline-block;
  padding: 0.2rem 0;
  text-decoration: none;
  color: var(--ink);
  transition: opacity .25s ease, color .25s ease;
}
.menu a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.1rem;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .3s ease;
}
.menu a:hover,
.menu a:focus-visible { color: var(--accent); }
.menu a:hover::after,
.menu a:focus-visible::after,
.menu a[aria-current="page"]::after { transform: scaleX(1); }
/* Dim the other items while one is hovered (mouse devices only) */
@media (hover: hover) {
  .menu:hover a:not(:hover) { opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) {
  .menu a, .menu a::after { transition: none; }
}

/* ---------- Home page ---------- */
.home {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}
.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rise .7s ease-out both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .hero { animation: none; } }

.hero .brand { display: flex; align-items: center; gap: 0.75rem; }
.hero .mark { width: 2.2rem; height: 2.2rem; }

/* Home-page logo: a knight's move on a 3x3 grid, drawn in on load */
.hero .mark-board { width: 2.9rem; height: 2.9rem; }
.mark-board .board-dots { fill: var(--dots); }
.mark-board .move-end { fill: var(--paper); }
.mark-board .move-start { animation: mark-pop .35s ease-out .25s both; transform-origin: 12px 40px; }
.mark-board .move-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: mark-draw .7s ease-in-out .5s forwards;
}
.mark-board .move-end { animation: mark-pop .35s ease-out 1.15s both; transform-origin: 24px 8px; }
@keyframes mark-draw { to { stroke-dashoffset: 0; } }
@keyframes mark-pop {
  from { opacity: 0; transform: scale(.4); }
  to   { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .mark-board .move-path { stroke-dashoffset: 0; animation: none; }
  .mark-board .move-start, .mark-board .move-end { animation: none; }
}
.hero .wordmark { margin: 0; font-size: clamp(2.2rem, 1.6rem + 3vw, 3.1rem); }
.hero .tagline {
  margin: 1.1rem 0 0;
  font-style: italic;
  color: var(--ink-soft);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.12rem);
  max-width: 30ch;
}
.hero .menu {
  margin-top: 2.6rem;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.hero .menu small {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

/* ---------- Inner pages ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 44rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.6rem 1.5rem;
}
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.site-header .mark { width: 1.4rem; height: 1.4rem; }
.site-header .wordmark { font-size: 1.35rem; }
.site-header .menu { gap: 1.5rem; font-size: 0.95rem; }

.page {
  flex: 1;
  max-width: 44rem;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}
.page h1 {
  font-weight: 700;
  font-size: clamp(2rem, 1.6rem + 2vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}
.page .lede { color: var(--ink-soft); font-size: 1.1rem; margin: 0; }
.page p { max-width: 60ch; }
.notice {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.notice strong { color: var(--accent); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .hero .menu { flex-direction: column; gap: 1.1rem; }
  .site-header .menu { gap: 1.1rem; }
}
