/* ═══════════════════════════════════════════════
   INTROVERT READING SOCIETY — SHARED STYLESHEET
   Department of Solitary Enrichment
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=IM+Fell+English:ital@0;1&display=swap');

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

/* ── TOKENS ── */
:root {
  --navy:      #1d3461;
  --navy-dark: #162850;
  --ink:       #1a1a18;
  --muted:     #888070;
  --rule:      #d8d4c8;
  --hover-bg:  #f7f5f0;
  --active-bg: #f0f3f8;
  --error:     #8b2020;
  --cream:     #f5f2e8;

  /* Type scale */
  --text-xs:   10px;
  --text-sm:   12px;
  --text-base: 14px;
  --text-md:   16px;
  --text-lg:   20px;
  --text-xl:   24px;
  --text-2xl:  32px;

  /* Spacing */
  --gap-xs:  6px;
  --gap-sm:  12px;
  --gap-md:  1.5rem;
  --gap-lg:  2.5rem;
  --gap-xl:  3rem;
}

/* ── BASE ── */
html, body { height: 100%; }

body {
  background: #ffffff;
  color: var(--ink);
  font-family: 'Courier Prime', monospace;
  font-size: var(--text-base);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── ANIMATIONS ── */
@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade { opacity: 0; animation: fadein 0.8s ease forwards; }
.fade-1 { animation-delay: 0.1s; }
.fade-2 { animation-delay: 0.2s; }
.fade-3 { animation-delay: 0.4s; }
.fade-4 { animation-delay: 0.6s; }
.fade-5 { animation-delay: 0.8s; }

/* ── HEADER ── */
.site-header {
  padding: 1.25rem 2rem;
  border-bottom: 0.5px solid var(--rule);
  flex-shrink: 0;
}

.site-header a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.site-header img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.header-text { display: flex; flex-direction: column; gap: 2px; }

.header-name {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--navy);
}

.header-sub {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── FOOTER ── */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  color: #ccc8bc;
  text-transform: uppercase;
  border-top: 0.5px solid var(--rule);
  flex-shrink: 0;
  margin-top: auto;
}

.site-footer a { text-decoration: none; color: inherit; }

/* ── EYEBROW LABEL ── */
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: var(--gap-md);
}

/* ── CENTERED MAIN (single-column pages) ── */
.main-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--gap-xl) 2rem;
}

/* ── PAGE TITLE ── */
.page-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.03em;
  margin-bottom: var(--gap-lg);
  line-height: 1.2;
}

/* ── FORM FIELDS ── */
.field { margin-bottom: 1.25rem; }

.field label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  font-family: 'Courier Prime', monospace;
  font-size: var(--text-base);
  color: var(--ink);
  background: #ffffff;
  border: 0.5px solid var(--rule);
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.15s;
  border-radius: 0;
  appearance: none;
}

.field input:focus,
.field select:focus { border-color: var(--navy); }

.field input::placeholder { color: #ccc8bc; }

.field-row-3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--gap-sm);
}

.section-divider {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 0.5px solid var(--rule);
  padding-top: 1.25rem;
  margin: 1.75rem 0 1.25rem;
}

/* ── BUTTONS ── */
.btn {
  display: block;
  width: 100%;
  font-family: 'Courier Prime', monospace;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px 20px;
  cursor: pointer;
  text-align: center;
  border: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-primary {
  color: #ffffff;
  background: var(--navy);
}

.btn-primary:hover { background: var(--navy-dark); }

.btn-outline {
  color: var(--navy);
  background: #ffffff;
  border: 1px solid var(--navy);
}

.btn-outline:hover {
  background: var(--navy);
  color: #ffffff;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── FINE PRINT ── */
.fine-print {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.8;
  margin-top: 1rem;
  text-align: center;
}

/* ── PRICE OPTIONS (radio) ── */
.price-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: var(--gap-lg);
  flex: 1;
}

.price-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0.5px solid var(--rule);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.price-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.price-option:has(input:checked) {
  border-color: var(--navy);
  background: var(--active-bg);
}

.price-option:hover { border-color: #aaa; }

.radio-dot {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.price-option:has(input:checked) .radio-dot {
  border-color: var(--navy);
  background: var(--navy);
}

.price-option:has(input:checked) .radio-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: white;
}

.price-amount {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--ink);
}

.price-period {
  font-size: var(--text-xs);
  color: var(--muted);
  letter-spacing: 0.05em;
}

.price-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  border: 0.5px solid var(--navy);
  padding: 3px 10px;
  margin-bottom: var(--gap-md);
}

/* ── ORDER SUMMARY ── */
.summary {
  width: 260px;
  flex-shrink: 0;
}

.summary-box {
  border: 0.5px solid var(--rule);
  padding: 1.5rem;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 0.5px solid var(--rule);
}

.summary-item:first-child { padding-top: 0; }
.summary-item:last-child { border-bottom: none; padding-bottom: 0; }

.summary-item-name {
  font-size: var(--text-sm);
  color: var(--ink);
  line-height: 1.5;
}

.summary-item-sub {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.summary-item-price {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}

.summary-note {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 1.25rem;
}

/* ── ERROR MESSAGES ── */
.error-msg {
  font-size: 10px;
  color: var(--error);
  letter-spacing: 0.05em;
  margin-top: 6px;
  display: none;
}

.error-msg.visible { display: block; }

/* ── TOGGLE FIELD (anonymous) ── */
.toggle-field { margin-bottom: 1.25rem; }

.toggle-label-text {
  display: block;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.toggle-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border: 0.5px solid var(--rule);
}

.toggle-option {
  background: #fff;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.toggle-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-option:has(input:checked) { background: var(--active-bg); }

.toggle-option-text {
  font-size: var(--text-sm);
  color: var(--ink);
  line-height: 1.4;
}

.toggle-option-sub {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.gifter-name-field { transition: opacity 0.2s; }
.gifter-name-field.hidden { opacity: 0; pointer-events: none; height: 0; overflow: hidden; margin: 0; }

/* ── SUCCESS / CONFIRMATION BOX ── */
.confirm-box {
  border: 0.5px solid var(--rule);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.confirm-case {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.confirm-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.5rem;
}

.confirm-rule {
  border: none;
  border-top: 0.5px solid var(--rule);
  margin: 1rem 0;
}

.confirm-row {
  font-size: var(--text-sm);
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  line-height: 1.9;
}

.confirm-row-label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.confirm-closing {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.9;
  margin-top: 1.5rem;
}

.confirm-sig { margin-top: 1.5rem; }
.confirm-sig p { font-size: var(--text-sm); color: var(--muted); line-height: 1.9; }
.confirm-sig .sig-name { font-size: var(--text-md); font-weight: 700; color: var(--navy); margin-top: 4px; }
.confirm-sig .sig-dept { font-size: 10px; color: var(--muted); margin-top: 2px; letter-spacing: 0.05em; }

/* ── CARD NOTE ── */
.card-note {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: var(--gap-lg);
}

/* ── UTILITY ── */
.hidden { display: none !important; }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .field-row-3 { grid-template-columns: 1fr 1fr; }
  .field-row-3 .field:first-child { grid-column: 1 / -1; }
  .summary { width: 100%; }
}

@media (max-width: 520px) {
  :root { --text-xl: 20px; }
  .site-header { padding: 1rem; }
}
