/* ═══════════════════════════════════════════════════════
   ogham.ajb.co — shared styles
   Palette: vellum · ink · moss · gold · stone
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=IM+Fell+English:ital@0;1&family=Inter:wght@300;400;500&display=swap');

/* ── TOKENS ── */
:root {
  --vellum:  #f0ebe0;
  --vellum2: #e8e1d0;
  --ink:     #1a1814;
  --ink2:    #2e2a22;
  --moss:    #3a4a2e;
  --moss2:   #4e6340;
  --gold:    #b8964a;
  --gold2:   #d4b06a;
  --stone:   #8a7e6a;
  --stone2:  #6a5e4a;
  --panel:   #13120f;
  --panel2:  #1c1a17;

  --ff-display: 'Cinzel', serif;
  --ff-body:    'IM Fell English', serif;
  --ff-ui:      'Inter', sans-serif;

  --radius: 4px;
  --max-w:  960px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--vellum);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 1.05rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: var(--moss); text-decoration: none; }
a:hover { color: var(--moss2); }

/* ── NAV ── */
nav {
  background: var(--ink);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  border-bottom: 1px solid #2e2a22;
}

.nav-brand {
  font-family: var(--ff-display);
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--stone);
  font-family: var(--ff-ui);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--vellum); }

/* ── HERO ── */
.hero {
  background: var(--ink);
  color: var(--vellum);
  padding: 5rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero-eyebrow {
  font-family: var(--ff-ui);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-family: var(--ff-display);
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--vellum);
  line-height: 1.1;
}

.hero h1 em {
  font-style: normal;
  color: var(--gold);
}

.hero-sub {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--stone);
  font-style: italic;
  max-width: 520px;
  margin-inline: auto;
}

/* live Ogham preview in hero */
.hero-ogham {
  margin: 2.5rem auto 0;
  display: flex;
  justify-content: center;
  min-height: 80px;
  align-items: center;
}

/* ── SECTIONS ── */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section + .section {
  border-top: 1px solid var(--vellum2);
}

.section-label {
  font-family: var(--ff-ui);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 0.6rem;
}

.section h2 {
  font-family: var(--ff-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 1.5rem;
}

.section p {
  max-width: 660px;
  color: var(--ink2);
}

.section p + p { margin-top: 1rem; }

/* ── TRANSLATOR PANEL ── */
.translator-wrap {
  background: var(--panel);
  padding: 3rem 2rem;
}

.translator-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.translator-inner .section-label {
  color: var(--stone);
}

.translator-inner h2 {
  font-family: var(--ff-display);
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--vellum);
  margin-bottom: 2rem;
}

/* input row */
.t-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
}

.t-input {
  flex: 1;
  background: #0e0d0b;
  border: 1px solid #2e2a22;
  border-radius: var(--radius);
  color: #f0ebe0;
  font-family: var(--ff-display);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  padding: 0.85rem 1.1rem;
  outline: none;
  transition: border-color 0.2s;
}

.t-input:focus { border-color: var(--gold); }

.t-input::placeholder {
  font-family: var(--ff-ui);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: #3a3628;
}

.t-btn {
  background: var(--moss);
  border: none;
  border-radius: var(--radius);
  color: var(--vellum);
  cursor: pointer;
  font-family: var(--ff-display);
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  padding: 0.85rem 1.6rem;
  transition: background 0.2s;
}

.t-btn:hover { background: var(--moss2); }

/* direction toggle */
.t-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.t-label {
  font-family: var(--ff-ui);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
}

.t-toggle {
  display: flex;
  border: 1px solid #2e2a22;
  border-radius: var(--radius);
  overflow: hidden;
}

.t-toggle button {
  background: #0e0d0b;
  border: none;
  color: var(--stone);
  cursor: pointer;
  font-family: var(--ff-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 0.45rem 1rem;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}

.t-toggle button.active {
  background: var(--moss);
  color: var(--vellum);
}

/* output */
.t-output {
  background: #0e0d0b;
  border: 1px solid #2e2a22;
  border-radius: var(--radius);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  margin-bottom: 1rem;
}

.t-empty {
  text-align: center;
}

.t-empty-glyph {
  font-size: 2rem;
  color: #2e2a22;
  display: block;
  margin-bottom: 0.5rem;
}

.t-empty-text {
  font-family: var(--ff-ui);
  font-size: 0.78rem;
  color: #3a3628;
  letter-spacing: 0.06em;
}

.t-sub-note {
  font-family: var(--ff-ui);
  font-size: 0.73rem;
  color: var(--stone2);
  letter-spacing: 0.04em;
  min-height: 1.2em;
  margin-bottom: 1rem;
}

.t-sub-note span { color: #8a9e6e; }

.t-export-row {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.t-export-btn {
  background: transparent;
  border: 1px solid #2e2a22;
  border-radius: var(--radius);
  color: var(--stone);
  cursor: pointer;
  font-family: var(--ff-ui);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  padding: 0.45rem 1.1rem;
  text-transform: uppercase;
  transition: border-color 0.2s, color 0.2s;
}

.t-export-btn:hover {
  border-color: var(--gold);
  color: var(--vellum);
}

/* ── ALPHABET GRID (used on alphabet page, preview on index) ── */
.alpha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1px;
  background: var(--vellum2);
  border: 1px solid var(--vellum2);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 2rem;
}

.alpha-cell {
  background: var(--vellum);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: background 0.15s;
  cursor: default;
}

.alpha-cell:hover { background: #ede6d6; }

.alpha-cell .latin {
  font-family: var(--ff-display);
  font-size: 1.4rem;
  color: var(--ink);
  display: block;
  margin-bottom: 0.5rem;
}

.alpha-cell .ogham-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 0.4rem;
}

.alpha-cell .name {
  font-family: var(--ff-ui);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}

/* ── CALLOUT / INFO BOX ── */
.callout {
  background: var(--vellum2);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--stone2);
  font-style: italic;
}

/* ── PAGE GRID (history, stones etc) ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 640px) {
  .two-col { grid-template-columns: 1fr; gap: 2rem; }
  nav { padding: 0 1rem; }
  .nav-links { gap: 1.2rem; }
  .hero { padding: 3rem 1.2rem 2.5rem; }
  .section { padding: 2.5rem 1.2rem; }
  .translator-wrap { padding: 2rem 1.2rem; }
  .t-input-row { flex-direction: column; }
  .t-btn { width: 100%; }
}

/* ── FOOTER ── */
footer {
  background: var(--ink);
  color: var(--stone2);
  text-align: center;
  padding: 2rem;
  font-family: var(--ff-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  border-top: 1px solid #2e2a22;
}

footer a { color: var(--stone); }
footer a:hover { color: var(--vellum); }

/* ── UTILITIES ── */
.gold { color: var(--gold); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
