@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,500&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  --bg: #F4F1EA;
  --ink: #102A43;
  --ink-strong: #0B1D30;
  --olive: #556B2F;
  --copper: #9C6B45;
  --muted: rgba(16, 42, 67, 0.62);
  --faint: rgba(16, 42, 67, 0.42);
  --border: rgba(16, 42, 67, 0.16);
  --border-strong: rgba(16, 42, 67, 0.28);
  --surface: rgba(16, 42, 67, 0.035);
  --surface-hover: rgba(16, 42, 67, 0.06);
  --card-bg: #FBF9F4;

  /* Move-quality scale, kept within the print palette — no neon, no orange/terracotta */
  --q-best: #4C6A2F;
  --q-excellent: #6E8548;
  --q-good: #A68A4C;
  --q-inaccuracy: #9C7A3C;
  --q-mistake: #8C4A3E;
  --q-blunder: #6B2737;

  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SF Mono", "Fira Code", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Fine paper-grain overlay — subtle engraving-plate texture, not decoration for its own sake */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.06  0 0 0 0 0.16  0 0 0 0 0.26  0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

a { color: inherit; }

h1, h2, h3 { font-family: var(--serif); }

.serif-accent { font-family: var(--serif); font-style: italic; color: var(--olive); }

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px;
  background: rgba(244, 241, 234, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink-strong);
}

.nav-brand-mark { width: 26px; height: 26px; flex-shrink: 0; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-link {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-link:hover { color: var(--ink); }

/* AUTH WIDGET */
.auth-widget {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}

.auth-email {
  color: var(--muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
}

.auth-link {
  background: none;
  border: none;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.auth-link:hover { color: var(--ink); }

.auth-signin-btn {
  padding: 8px 18px;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  background: transparent;
  transition: all 0.15s ease;
}

.auth-signin-btn:hover { background: var(--surface-hover); border-color: var(--ink); }

/* SHARED COMPONENTS */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 28px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary:hover { background: var(--ink-strong); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 26px;
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover { background: var(--surface); border-color: var(--ink); }

footer.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--faint);
  border-top: 1px solid var(--border);
  margin-top: 88px;
}

footer.site-footer a { color: var(--faint); text-decoration: none; }
footer.site-footer a:hover { color: var(--muted); }

.footer-links { display: flex; gap: 22px; }
