/* ==========================================================================
   style.css — raretier.com
   Direction B · Field Guide
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. Variables
   --------------------------------------------------------------------------- */
:root{
  /* Colors — 6 + line, no more */
  --bg:      #F3EDDF;
  --surface: #FBF6EA;
  --text:    #23241E;
  --muted:   #6A6759;
  --primary: #2E4A34;
  --accent:  #A2492D;
  --line:    rgb(35 36 30 / .12);

  /* Typefaces — Google Fonts + system fallbacks */
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans:  "Public Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Type scale — 6 tiers, no bare px allowed in page HTML */
  --fs-1:    38px;  --lh-1:    44px;   /* H1 desktop */
  --fs-1-m:  27px;  --lh-1-m:  32px;   /* H1 mobile */
  --fs-2:    24px;  --lh-2:    30px;   /* H2 */
  --fs-3:    20px;  --lh-3:    28px;   /* exit link, game name, H3-ish */
  --fs-4:    17px;  --lh-4:    30px;   /* body */
  --fs-5:    12px;  --lh-5:    16px;   /* small caps labels, table header, step # */
  --fs-note: 14px;  --lh-note: 16px;   /* table notes (only place site-wide) */
  --lh-tight: 24px;                     /* lookup rows only */

  /* Spacing scale — 8 steps, base 4 */
  --space-1:  4px;
  --space-2:  8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;

  /* Layout aliases */
  --edge-desktop: var(--space-8);   /* 72 */
  --edge-mobile:  22px;             /* 390 edge, pinned */
  --gutter:       var(--space-7);   /* 48 column gap */
  --section-gap:  var(--space-8);   /* 72 desktop */
  --section-gap-mobile: var(--space-7); /* 48 mobile */
  --para-gap:     var(--space-4);   /* 16 */
  --row-pad:      var(--space-4);   /* 16 row inner pad */

  /* Stroke & radius */
  --hair:        1px;
  --hair-strong: 2px;
  --radius:      2px;               /* only on table outer frame */

  /* Widths */
  --max-width: 1296px;
}

/* ---------------------------------------------------------------------------
   2. Reset
   --------------------------------------------------------------------------- */
*, *::before, *::after{
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: var(--fs-4);
  line-height: var(--lh-4);
  -webkit-font-smoothing: antialiased;
  min-width: 280px;
}

a{
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover{
  text-decoration-thickness: 2px;
}

ul, ol{ list-style: none; }

/* ---------------------------------------------------------------------------
   3. Layout — header / main / footer
   --------------------------------------------------------------------------- */
.site-header{
  padding: var(--space-2) var(--edge-desktop);
  border-bottom: var(--hair) solid var(--line);
}

.site-main{
  padding: 0 var(--edge-desktop);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.site-footer{
  margin-top: var(--section-gap);
  padding: var(--space-5) var(--edge-desktop) var(--space-8);
  border-top: var(--hair-strong) solid var(--line);
  font-family: var(--sans);
}

/* ---------------------------------------------------------------------------
   4. Site header
   --------------------------------------------------------------------------- */
.header-bar{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand{
  font-family: var(--serif);
  font-weight: 600;
  font-size: var(--fs-3);
  line-height: var(--lh-3);
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand:hover{ color: var(--accent); }

.header-link{
  font-family: var(--sans);
  font-size: var(--fs-5);
  line-height: var(--lh-5);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   5. Anchor nav (mobile only)
   --------------------------------------------------------------------------- */
.anchor-nav{
  display: none;
  gap: var(--space-4);
  padding: var(--space-3) 0 var(--space-2);
  border-bottom: var(--hair) solid var(--line);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.anchor-nav a{
  font-family: var(--sans);
  font-size: var(--fs-5);
  line-height: var(--lh-5);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.anchor-nav a:hover{ color: var(--accent); }

/* ---------------------------------------------------------------------------
   6. Two-column grid
   --------------------------------------------------------------------------- */
.grid-two{
  display: grid;
  gap: var(--gutter);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.col-main{ min-width: 0; }

.col-side{
  min-width: 0;
  padding-top: var(--space-1);
}

/* ---------------------------------------------------------------------------
   7. Section rhythm
   --------------------------------------------------------------------------- */
.section{
  padding-top: var(--section-gap);
}

.section-lead,
.section-intro{
  margin-bottom: var(--space-5);
}

.section-lead p,
.section-intro p{
  margin-bottom: var(--para-gap);
}

.section-lead p:last-child,
.section-intro p:last-child{
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   8. Headings
   --------------------------------------------------------------------------- */
h1, h2, h3{
  font-family: var(--serif);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

h1{
  font-size: var(--fs-1);
  line-height: var(--lh-1);
  margin-bottom: var(--space-5);
}

h2{
  font-size: var(--fs-2);
  line-height: var(--lh-2);
  margin-bottom: var(--space-5);
}

h3{
  font-size: var(--fs-3);
  line-height: var(--lh-3);
  margin-bottom: var(--space-4);
}

/* ---------------------------------------------------------------------------
   9. Lead / intro paragraphs
   --------------------------------------------------------------------------- */
.lead,
.intro{
  font-size: var(--fs-4);
  line-height: var(--lh-4);
  color: var(--text);
  max-width: 36em;
  margin-bottom: var(--space-5);
}

/* ---------------------------------------------------------------------------
   10. Exit link
   --------------------------------------------------------------------------- */
.exit-link{
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-3);
  line-height: var(--lh-3);
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  margin-bottom: var(--para-gap);
}

.exit-link:hover{ text-decoration-thickness: 2px; }

/* ---------------------------------------------------------------------------
   11. Tier table
   --------------------------------------------------------------------------- */
.tier-table-wrap{
  border: var(--hair-strong) solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.tier-table{
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.tier-table thead th{
  font-family: var(--sans);
  font-size: var(--fs-5);
  line-height: var(--lh-5);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  height: 32px;
  padding: 0 var(--space-3);
  text-align: left;
  border-bottom: var(--hair) solid var(--line);
  background: var(--surface);
}

.tier-table thead th.tier-max{
  text-align: right;
  font-family: var(--sans);
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.tier-table tbody td{
  height: 44px;
  padding: 0 var(--space-3);
  border-bottom: var(--hair) solid var(--line);
  vertical-align: middle;
}

.tier-table tbody tr:last-child td{
  border-bottom: none;
}

.tier-table .col-mark{ width: 48px; }
.tier-table .col-code{ width: 52px; }
.tier-table .col-name{
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--fs-4);
  line-height: var(--lh-tight);
  color: var(--text);
}
.tier-table .col-score{
  text-align: right;
  font-family: var(--sans);
  font-size: var(--fs-4);
  line-height: var(--lh-tight);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Rarity tick */
.tick{
  display: inline-flex;
  gap: 2px;
}

.tick-cell{
  width: 5px;
  height: 12px;
  background: var(--line);
}

.tick-cell.is-filled{ background: var(--primary); }

/* ---------------------------------------------------------------------------
   12. Table notes
   --------------------------------------------------------------------------- */
.table-notes{
  margin-bottom: var(--section-gap);
}

.table-note-disclaimer{
  font-family: var(--sans);
  font-size: var(--fs-5);
  line-height: var(--lh-5);
  font-weight: 400;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
}

.table-note-calc{
  font-family: var(--serif);
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  color: var(--muted);
}

/* ---------------------------------------------------------------------------
   13. Steps
   --------------------------------------------------------------------------- */
.steps{
  counter-reset: step;
  padding-left: 28px;
}

.steps li{
  counter-increment: step;
  position: relative;
  margin-bottom: var(--para-gap);
}

.steps li::before{
  content: counter(step) ".";
  position: absolute;
  left: -28px;
  top: 0;
  font-family: var(--sans);
  font-size: var(--fs-5);
  line-height: var(--lh-5);
  font-weight: 600;
  color: var(--primary);
  text-align: right;
  width: 24px;
}

.step-title{
  font-family: var(--serif);
  font-weight: 600;
  font-size: var(--fs-4);
  line-height: var(--lh-tight);
  color: var(--text);
  display: block;
}

.step-body{
  font-family: var(--serif);
  font-size: var(--fs-4);
  line-height: var(--lh-4);
  color: var(--text);
}

/* ---------------------------------------------------------------------------
   14. Lookup
   --------------------------------------------------------------------------- */
.lookup{
  border-top: var(--hair) solid var(--line);
  padding-top: var(--space-4);
}

.lookup-group{
  border-top: var(--hair) solid var(--line);
  padding: var(--space-4) 0;
}

.lookup-row{
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 160px;
  column-gap: var(--space-3);
  padding: var(--space-1) 0;
  align-items: baseline;
}

.lookup-code{
  font-family: var(--sans);
  font-size: var(--fs-5);
  line-height: var(--lh-5);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--primary);
  text-transform: uppercase;
}

.lookup-question{
  font-family: var(--serif);
  font-size: var(--fs-4);
  line-height: var(--lh-tight);
  color: var(--text);
}

.lookup-reason{
  font-family: var(--serif);
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  color: var(--muted);
  text-align: right;
}

.lookup-end{
  grid-template-columns: 40px minmax(0, 1fr);
  border-top: var(--hair) solid var(--line);
  padding-top: var(--space-2);
}

.lookup-end .lookup-code{
  color: var(--accent);
}

.lookup-end .lookup-question{
  font-weight: 500;
}

/* ---------------------------------------------------------------------------
   15. FAQ
   --------------------------------------------------------------------------- */
.faq{ border-top: var(--hair) solid var(--line); }

.faq-item{
  border-bottom: var(--hair) solid var(--line);
}

.faq-item summary{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  cursor: pointer;
  padding: var(--space-3) 0;
  list-style: none;
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--fs-4);
  line-height: var(--lh-4);
  color: var(--text);
}

.faq-item summary::-webkit-details-marker{ display: none; }

.faq-item summary::after{
  content: "+";
  flex-shrink: 0;
  font-family: var(--sans);
  font-size: var(--fs-note);
  font-weight: 600;
  color: var(--primary);
  line-height: 1;
}

.faq-item[open] summary::after{
  content: "−";
}

.faq-answer{
  padding: 0 0 var(--space-4);
  font-family: var(--serif);
  font-size: var(--fs-4);
  line-height: var(--lh-4);
  color: var(--text);
}

.faq-answer p + p{
  margin-top: var(--space-3);
}

/* ---------------------------------------------------------------------------
   16. Games-like entries
   --------------------------------------------------------------------------- */
.game-entry{
  border-top: var(--hair) solid var(--line);
  padding: var(--space-5) 0;
}

.game-entry:last-child{
  border-bottom: var(--hair) solid var(--line);
}

.game-row{
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr) 132px;
  column-gap: var(--space-4);
  align-items: start;
}

.game-name{
  font-family: var(--sans);
  font-size: var(--fs-3);
  line-height: var(--lh-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  padding-top: var(--space-1);
}

.game-body p{
  margin-bottom: var(--para-gap);
}

.game-body p:last-child{
  margin-bottom: 0;
}

.game-body .game-diff{
  font-style: italic;
}

.game-link{
  font-family: var(--sans);
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  text-align: right;
  padding-top: var(--space-1);
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------------------
   17. Prose (about / privacy / contact)
   --------------------------------------------------------------------------- */
.prose p{
  margin-bottom: var(--para-gap);
  max-width: 36em;
}

.prose p:last-child{ margin-bottom: 0; }

.prose .standalone-line{
  font-family: var(--sans);
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  color: var(--muted);
  font-style: italic;
  margin-top: var(--space-5);
}

.contact-link{
  display: inline-block;
  font-family: var(--serif);
  font-size: var(--fs-3);
  line-height: var(--lh-3);
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.contact-link:hover{ text-decoration-thickness: 2px; }

/* ---------------------------------------------------------------------------
   18. CTA / where-to-play
   --------------------------------------------------------------------------- */
.cta-link{
  font-family: var(--serif);
  font-size: var(--fs-4);
  line-height: var(--lh-4);
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.where-play p{
  max-width: 36em;
  margin-bottom: var(--para-gap);
}

.where-play p:last-child{ margin-bottom: 0; }

/* ---------------------------------------------------------------------------
   19. Footer
   --------------------------------------------------------------------------- */
.footer-inner{
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-nav{
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.footer-nav a{
  font-family: var(--sans);
  font-size: var(--fs-5);
  line-height: var(--lh-5);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.footer-nav a:hover{ color: var(--accent); }

.footer-affiliation{
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  color: var(--muted);
  margin-bottom: var(--space-2);
  max-width: 36em;
}

.footer-copy{
  font-family: var(--sans);
  font-size: var(--fs-5);
  line-height: var(--lh-5);
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------------------
   20. Mobile (below 960px)
   --------------------------------------------------------------------------- */
@media (max-width: 959px){
  .site-header,
  .site-main,
  .site-footer{
    padding-left: var(--edge-mobile);
    padding-right: var(--edge-mobile);
  }

  .site-main{ max-width: 640px; }

  .site-footer{ margin-top: var(--section-gap-mobile); }

  .grid-two{ display: block; }
  .col-side{ display: none; }

  .anchor-nav{ display: flex; }

  h1{
    font-size: var(--fs-1-m);
    line-height: var(--lh-1-m);
  }

  .section{ padding-top: var(--section-gap-mobile); }
  .table-notes{ margin-bottom: var(--section-gap-mobile); }

  .lookup-row{
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: var(--space-2);
  }

  .lookup-reason{
    grid-column: 2;
    text-align: left;
    padding-top: var(--space-1);
  }

  .lookup-end{
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .game-row{ display: block; }

  .game-name{
    padding-top: 0;
    margin-bottom: var(--space-2);
  }

  .game-body{ margin-bottom: var(--space-3); }

  .game-link{
    text-align: left;
    padding-top: 0;
  }
}


:focus-visible {
  outline: var(--hair-strong) solid var(--primary);
  outline-offset: var(--hair-strong);
}
