/* === Variables === */
:root {
  --cream: #f6f1e9;
  --cream-mid: #e8e0d4;
  --cream-dark: #d8cfc1;
  --ink: #1a1410;
  --ink-muted: #5c4f43;
  --navy: #0f2540;
  --gold: #a87c0a;
  --surface: #fdfaf5;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'EB Garamond', Garamond, Georgia, serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--cream);
}

/* === Layout === */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 40px 64px;
}

/* === Header === */
header {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--cream-mid);
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.1s forwards;
}

.header-inner {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.header-bracket-motif {
  flex-shrink: 0;
  width: 56px;
  color: var(--gold);
  padding-top: 4px;
}

.header-bracket-motif svg {
  width: 100%;
  height: auto;
}

.header-kicker {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.header-text h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 22px;
  letter-spacing: -0.02em;
}

.header-subtitle {
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--ink-muted);
  font-style: italic;
  max-width: 500px;
}

/* === Section headers === */
.section-header {
  margin-bottom: 36px;
  border-bottom: 1px solid var(--cream-mid);
  padding-bottom: 14px;
}

.section-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* === How it works === */
.how-it-works {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--cream-mid);
  margin-bottom: 72px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.25s forwards;
}

.hiw-item {
  padding: 36px 32px 36px 0;
  border-right: 1px solid var(--cream-mid);
  padding-right: 32px;
}

.hiw-item:first-child {
  padding-left: 0;
}

.hiw-item:last-child {
  border-right: none;
  padding-right: 0;
  padding-left: 32px;
}

.hiw-item:nth-child(2) {
  padding-left: 32px;
}

.hiw-num {
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 12px;
}

.hiw-item h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.hiw-item p {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* === Granularity === */
.granularity {
  margin-bottom: 72px;
  padding-bottom: 72px;
  border-bottom: 1px solid var(--cream-mid);
  opacity: 0;
  animation: fadeUp 0.8s ease 0.28s forwards;
}

.granularity-tagline {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink-muted);
  font-style: italic;
  text-align: center;
  margin-bottom: 36px;
}

.granularity-levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border: 1px solid var(--cream-mid);
  border-radius: 3px;
}

.level-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 12px 22px;
  border-right: 1px solid var(--cream-mid);
  color: var(--gold);
}

.level-item:last-child {
  border-right: none;
}

.level-svg {
  width: 48px;
  height: auto;
  margin-bottom: 14px;
}

.level-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* === Notify (home-page animation override) === */
.notify {
  opacity: 0;
  animation: fadeUp 0.8s ease 0.45s forwards;
}

/* === Visualizations === */
.visualizations {
  margin-bottom: 80px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.3s forwards;
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.viz-card {
  display: flex;
  flex-direction: column;
  padding: 28px 32px 24px;
  background: var(--surface);
  border: 1px solid var(--cream-mid);
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(26, 20, 16, 0.07);
  position: relative;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.viz-card:hover {
  box-shadow: 0 8px 28px rgba(26, 20, 16, 0.14);
  transform: translateY(-3px);
  border-color: var(--gold);
}

.viz-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.viz-card:hover h3 {
  color: var(--gold);
}

.viz-card p {
  font-family: var(--font-body);
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 20px;
  flex: 1;
}

.viz-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 2px;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-style: italic;
  letter-spacing: 0.03em;
  text-decoration: none;
  align-self: flex-start;
  transition: background 0.18s ease, color 0.18s ease, gap 0.18s ease;
}

.viz-link::after {
  content: '→';
  font-style: normal;
  display: inline-block;
  transition: transform 0.18s ease;
}

.viz-card:hover .viz-link {
  background: var(--gold);
  color: var(--surface);
  gap: 9px;
}

.viz-card:hover .viz-link::after {
  transform: translateX(2px);
}

/* === About === */
.about {
  margin-bottom: 72px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.5s forwards;
}

.about-body p {
  font-family: var(--font-body);
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--ink);
  margin-bottom: 28px;
}

/* Drop cap */
.drop-cap::first-letter {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  float: left;
  line-height: 0.8;
  margin-right: 7px;
  margin-top: 8px;
  color: var(--gold);
}

/* Photo gallery */
.photo-gallery {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin: 8px 0 14px;
  flex-wrap: wrap;
}

.photo-gallery img {
  width: 220px;
  height: auto;
  border: 5px solid var(--surface);
  box-shadow: 0 4px 18px rgba(26, 20, 16, 0.16);
  border-radius: 1px;
  object-fit: cover;
  cursor: zoom-in;
  transition: box-shadow 0.25s ease;
}

.photo-gallery img:hover {
  box-shadow: 0 10px 32px rgba(26, 20, 16, 0.26);
}

.photo-gallery img:nth-child(1) { transform: rotate(-1.5deg); }
.photo-gallery img:nth-child(2) { transform: rotate(0.8deg); }
.photo-gallery img:nth-child(3) { transform: rotate(-0.6deg); }

.gallery-caption {
  display: block;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.8rem !important;
  color: var(--cream-dark) !important;
  font-style: italic;
  margin-top: 0 !important;
  margin-bottom: 32px !important;
}

/* Features */
.features {
  border-left: 2px solid var(--gold);
  padding-left: 28px;
  margin-top: 4px;
}

.features h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 16px;
}

.features ul {
  list-style: none;
  padding: 0;
}

.features li {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 5px 0;
  padding-left: 22px;
  position: relative;
  color: var(--ink-muted);
  line-height: 1.55;
}

.features li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold);
}

/* === Lightbox === */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 10, 0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border: 4px solid var(--surface);
  box-shadow: 0 16px 60px rgba(20, 15, 10, 0.7);
  border-radius: 1px;
}

/* === Footer === */
footer {
  text-align: center;
  padding: 16px 0;
  color: var(--cream-dark);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-style: italic;
}

footer a {
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--cream-mid);
  transition: color 0.15s ease, border-color 0.15s ease;
}

footer a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* === Animation === */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Responsive === */
@media (max-width: 768px) {
  .container {
    padding: 0 24px 48px;
  }

  header {
    padding: 52px 0 44px;
    margin-bottom: 52px;
  }

  .header-inner {
    gap: 26px;
  }

  .header-bracket-motif {
    width: 38px;
  }

  .header-text h1 {
    font-size: 2.4rem;
  }

  .header-subtitle {
    font-size: 1rem;
  }

  .how-it-works {
    grid-template-columns: 1fr;
    margin-bottom: 52px;
  }

  .hiw-item {
    border-right: none;
    border-bottom: 1px solid var(--cream-mid);
    padding: 24px 0;
  }

  .hiw-item:first-child { padding-left: 0; }
  .hiw-item:nth-child(2) { padding-left: 0; }
  .hiw-item:last-child {
    border-bottom: none;
    padding-left: 0;
  }

  .granularity-levels {
    grid-template-columns: repeat(2, 1fr);
  }

  .level-item:nth-child(2) {
    border-right: none;
  }

  .level-item:nth-child(1),
  .level-item:nth-child(2) {
    border-bottom: 1px solid var(--cream-mid);
  }

  .photo-gallery {
    flex-direction: column;
    align-items: center;
  }

  .photo-gallery img {
    width: 82%;
  }
}
