@import url('https://fonts.googleapis.com/css2?family=Fragment+Mono&family=Space+Mono:wght@400;700&display=swap');

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

/* ─── THEME ──────────────────────────────────────────── */
/* Light is the default. Dark inherits the same structure with inverse
   tokens tuned to keep the powder-blue/lavender family recognizable. */

/* Olive & Honey — honeyed cream ground, olive accents, deep-olive chrome */
:root,
:root[data-theme="light"] {
  --accent:         #8A9060;
  --accent-deep:    #4D5220;
  --text:           #1A1B14;
  --bg:             #F3EEDE;
  --texture-blend:  multiply;
  --texture-opacity: 0.4;
}

:root[data-theme="dark"] {
  --accent:         #B0B783;
  --accent-deep:    #C7CBA2;
  --text:           #F3EEDE;
  --bg:             #14150F;
  --texture-blend:  screen;
  --texture-opacity: 0.12;
}

:root {
  --fragment: 'Fragment Mono', 'Courier New', monospace;
  --space:    'Space Mono', 'Courier New', monospace;
  --scale:    1;
}

/* Larger-text mode — 1.25× everywhere via calc(size * var(--scale)) */
:root[data-size="lg"] { --scale: 1.25; }

body {
  background-color: var(--bg);
  font-family: var(--fragment);
  font-size: calc(10px * var(--scale));
  line-height: 1.4;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Subtle paper texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('images/bg-texture.png');
  background-size: cover;
  background-repeat: no-repeat;
  mix-blend-mode: var(--texture-blend);
  opacity: var(--texture-opacity);
  pointer-events: none;
  transform: rotate(180deg);
  z-index: 0;
}

.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(20px, 6vw, 88px);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}


/* ─── HEADER ──────────────────────────────────────────── */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 32px;
  color: var(--accent-deep);
  font-family: var(--fragment);
  text-transform: uppercase;
  letter-spacing: 0.008em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}


/* ─── THEME TOGGLE ────────────────────────────────────── */

.theme-toggle {
  background: none;
  border: none;
  color: var(--accent-deep);
  line-height: 1;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease, color 0.25s ease;
}

.theme-toggle:hover {
  opacity: 0.6;
}

/* Header (desktop) toggle */
.theme-toggle--head {
  font-size: 20px;
  /* ☯ glyph sits slightly low in its font box — nudge up for optical centering */
  transform: translateY(-2px);
}

/* Mobile-only toggle — hidden on desktop */
.theme-toggle--scatter {
  display: none;
  font-size: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
}


/* ─── SIZE TOGGLE (Aa) ────────────────────────────────── */
/* Same shape/behavior as .theme-toggle; sits next to it. */

.size-toggle {
  background: none;
  border: none;
  color: var(--accent-deep);
  line-height: 1;
  cursor: pointer;
  padding: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease, color 0.25s ease;
}

/* Icon (↑A / ↓A) is set via textContent by the size-toggle handler in script.js. */

.size-toggle:hover {
  opacity: 0.6;
}

.size-toggle--head {
  font-size: 12px;
}

.size-toggle--scatter {
  display: none;
  font-size: 15px;
  width: 28px;
  height: 28px;
  padding: 0;
}


/* ─── SCATTER LAYOUT ──────────────────────────────────── */
/*
  Photo occupies up to left 0–32%, top 0–~293px.
  Items sit in the whitespace:
    - "right of photo" items keep left ≥ 42%
    - "below photo" items keep top ≥ 320px
  Each item lands on a distinct x AND y so they read as dispersed.
*/

/* Scatter grows to fill space between header and footer.
   Y-positions are % of scatter height so items spread with the viewport
   and the padding above MAVEN stays visually equal to the padding below
   ETCETERA at any height. Photo stays pinned to scatter top-left. */
.scatter-layout {
  position: relative;
  flex: 1;
  margin-top: 48px;
  margin-bottom: 48px;
  min-height: 500px;
}

.hero-photo {
  position: absolute;
  left: 0;
  top: 0;
  width: 32%;
  max-width: 390px;
  height: auto;
  display: block;
}

.item-mantel    { position: absolute; left: 46%; top: 10%;   display: inline-flex; align-items: center; gap: 8px; }
.item-vibeiq    { position: absolute; left: 82%; top: 28%;   }
.item-beyond    { position: absolute; left: 55%; top: 46%;   }
.item-thumbtack { position: absolute; left: 25%; top: 62%;   }
.item-maven     { position: absolute; left: 3%;  top: 78%;   }
.item-turo      { position: absolute; left: 88%; top: 74%;   }
.item-etcetera  { position: absolute; left: 40%; top: 87.2%; }

.mantel-marker {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: var(--accent);
  transition: background 0.25s ease;
}


/* ─── HOVERABLE ITEMS ─────────────────────────────────── */

.hoverable {
  font-family: var(--fragment);
  font-size: calc(10px * var(--scale));
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.008em;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.25s ease;
  user-select: none;
  white-space: nowrap;
}

.hoverable:hover {
  opacity: 0.4;
}


/* ─── FOOTER ──────────────────────────────────────────── */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 24px;
  padding-bottom: 32px;
  color: var(--accent-deep);
  font-family: var(--fragment);
  text-transform: uppercase;
  letter-spacing: 0.008em;
}

.footer-left {
  display: flex;
  align-items: baseline;
}

.footer-link {
  color: var(--accent-deep);
  text-decoration: none;
  font-family: var(--fragment);
  text-transform: uppercase;
  letter-spacing: 0.008em;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-right {
  text-align: right;
}


/* ─── HOVER PREVIEW ───────────────────────────────────── */

.hover-preview {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  width: 240px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.hover-preview.visible {
  opacity: 1;
}

.hover-preview img {
  display: block;
  width: 240px;
  height: auto;
}

@media (max-width: 860px) {
  .hover-preview,
  .hover-preview img {
    width: 300px;
  }
}


/* ─── MOBILE — CLEAN STACKED LIST ─────────────────────── */
/* Below 860px, ditch the scatter and stack in DOM order.
   Compressed vertical rhythm so the whole page usually fits without scroll.
   ☯ toggle pins to the top-right corner of the viewport. */

@media (max-width: 860px) {
  .site-header,
  .site-footer {
    flex-direction: column;
    gap: 4px;
  }

  /* Reorder: header → footer → scatter (so footer sits under
     "Based in Brooklyn, NY" and can't be covered by the mobile browser bar) */
  .site-footer { order: 1; }
  .scatter-layout { order: 2; }

  .footer-right {
    text-align: left;
  }

  /* Pull the toggle out of header flow; anchor to top-right */
  .header-right {
    display: contents;
  }

  /* Swap which toggles are visible on mobile */
  .theme-toggle--head { display: none; }
  .size-toggle--head  { display: none; }
  .theme-toggle--scatter {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
  }
  .size-toggle--scatter {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 60px;
    right: 20px;
    z-index: 100;
  }

  /* Scatter fills the space below the photo so we can drop the item
     block into the thumb-reach zone with margin-top: auto.
     align-items: flex-start makes each item only as wide as its text
     — so tapping empty space beside an item doesn't hit that link. */
  .scatter-layout {
    position: static;
    flex: 1;
    height: auto;
    min-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .hero-photo {
    position: static;
    width: 100%;
    max-width: 480px;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: center;
    margin-bottom: 20px;
  }

  .item-mantel, .item-maven, .item-turo, .item-beyond,
  .item-vibeiq, .item-thumbtack, .item-etcetera {
    position: static;
    display: block;
    margin-bottom: 22px;
  }

  .item-etcetera {
    margin-bottom: 32px;
  }

  /* Push the whole item block down toward the bottom of the scatter */
  .item-mantel {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
}

/* ─── SHORT MOBILE VIEWPORTS ───────────────────────────
   Progressively tighter spacing so shorter phones don't scroll. */

@media (max-width: 860px) and (max-height: 720px) {
  .hero-photo { margin-bottom: 12px; }
  .item-mantel, .item-maven, .item-turo, .item-beyond,
  .item-vibeiq, .item-thumbtack, .item-etcetera { margin-bottom: 16px; }
  .item-etcetera { margin-bottom: 24px; }
  .site-header { padding-top: 24px; }
  .site-footer { padding-top: 20px; padding-bottom: 24px; }
}

@media (max-width: 860px) and (max-height: 600px) {
  .hero-photo {
    max-width: 360px;
    margin-bottom: 8px;
    aspect-ratio: 16 / 9;
  }
  .item-mantel, .item-maven, .item-turo, .item-beyond,
  .item-vibeiq, .item-thumbtack, .item-etcetera { margin-bottom: 12px; }
  .item-etcetera { margin-bottom: 16px; }
  .site-header { padding-top: 20px; }
  .site-footer { padding-top: 16px; padding-bottom: 20px; }
}
