/* =================================================================
   Road to Masters — shared stylesheet
   Colors: evergreen + brass + ivory. Plain system sans (Calibri/Segoe UI/Arial).
   ================================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Palette */
  --ink:        #1c211d;   /* primary text */
  --ink-soft:   #4a534c;   /* secondary text */
  --paper:      #fbf9f4;   /* page background */
  --ivory:      #efe9db;   /* light board square / surfaces */
  --ivory-line: #e2dccd;   /* hairlines on ivory */
  --forest:     #14261d;   /* deep field: hero, header, footer */
  --forest-2:   #1d3529;   /* raised surfaces on forest */
  --brass:      #826423;   /* accent — "masters" gold (AA on ivory/paper/white) */
  --brass-lit:  #cba24a;   /* accent on dark */
  --danger:     #8a3b2e;   /* deadlines / important notes */

  /* Placeholder highlight */
  --tbd-bg:     #fbeccb;
  --tbd-border: #d9a93a;
  --tbd-text:   #6b4e12;

  /* Type — plain system sans throughout */
  --font-display: Calibri, "Segoe UI", Arial, Helvetica, sans-serif;
  --font-body:    Calibri, "Segoe UI", Arial, Helvetica, sans-serif;
  --font-mono:    Calibri, "Segoe UI", Arial, Helvetica, sans-serif;

  /* Rhythm */
  --wrap: 1080px;
  --wrap-narrow: 760px;
  --gap: clamp(1rem, 2.5vw, 1.75rem);
  --section-y: clamp(2.75rem, 5.5vw, 4.5rem);
  --radius: 4px;
  --shadow: 0 1px 2px rgba(20,38,29,.06), 0 8px 28px rgba(20,38,29,.07);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 1.02rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.08; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Layout helpers ---------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, var(--wrap-narrow)); margin-inline: auto; }
.section { padding-block: var(--section-y); }
.section--ivory { background: var(--ivory); border-block: 1px solid var(--ivory-line); }

/* Two-column splits (collapse to one column on narrow screens) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
.split-wide { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
.split-feature { display: grid; grid-template-columns: 1.3fr .9fr; gap: 2rem; align-items: center; }
@media (max-width: 780px) {
  .split, .split-wide, .split-feature { grid-template-columns: 1fr; }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 500;
  margin-bottom: 1rem;
}
.eyebrow--light { color: var(--brass-lit); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -.01em;
  font-optical-sizing: auto;
}
.lede {
  font-size: clamp(1.05rem, 2.3vw, 1.22rem);
  color: var(--ink-soft);
  max-width: 60ch;
  margin-top: 1rem;
}

/* Mono = the "scoresheet" data thread */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Placeholder / to-confirm marker ---------- */
.tbd {
  font-family: var(--font-mono);
  font-size: .82em;
  background: var(--tbd-bg);
  color: var(--tbd-text);
  border: 1px dashed var(--tbd-border);
  border-radius: 3px;
  padding: .08em .45em;
  white-space: nowrap;
}
.tbd::before { content: "\270e\00a0"; } /* pencil */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 500;
  text-decoration: none;
  padding: .85rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--brass); color: #ffffff !important; text-decoration: none; }
.btn--primary:hover { background: #6b511c; color: #ffffff !important; }
.btn--ghost { background: transparent; color: var(--forest); border-color: rgba(20,38,29,.25); text-decoration: none; }
.btn--ghost:hover { border-color: var(--forest); color: var(--forest); }
.btn--on-dark { background: var(--brass-lit); color: var(--forest); }
.btn--on-dark:hover { background: #dbb45c; }
.btn--ghost-dark { background: transparent; color: var(--ivory); border-color: rgba(239,233,219,.35); }
.btn--ghost-dark:hover { border-color: var(--ivory); }
.btn--lg { padding: 1.05rem 2.1rem; font-size: .95rem; }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--forest);
  color: var(--ivory);
  border-bottom: 1px solid rgba(203,162,74,.22);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: var(--ivory);
}
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1;
}
.brand-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--brass-lit);
  margin-top: .28rem;
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(239,233,219,.3);
  border-radius: var(--radius);
  color: var(--ivory);
  padding: .45rem .6rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.nav {
  display: flex;
  align-items: center;
  gap: 1.9rem;
}
.nav a {
  text-decoration: none;
  color: var(--ivory);
  font-size: .92rem;
  letter-spacing: .01em;
  opacity: .85;
  transition: opacity .15s ease, color .15s ease;
}
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; color: var(--brass-lit); }
.nav a[aria-current="page"] { font-weight: 600; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--forest);
    border-bottom: 1px solid rgba(203,162,74,.22);
    padding: .5rem 0 1rem;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: .85rem 1.25rem; width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; opacity: .95; }
  .nav a + a { border-top: 1px solid rgba(239,233,219,.08); }
}

/* ---------- Hero (shared base) ---------- */
.hero {
  position: relative;
  background: var(--forest);
  color: var(--ivory);
  overflow: hidden;
}
.hero > .wrap { position: relative; z-index: 1; }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--ivory-line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2rem);
  box-shadow: var(--shadow);
}

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 460px;
}
table.data caption { text-align: left; color: var(--ink-soft); font-size: .9rem; margin-bottom: .75rem; }
table.data th, table.data td {
  text-align: left;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--ivory-line);
  vertical-align: baseline;
}
table.data thead th {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.round-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--forest);
  background: var(--ivory);
  border: 1px solid var(--ivory-line);
  border-radius: 3px;
  padding: .1rem .5rem;
  font-size: .82rem;
}

/* ---------- Definition rows (format/eligibility) ---------- */
.spec-list { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.spec {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 1.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--ivory-line);
}
.spec:last-child { border-bottom: 0; padding-bottom: 0; }
.spec dt {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brass);
  padding-top: .15rem;
}
.spec dd { color: var(--ink); }
.spec dd small { display: block; color: var(--ink-soft); margin-top: .3rem; }
@media (max-width: 620px) {
  .spec { grid-template-columns: 1fr; gap: .35rem; }
}

/* ---------- Fee / price ---------- */
.fee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
  margin-top: 2rem;
}
.fee {
  border: 1px solid var(--ivory-line);
  border-radius: var(--radius);
  background: #fff;
  padding: 1.5rem;
}
.fee.is-early { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass); }
.fee .fee-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.fee .fee-amount {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 600;
  margin: .3rem 0 .15rem;
}
.fee .fee-note { font-size: .88rem; color: var(--ink-soft); }
.fee .fee-flag {
  display: inline-block;
  margin-bottom: .6rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brass);
}
.addons { margin-top: 1.75rem; display: grid; gap: .6rem; }
.addon {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .75rem 1rem;
  background: #fff;
  border: 1px solid var(--ivory-line);
  border-radius: var(--radius);
}
.addon .addon-price { font-family: var(--font-mono); font-weight: 700; color: var(--brass); }

/* Deadline pill */
.deadline {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--danger);
  background: #f7e7e3;
  border: 1px solid #e3bcb2;
  border-radius: 999px;
  padding: .35rem .85rem;
}

/* ---------- Register block ---------- */
.register {
  background: var(--forest);
  color: var(--ivory);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.75rem);
}
.register h3 { font-family: var(--font-display); font-size: 1.7rem; }
.etransfer {
  margin-top: 1.5rem;
  border-top: 1px solid rgba(239,233,219,.16);
  padding-top: 1.25rem;
  font-size: .95rem;
  color: rgba(239,233,219,.85);
}
.etransfer .kv { font-family: var(--font-mono); color: var(--brass-lit); }

/* ---------- Sub-nav (tournament page) ---------- */
.subnav {
  position: sticky;
  top: 68px;
  z-index: 40;
  background: rgba(251,249,244,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ivory-line);
}
.subnav .wrap { display: flex; gap: .25rem; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.subnav .wrap::-webkit-scrollbar { display: none; }
.subnav a {
  flex: none;
  text-decoration: none;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .95rem .85rem;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.subnav a:hover { color: var(--ink); }
.subnav a.active { color: var(--forest); border-bottom-color: var(--brass); }
/* offset anchors so sticky bars don't cover headings */
.anchor { scroll-margin-top: 130px; }

/* ---------- Callout ---------- */
.callout {
  border-left: 3px solid var(--brass);
  background: var(--ivory);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.35rem;
  margin-top: 1.5rem;
}
.callout p { color: var(--ink); font-size: .96rem; }
.callout a { color: var(--brass); font-weight: 600; }

/* ---------- Prose ---------- */
.prose p { margin-top: 1rem; color: var(--ink-soft); max-width: 68ch; }
.prose p:first-child { margin-top: 0; }
.prose a:not(.btn) { color: var(--brass); text-decoration: underline; text-underline-offset: 2px; }
.prose ul { margin-top: 1rem; padding-left: 1.2rem; color: var(--ink-soft); max-width: 68ch; }
.prose li { margin-top: .4rem; }
.prose h2, .prose h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-top: 2rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--forest);
  color: rgba(239,233,219,.8);
  padding-block: 3.25rem 2rem;
  margin-top: var(--section-y);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--gap);
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(239,233,219,.14);
}
.footer-brand .brand-name { color: var(--ivory); font-size: 1.35rem; }
.footer-brand p { margin-top: .85rem; font-size: .92rem; max-width: 34ch; }
.footer-col h2 {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brass-lit);
  margin-bottom: 1rem;
  font-weight: 500;
}
.footer-col a { display: block; text-decoration: none; color: rgba(239,233,219,.8); font-size: .92rem; padding: .2rem 0; }
.footer-col a:hover { color: var(--brass-lit); }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: rgba(239,233,219,.55);
}
@media (max-width: 680px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--brass);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .85rem;
  padding: .75rem 1.25rem;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Focus visibility ---------- */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--brass-lit);
  outline-offset: 3px;
  border-radius: 2px;
}
.hero a:focus-visible, .site-header a:focus-visible, .site-footer a:focus-visible {
  outline-color: var(--brass-lit);
}
