/* ══════════════════════════════════════
   KEYSTONE — style.css
   Minimalist black & white, sans-serif
   ══════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #000; color: #d8d8d8;
  line-height: 1.75; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  caret-color: transparent;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }

/* ══════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════ */
nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: rgba(0,0,0,0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid #1a1a1a;
  padding: 0 1.5rem; height: 48px;
  display: flex; align-items: center; gap: 1.8rem;
  overflow-x: auto; white-space: nowrap;
}
nav .logo {
  font-weight: 700; font-size: 0.85rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: #fff;
  flex-shrink: 0;
}
nav a {
  color: #666; text-decoration: none; font-size: 0.7rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: color 0.2s; flex-shrink: 0;
}
nav a:hover { color: #fff; }

/* ══════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════ */
.section {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center;
  padding: 6rem 2rem 4rem;
  max-width: 780px; margin: 0 auto;
}
.section-short {
  min-height: auto;
  padding: 4rem 2rem 3rem;
  max-width: 780px; margin: 0 auto;
}

/* ── Hero ── */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  padding: 2rem;
  background: linear-gradient(180deg, #000 0%, #0a0a0a 50%, #000 100%);
  background-attachment: fixed;
}
.hero h1 {
  font-size: clamp(3rem, 10vw, 7rem); font-weight: 200;
  letter-spacing: 0.35em; text-transform: uppercase; color: #fff;
}
.hero .subtitle {
  font-size: 0.95rem; color: #666; margin-top: 1.2rem;
  max-width: 540px; letter-spacing: 0.03em;
}

/* ── Parallax Separator ── */
.sep {
  height: 30vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #000 0%, #080808 50%, #000 100%);
  background-attachment: fixed;
  border-top: 1px solid #141414; border-bottom: 1px solid #141414;
  gap: 1rem;
}
.sep .line { width: 50px; height: 1px; background: #333; }
.sep .diamond { width: 7px; height: 7px; background: #444; transform: rotate(45deg); }

/* ══════════════════════════════════════
   TYPOGRAPHY
   ══════════════════════════════════════ */
h2 {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 200;
  letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 2rem; color: #fff;
}
h3 {
  font-size: 1.05rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  margin: 2.5rem 0 0.8rem; color: #ccc;
}
h4 {
  font-size: 0.95rem; font-weight: 700;
  margin: 1.8rem 0 0.6rem; color: #bbb;
}
p { margin-bottom: 1rem; color: #ccc; }
strong { color: #fff; font-weight: 600; }
em { color: #aaa; }
ul, ol { margin: 0.5rem 0 1.5rem 1.3rem; color: #bbb; }
li { margin-bottom: 0.35rem; }
blockquote {
  border-left: 2px solid #333; padding-left: 1rem;
  margin: 1rem 0 1.5rem; color: #999; font-style: italic;
}

/* ══════════════════════════════════════
   TABLES
   ══════════════════════════════════════ */
table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; }
th, td { text-align: left; padding: 0.45rem 0.75rem; border-bottom: 1px solid #1a1a1a; font-size: 0.88rem; }
th { color: #777; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; }
td { color: #ccc; }

/* ══════════════════════════════════════
   STAT BLOCKS (character examples)
   ══════════════════════════════════════ */
.examples-grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 1100px) {
  .examples-grid { grid-template-columns: repeat(3, 1fr); }
  .examples-wide { max-width: 1200px; margin: 0 auto; }
}
@media (min-width: 800px) and (max-width: 1099px) {
  .examples-grid { grid-template-columns: 1fr 1fr; }
  .examples-wide { max-width: 960px; margin: 0 auto; }
}

.stat-block {
  background: #0a0a0a; border: 1px solid #1e1e1e; border-radius: 4px;
  padding: 1.4rem; font-size: 0.88rem;
}
.stat-block .char-name { font-size: 1.2rem; font-weight: 700; color: #fff; margin-bottom: 0.1rem; }
.stat-block .char-occ { color: #777; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.5rem; }
.stat-block .char-ethos { color: #999; font-style: italic; margin-bottom: 1rem; border-left: 2px solid #2a2a2a; padding-left: 0.7rem; font-size: 0.85rem; }
.keystone-entry { margin-bottom: 0.8rem; }
.keystone-entry .ks-head { color: #fff; font-weight: 600; font-size: 0.85rem; }
.keystone-entry .ks-tag { color: #777; font-style: italic; font-size: 0.82rem; }
.keystone-entry ul { margin: 0.2rem 0 0 1.1rem; }
.keystone-entry li { color: #bbb; margin-bottom: 0.1rem; font-size: 0.82rem; }

/* ── Interpretation notes ── */
.interp { margin-top: 1rem; }
.interp dt { color: #fff; font-weight: 600; font-size: 0.85rem; margin-top: 0.8rem; }
.interp dd { color: #aaa; font-size: 0.84rem; margin: 0.15rem 0 0 0; }

/* ── Build notes ── */
.build-note {
  margin-top: 1.2rem; padding: 1rem;
  border: 1px solid #1a1a1a; border-radius: 3px;
  background: #080808; color: #999; font-size: 0.82rem; line-height: 1.6;
}

/* ══════════════════════════════════════
   ROLL EXAMPLES
   ══════════════════════════════════════ */
.rolls-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: 1fr;
  margin: 1.5rem 0;
}
@media (min-width: 1100px) {
  .rolls-grid { grid-template-columns: 1fr 1fr; }
  .rolls-wide { max-width: 1200px; margin: 0 auto; }
}
@media (min-width: 800px) and (max-width: 1099px) {
  .rolls-grid { grid-template-columns: 1fr 1fr; }
  .rolls-wide { max-width: 960px; margin: 0 auto; }
}
.roll-example {
  background: #080808; border: 1px solid #1a1a1a; border-radius: 4px;
  padding: 1.3rem; margin: 0;
}
.roll-example h4 { margin-top: 0; }
.roll-result { font-weight: 600; margin-top: 0.6rem; }
.roll-result.success { color: #ccc; }
.roll-result.fail { color: #777; }

/* ══════════════════════════════════════
   CHARACTER SHEET — Tarot Cards
   ══════════════════════════════════════ */
.sheet-section {
  padding: 5rem 1rem 6rem; max-width: 1200px; margin: 0 auto;
}
.sheet-section > h2 { text-align: center; margin-bottom: 0.5rem; }
.sheet-sub { text-align: center; color: #555; margin-bottom: 2.5rem; font-size: 0.82rem; }

.sheet-controls {
  display: flex; justify-content: center; gap: 0.8rem;
  margin-bottom: 2.5rem; flex-wrap: wrap;
}
.btn {
  background: transparent; border: 1px solid #3a3a3a; color: #aaa;
  padding: 0.45rem 1.1rem; border-radius: 3px; cursor: pointer;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
  font-family: inherit; transition: all 0.2s;
}
.btn:hover { background: #fff; color: #000; border-color: #fff; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem; justify-items: center;
}

/* ── Card flip container ── */
.card-container {
  width: 250px; height: 420px;
  perspective: 900px; cursor: pointer;
}
.card-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.55s ease;
  transform-style: preserve-3d;
}
.card-container.flipped .card-inner { transform: rotateY(180deg); }
.card-front, .card-back {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  backface-visibility: hidden;
  border: 1px solid #2a2a2a; border-radius: 5px; background: #0a0a0a;
  padding: 1.1rem; display: flex; flex-direction: column;
  overflow: hidden;
}
.card-back { transform: rotateY(180deg); background: #070707; }

/* ── Card front elements ── */
.card-label {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.15em;
  color: #444; margin-bottom: 0.2rem;
}
.card-title {
  font-size: 1.1rem; font-weight: 700; color: #fff;
  letter-spacing: 0.03em; margin-bottom: 0.1rem;
}
.card-tagline {
  font-size: 0.78rem; font-style: italic; color: #777;
  margin-bottom: 0.5rem;
}

/* ── d6 pips ── */
.level-pips { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.level-pips .pip-label {
  font-size: 0.6rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: #444; min-width: 28px;
}
.d6-face {
  width: 34px; height: 34px; border: 1px solid #3a3a3a;
  border-radius: 3px; display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 3px; gap: 1px; flex-shrink: 0;
}
.d6-face .dot {
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  background: #1a1a1a;
}
.d6-face .dot.filled { background: #fff; }
.d6-face .dot:nth-child(1) { grid-area: 1/1; }
.d6-face .dot:nth-child(2) { grid-area: 1/2; }
.d6-face .dot:nth-child(3) { grid-area: 1/3; }
.d6-face .dot:nth-child(4) { grid-area: 2/1; }
.d6-face .dot:nth-child(5) { grid-area: 2/2; }
.d6-face .dot:nth-child(6) { grid-area: 2/3; }
.d6-face .dot:nth-child(7) { grid-area: 3/1; }
.d6-face .dot:nth-child(8) { grid-area: 3/2; }
.d6-face .dot:nth-child(9) { grid-area: 3/3; }

/* ── Advancement pips ── */
.advance-pips { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.7rem; }
.advance-pips .pip-label {
  font-size: 0.6rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: #444; min-width: 28px;
}
.advance-pip {
  width: 13px; height: 13px; border: 1px solid #3a3a3a;
  border-radius: 2px; background: #0d0d0d;
  cursor: pointer; transition: background 0.15s;
}
.advance-pip.filled { background: #fff; border-color: #fff; }

/* ── Attribute slots ── */
.attr-slots { flex: 1; display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.2rem; }
.attr-slot {
  border: 1px solid #252525; border-radius: 3px;
  padding: 0.3rem 0.5rem; font-size: 0.75rem; color: #bbb;
  min-height: 26px; background: #0d0d0d;
  display: flex; align-items: center;
}
.attr-slot.empty { border-style: dashed; border-color: #1a1a1a; }

/* ── Card back ── */
.card-back h4 {
  font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: #777; margin: 0 0 0.4rem;
}
.card-back .lore-area {
  flex: 1; border: 1px dashed #1e1e1e; border-radius: 3px;
  padding: 0.7rem; font-size: 0.75rem; color: #888;
  line-height: 1.55; overflow-y: auto;
}
.card-back .lore-area p { margin-bottom: 0.5rem; font-size: 0.75rem; color: #888; }

/* ── Info card (first card) ── */
.card-front.info-card .info-row {
  display: flex; gap: 0.4rem; margin-bottom: 0.35rem; font-size: 0.8rem;
}
.card-front.info-card .info-label {
  color: #444; text-transform: uppercase; font-size: 0.6rem;
  letter-spacing: 0.1em; min-width: 65px; padding-top: 2px;
}
.card-front.info-card .info-value { color: #ccc; }
.card-front.info-card .ethos-block {
  margin-top: 0.7rem; padding: 0.5rem;
  border: 1px solid #1e1e1e; border-radius: 3px;
  font-style: italic; color: #999; font-size: 0.8rem; line-height: 1.5;
}
.card-front.info-card .keystones-list {
  margin-top: auto; font-size: 0.68rem; color: #555;
  border-top: 1px solid #1a1a1a; padding-top: 0.5rem; line-height: 1.7;
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */
footer {
  text-align: center; padding: 3rem 1rem;
  color: #2a2a2a; font-size: 0.7rem; letter-spacing: 0.12em;
  border-top: 1px solid #111;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 600px) {
  .section { padding: 5rem 1.1rem 3rem; }
  .section-short { padding: 3rem 1.1rem 2rem; }
  nav { gap: 1rem; padding: 0 1rem; }
  nav a { font-size: 0.6rem; }
  .card-container { width: 100%; max-width: 290px; height: 440px; }
  .card-grid { grid-template-columns: 1fr; }
  .examples-grid { grid-template-columns: 1fr; }
}
