/* ============================================================
   the.arachnid.archives — style.css
   Base: Win95/98 grey chrome + teal accent (Option 4)
   Framework dropdown: deep blue portal (Option 2)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,700;0,800;1,800;1,900&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --win-bg:       #d4d0c8;
  --win-white:    #ffffff;
  --win-dark:     #808080;
  --win-darker:   #404040;
  --win-black:    #000000;
  --teal:         #1a6b7a;
  --teal-mid:     #2a9aaa;
  --teal-light:   #4abccc;
  --teal-bar:     linear-gradient(90deg, #1a6b7a 0%, #2a9aaa 100%);
  --blue-title:   linear-gradient(90deg, #000080 0%, #1084d0 100%);

  /* deep blue portal (framework) */
  --portal-bg:    #001a4d;
  --portal-mid:   #002266;
  --portal-card:  #001a4d;
  --portal-border:#4488ff;
  --portal-text:  #88ddff;
  --portal-muted: #4488ff;
  --portal-white: #ffffff;

  --radius: 0px;
  --radius-sm: 0px;

  /* bevel helpers */
  --bevel-out: 2px solid #ffffff;
  --bevel-out-dark: 2px solid #808080;
  --bevel-in: 2px solid #808080;
  --bevel-in-light: 2px solid #ffffff;

  /* earthy/botanical (Framework page) */
  --earth-bg:     #e8e0cc;
  --earth-panel:  #f4f0e4;
  --earth-border: #b0a080;
  --earth-green:  #5a6b3a;
  --earth-green-mid: #8a9a5a;
  --earth-green-dark: #2a3010;
  --earth-text:   #3a3320;
  --earth-muted:  #6a7a3a;
}

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

/* ── Body ───────────────────────────────────────────────── */
body {
  font-family: 'Trebuchet MS', 'Arial', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: var(--win-black);
  background: var(--win-bg);
  min-height: 100vh;
}

/* ── Typography ─────────────────────────────────────────── */
h2 {
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: 13px;
  font-weight: bold;
  color: var(--win-black);
  margin-bottom: 0.75rem;
}

h3 {
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: var(--teal);
  margin-bottom: 0.3rem;
}

p { margin-bottom: 0.6rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--teal); text-decoration: underline; }
a:hover { color: var(--teal-mid); }
a.inline { color: var(--teal); }

/* ── HEADER — Win98 chrome ──────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--win-bg);
  border-bottom: 2px solid var(--teal);
}

/* Title bar — teal gradient strip */
.titlebar {
  background: var(--teal-bar);
  padding: 3px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 5px;
}

.titlebar-icon {
  width: 14px;
  height: 14px;
  background: var(--win-bg);
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  display: flex;
  align-items: center;
  justify-content: center;
}

.titlebar-icon-inner {
  width: 6px;
  height: 6px;
  background: var(--teal-mid);
}

.titlebar-title {
  color: white;
  font-size: 11px;
  font-weight: bold;
  font-family: 'Trebuchet MS', Arial, sans-serif;
}

.titlebar-btns {
  display: flex;
  gap: 2px;
}

.titlebar-btn {
  width: 16px;
  height: 14px;
  background: var(--win-bg);
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  font-size: 9px;
  text-align: center;
  line-height: 14px;
  cursor: pointer;
  font-family: Arial, sans-serif;
  color: var(--win-black);
}

.titlebar-btn.close { font-weight: bold; }

/* Logo strip */
.logo-strip {
  background: var(--win-bg);
  padding: 5px 8px;
  border-bottom: 1px solid var(--win-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  height: 44px;
  width: auto;
  display: block;
  /* inset bevel like a sunken panel */
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
}

.logo-fallback {
  font-family: 'Nunito', 'Trebuchet MS', sans-serif;
  font-size: 16px;
  font-weight: 900;
  font-style: italic;
  color: var(--teal);
}

.logo-tag {
  font-size: 10px;
  color: var(--win-dark);
}

/* Menu bar / nav */
.menubar {
  background: var(--win-bg);
  padding: 1px 4px;
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--teal);
}

.menubar a {
  font-size: 11px;
  padding: 3px 10px;
  color: var(--win-black);
  text-decoration: none;
  display: inline-block;
  font-family: 'Trebuchet MS', Arial, sans-serif;
}

.menubar a:hover,
.menubar a:focus {
  background: var(--teal);
  color: white;
  outline: none;
}

/* ── Layout ─────────────────────────────────────────────── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 10px 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Win98 Panel (base card) ────────────────────────────── */
.card, .retro {
  background: var(--win-white);
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  padding: 10px 12px;
  position: relative;
}

/* panel title bar */
.card > h2, .retro > h2 {
  background: var(--teal-bar);
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  margin: -10px -12px 10px -12px;
  letter-spacing: 0.02em;
}

/* ── Today's Pairing ────────────────────────────────────── */
.card-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  display: block;
  background: var(--win-bg);
  /* inset bevel */
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}

.meta { display: flex; flex-direction: column; gap: 4px; }

.sub {
  color: var(--win-dark);
  font-size: 11px;
  margin: 0;
}

/* ── Reveal ─────────────────────────────────────────────── */
.reveal-area { margin-top: 8px; }

.revealed {
  margin-top: 8px;
  background: #f0f4f8;
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  padding: 8px 10px;
  font-size: 12px;
  color: #333;
}

.revealed.hidden { display: none; }

/* ── Button — Win98 style ───────────────────────────────── */
.btn {
  display: inline-block;
  padding: 4px 14px;
  background: var(--win-bg);
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid var(--win-dark);
  border-bottom: 2px solid var(--win-dark);
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: var(--win-black);
  cursor: pointer;
  min-width: 80px;
  text-align: center;
}

.btn:hover { background: #c8c4bc; }
.btn:active {
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  padding: 5px 13px 3px 15px;
}

/* ── Framework — DROPDOWN ───────────────────────────────── */
.framework-toggle {
  width: 100%;
  background: var(--win-bg);
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid var(--win-dark);
  border-bottom: 2px solid var(--win-dark);
  padding: 4px 10px;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: var(--win-black);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.framework-toggle:hover { background: #c8c4bc; }
.framework-toggle:active {
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}

.framework-arrow {
  font-size: 10px;
  transition: transform 0.2s;
  display: inline-block;
}

.framework-arrow.open { transform: rotate(90deg); }

/* The blue portal dropdown */
.framework-portal {
  display: none;
  background: var(--portal-bg);
  border: 2px solid var(--portal-border);
  border-top: none;
  padding: 12px;
  box-shadow: inset 0 0 30px rgba(0,30,100,0.5);
}

.framework-portal.open { display: block; }

/* portal header label */
.portal-label {
  font-size: 10px;
  color: var(--portal-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-family: 'Trebuchet MS', Arial, sans-serif;
}

/* portal table */
.framework-portal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.framework-portal thead tr {
  background: rgba(0,50,150,0.6);
  border-bottom: 1px solid var(--portal-border);
}

.framework-portal th {
  text-align: left;
  padding: 5px 8px;
  color: var(--portal-text);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: bold;
  font-family: 'Trebuchet MS', Arial, sans-serif;
}

.framework-portal td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(68,136,255,0.2);
  vertical-align: top;
  color: rgba(200,230,255,0.9);
}

.framework-portal tbody tr:hover td {
  background: rgba(68,136,255,0.12);
}

.framework-portal td:first-child {
  color: var(--portal-text);
  font-weight: bold;
  white-space: nowrap;
  font-style: italic;
}

.framework-portal td:nth-child(2) {
  color: #88bbff;
  font-weight: bold;
  white-space: nowrap;
}

.portal-note {
  font-size: 10px;
  color: var(--portal-muted);
  margin-top: 8px;
  font-family: 'Trebuchet MS', Arial, sans-serif;
}

/* ── Archive List ───────────────────────────────────────── */
.archive {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.archive li {
  padding: 4px 8px;
  background: var(--win-bg);
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid var(--win-dark);
  border-bottom: 1px solid var(--win-dark);
  font-size: 11px;
  cursor: pointer;
  color: var(--win-black);
  font-family: 'Trebuchet MS', Arial, sans-serif;
}

.archive li:hover {
  background: var(--teal);
  color: white;
  border-color: var(--teal-mid);
}

/* ── Mission ────────────────────────────────────────────── */
section#mission ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}

section#mission li {
  padding: 6px 8px 6px 10px;
  background: var(--win-bg);
  border-left: 3px solid var(--teal);
  border-top: 1px solid var(--win-dark);
  border-bottom: 1px solid #fff;
  font-size: 12px;
}

section#mission li strong { color: var(--teal); }

/* ── Status bar footer ──────────────────────────────────── */
footer {
  background: var(--win-bg);
  border-top: 2px solid var(--teal);
  padding: 3px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--win-darker);
  font-family: 'Trebuchet MS', Arial, sans-serif;
}

.status-panel {
  border-top: 1px solid var(--win-dark);
  border-left: 1px solid var(--win-dark);
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  padding: 1px 8px;
  font-size: 10px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .card-inner { grid-template-columns: 1fr; }
  .thumb { width: 100%; height: 140px; }
  .container { padding: 8px 6px 30px; }
  .titlebar-title { font-size: 10px; }
  .logo-img { height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .framework-arrow { transition: none !important; }
}

/* ============================================================
   SHARED — secondary nav (used on inner pages, same titlebar)
   ============================================================ */
.menubar a.active {
  background: var(--teal);
  color: white;
}

/* "see more" link on homepage cards */
.see-more {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--teal);
}

/* Rationale button (Today's Pairing) */
.rationale-btn {
  margin-top: 8px;
}

.rationale-box {
  margin-top: 8px;
  background: #eef2ee;
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  padding: 8px 10px;
  font-size: 12px;
  color: #2a3010;
}
.rationale-box.hidden { display: none; }

/* reveal fade-in for images */
.thumb.is-hidden {
  filter: blur(8px) grayscale(1);
  opacity: 0.5;
  transition: filter 0.5s ease, opacity 0.5s ease;
}
.thumb.is-revealed {
  filter: blur(0) grayscale(0);
  opacity: 1;
  transition: filter 0.5s ease, opacity 0.5s ease;
}

/* ============================================================
   PAGE THEME — Earthy / Botanical (Framework page)
   ============================================================ */
body.theme-earth {
  background: var(--earth-bg);
  color: var(--earth-text);
}

.earth-titlebar {
  background: var(--earth-green);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--earth-green-mid);
}

.earth-titlebar .logo-img {
  height: 44px;
  border-top: 2px solid var(--earth-green-dark);
  border-left: 2px solid var(--earth-green-dark);
  border-right: 2px solid #cdd8a8;
  border-bottom: 2px solid #cdd8a8;
}

.earth-menubar {
  display: flex;
  gap: 0;
}

.earth-menubar a {
  font-size: 11px;
  background: var(--earth-green-mid);
  color: #fff;
  padding: 5px 12px;
  border: 1px solid var(--earth-green-dark);
  text-decoration: none;
  font-family: 'Trebuchet MS', Arial, sans-serif;
}

.earth-menubar a:hover,
.earth-menubar a.active {
  background: var(--earth-green-dark);
}

.earth-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 12px 50px;
}

.earth-panel {
  background: var(--earth-panel);
  border: 1px solid var(--earth-border);
  border-top: 3px solid var(--earth-green-mid);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.earth-panel h1 {
  font-size: 20px;
  color: var(--earth-green-dark);
  font-family: 'Trebuchet MS', Arial, sans-serif;
  margin-bottom: 4px;
}

.earth-panel h2 {
  font-size: 14px;
  color: var(--earth-green-dark);
  font-family: 'Trebuchet MS', Arial, sans-serif;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--earth-border);
}

.earth-panel p {
  font-size: 12.5px;
  margin-bottom: 8px;
  color: var(--earth-text);
}

.earth-sub {
  font-size: 11px;
  color: var(--earth-muted);
  margin-bottom: 10px;
}

.earth-entry {
  background: #fbf8ee;
  border: 1px solid var(--earth-border);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.earth-entry-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.earth-order {
  font-weight: bold;
  font-style: italic;
  color: var(--earth-green-dark);
  font-size: 13px;
}

.earth-genre {
  font-size: 11px;
  background: var(--earth-green-mid);
  color: #fff;
  padding: 1px 8px;
}

.earth-entry ul {
  list-style: disc;
  margin-left: 18px;
  font-size: 12px;
  color: var(--earth-text);
}

.earth-entry li { margin-bottom: 2px; }

.earth-footer {
  text-align: center;
  font-size: 10px;
  color: var(--earth-muted);
  padding: 10px;
  border-top: 1px solid var(--earth-border);
}

/* ============================================================
   PAGE THEME — Deep Blue / Millennium (Archive page)
   ============================================================ */
body.theme-portal {
  background: var(--portal-bg);
  color: #cfe6ff;
}

.portal-titlebar {
  background: var(--blue-title);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--portal-border);
}

.portal-titlebar .logo-img {
  height: 44px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(100,150,255,0.4);
}

.portal-menubar {
  display: flex;
  gap: 16px;
}

.portal-menubar a {
  font-size: 11px;
  color: #88bbff;
  text-decoration: underline;
}

.portal-menubar a:hover,
.portal-menubar a.active {
  color: #ffffff;
}

.portal-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 12px 50px;
}

.portal-page-panel {
  background: rgba(0,30,100,0.55);
  border: 1px solid var(--portal-border);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.portal-page-panel h1 {
  font-size: 19px;
  color: #ffffff;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  margin-bottom: 4px;
}

.portal-page-panel h2 {
  font-size: 13px;
  color: var(--portal-text);
  font-family: 'Trebuchet MS', Arial, sans-serif;
  margin-bottom: 6px;
}

.portal-page-panel p {
  font-size: 12px;
  color: #aaccff;
  margin-bottom: 8px;
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.archive-table thead tr {
  background: rgba(0,50,150,0.7);
  border-bottom: 1px solid var(--portal-border);
}

.archive-table th {
  text-align: left;
  padding: 6px 10px;
  color: var(--portal-text);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.archive-table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(68,136,255,0.2);
  color: #cfe6ff;
}

.archive-table tbody tr:hover td {
  background: rgba(68,136,255,0.12);
}

.archive-table td.col-date {
  color: #88bbff;
  white-space: nowrap;
  font-family: 'Trebuchet MS', Arial, sans-serif;
}

.portal-footer {
  text-align: center;
  font-size: 10px;
  color: var(--portal-muted);
  padding: 10px;
  border-top: 1px solid rgba(68,136,255,0.3);
}

/* ============================================================
   PAGE THEME — Win95 grey + teal (Request Form page)
   reuses base Win98 tokens already defined above
   ============================================================ */
.form-panel {
  background: var(--win-white);
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  padding: 14px;
  max-width: 480px;
  margin: 16px auto;
}

.form-panel h1 {
  background: var(--teal-bar);
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  margin: -14px -14px 14px -14px;
}

.form-row {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.form-row label {
  font-size: 11px;
  font-weight: bold;
  color: var(--win-black);
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row textarea,
.form-row select {
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: 12px;
  padding: 4px 6px;
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  background: #fff;
}

.form-row textarea { resize: vertical; min-height: 70px; }

.form-row.radio-group {
  flex-direction: row;
  gap: 14px;
  align-items: center;
}

.form-row.radio-group label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: normal;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.form-note {
  font-size: 10px;
  color: var(--win-dark);
  margin-top: 10px;
  border-top: 1px solid var(--win-dark);
  padding-top: 8px;
}

/* ============================================================
   ABOUT PAGE — uses base Win98 chrome, adds qualifications accordion
   ============================================================ */
.qual-toggle {
  width: 100%;
  background: var(--win-bg);
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid var(--win-dark);
  border-bottom: 2px solid var(--win-dark);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: bold;
  text-align: left;
  cursor: pointer;
  margin-bottom: 2px;
}

.qual-toggle:hover { background: #c8c4bc; }

.qual-body {
  display: none;
  background: #f0f4f0;
  border-top: 1px solid var(--win-dark);
  border-left: 1px solid var(--win-dark);
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  padding: 10px 12px;
  margin-bottom: 6px;
  font-size: 12px;
}

.qual-body.open { display: block; }

.qual-sub-toggle {
  width: 100%;
  background: var(--teal);
  color: white;
  border: none;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: bold;
  text-align: left;
  cursor: pointer;
  margin-bottom: 2px;
  margin-top: 6px;
}

.qual-sub-toggle:first-child { margin-top: 0; }
.qual-sub-toggle:hover { background: var(--teal-mid); }

.qual-sub-body {
  display: none;
  background: #fff;
  border: 1px solid #ccc;
  padding: 8px 10px;
  margin-bottom: 4px;
  font-size: 12px;
}

.qual-sub-body.open { display: block; }
