@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 ──────────────────────────────────────────── */
/* Coral + cream light; warm-dark + lifted coral for dark.
   Sibling to aekta-site's Olive & Honey. */

:root,
:root[data-theme="light"] {
  --accent:         #D4614A;
  --text:           #111111;
  --bg:             #EDE8E0;
  --texture-blend:  multiply;
  --texture-opacity: 0.4;
}

:root[data-theme="dark"] {
  --accent:         #E68062;
  --text:           #EDE8E0;
  --bg:             #1D1710;
  --texture-blend:  screen;
  --texture-opacity: 0.12;
}

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

body {
  background-color: var(--bg);
  font-family: var(--fragment);
  font-size: 10px;
  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;
  display: flex;
  flex-direction: column;
}


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

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

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


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

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

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


/* ─── SCATTER LAYOUT ──────────────────────────────────── */
/* Grows to fill space between header and footer.
   Items positioned by % of scatter height so the vertical spread
   scales with viewport; padding above the first item stays visually
   equal to padding below the last item. Photo pinned to 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: 40%; top: 6%;    display: inline-flex; align-items: center; gap: 8px; }
.item-dataviz    { position: absolute; left: 61%; top: 22%;   }
.item-maven      { position: absolute; left: 36%; top: 40%;   }
.item-trescu     { position: absolute; left: 84%; top: 55%;   }
.item-apres      { position: absolute; left: 3%;  top: 72%;   }
.item-curious    { position: absolute; left: 51%; top: 72%;   }
.item-paintings  { position: absolute; left: 18%; top: 89%;   }
.item-bespoke    { position: absolute; left: 68%; top: 89%;   }

.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: 10px;
  color: var(--text);
  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);
  font-family: var(--fragment);
  text-transform: uppercase;
  letter-spacing: 0.008em;
}

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

.footer-link {
  color: var(--accent);
  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;
}


/* ─── MOBILE — CLEAN STACKED LIST ─────────────────────── */
/* Below 860px, ditch the scatter and stack in DOM order.
   Item block drops into thumb-reach zone via margin-top: auto on
   the first item. Photo scales up to 480px for graceful growth. */

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

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

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

  .theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    font-size: 20px;
    padding: 4px;
  }

  .scatter-layout {
    position: static;
    flex: 1;
    height: auto;
    min-height: 0;
    margin-top: 48px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    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-apres, .item-dataviz, .item-maven, .item-trescu,
  .item-mantel, .item-curious, .item-paintings, .item-bespoke {
    position: static;
    display: block;
    margin-bottom: 22px;
  }

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

  /* Push the whole item block down toward the bottom of the scatter.
     Mantel is DOM-first so it gets the auto margin. */
  .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: 780px) {
  .scatter-layout { margin-top: 28px; }
  .hero-photo { margin-bottom: 12px; }
  .item-apres, .item-dataviz, .item-maven, .item-trescu,
  .item-mantel, .item-curious, .item-paintings, .item-bespoke { margin-bottom: 14px; }
  .item-bespoke { margin-bottom: 24px; }
  .site-header { padding-top: 24px; }
  .site-footer { padding-top: 20px; padding-bottom: 24px; }
}

@media (max-width: 860px) and (max-height: 640px) {
  .scatter-layout { margin-top: 16px; }
  .hero-photo {
    max-width: 340px;
    margin-bottom: 8px;
    aspect-ratio: 16 / 9;
  }
  .item-apres, .item-dataviz, .item-maven, .item-trescu,
  .item-mantel, .item-curious, .item-paintings, .item-bespoke { margin-bottom: 10px; }
  .item-bespoke { margin-bottom: 14px; }
  .site-header { padding-top: 20px; }
  .site-footer { padding-top: 16px; padding-bottom: 20px; }
}
