/*
 * styles.css — unified stylesheet for Dream Diary
 *
 * Sections:
 *   1.  Reset & base
 *   2.  Hero canvas (shared)
 *   3.  Home page
 *   4.  Blog page — hero + interactive shapes
 *   5.  Blog page — overlay panels
 *   6.  About page — hero
 *   7.  Projects page — hero
 *   8.  Sidebar layout (about + projects)
 *   9.  Sidebar highlight states
 *  10.  Shared content sections
 *  11.  Navigation bar
 *  12.  Animations
 *  13.  Responsive breakpoints
 */

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

html {
  width: 100%;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  background: white;
  overflow-y: scroll;
}

/* Home — full-screen, no scroll */
html.page-home,
body.page-home {
  height: 100%;
  overflow: hidden;
}
body.page-home {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Blog — full-screen, no scroll (overlays handle content) */
html.page-blog,
body.page-blog {
  height: 100%;
  overflow: hidden;
}
body.page-blog {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─────────────────────────────────────────────
   2. HERO CANVAS — SHARED BASE
   ─────────────────────────────────────────────
   JS reads data-w / data-h to compute scale().
   100dvh is the iOS-safe equivalent of 100vh.
*/
.hero-section {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-canvas] {
  position: relative;
  background: white;
  transform-origin: center center;
}

/* ─────────────────────────────────────────────
   3. HOME PAGE
   ─────────────────────────────────────────────
*/
.home-canvas {
  width: 35rem;
  height: 20.625rem;
  overflow: visible;
}

.home-spiral-svg {
  position: absolute;
  left: 0;
  top: 3.47rem;
  overflow: visible;
  width: 35.0625rem;
  height: 16.75rem;
}

.nav-link {
  position: absolute;
  top: 1.125rem;
  font-family: 'Goblin One', serif;
  font-size: 0.75rem;
  color: black;
  line-height: normal;
  white-space: nowrap;
  text-decoration: none;
}
.nav-blog     { left: 14.625rem; }
.nav-about    { left: 20.9375rem; }
.nav-projects { left: 28.125rem; }

.tagline {
  position: absolute;
  left: 13.8125rem;
  top: 10.625rem;
  font-family: 'Goblin One', serif;
  font-size: 0.75rem;
  color: black;
  line-height: normal;
  white-space: nowrap;
}

.red-dot {
  position: absolute;
  left: 3.875rem;
  top: 16.5rem;
  width: 0.3125rem;
  height: 0.3125rem;
  background: red;
  border-radius: 50%;
}

.escape-text {
  position: absolute;
  left: 2.5rem;
  top: 17.4375rem;
  font-family: 'Goblin One', serif;
  font-size: 0.75rem;
  color: black;
  line-height: normal;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────
   4. BLOG PAGE — HERO + INTERACTIVE SHAPES
   ─────────────────────────────────────────────
*/
.blog-canvas {
  width: 34.8125rem;
  height: 22.25rem;
  overflow: visible;
}

.blog-curve-svg {
  position: absolute;
  left: -0.3125rem;
  top: 4.8125rem;
  overflow: visible;
  width: 35.125rem;
  height: 15.9375rem;
}

.blog-title-wrapper {
  position: absolute;
  left: 2.125rem;
  top: 1rem;
  width: 7.57rem;
  height: 5.366rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.blog-title {
  font-family: 'Caveat', cursive;
  font-size: 4rem;
  font-weight: 400;
  color: black;
  line-height: normal;
  transform: rotate(-21.18deg);
  white-space: nowrap;
  display: block;
}

.shape-rect {
  position: absolute;
  left: 6.8125rem;
  top: 9.625rem;
  width: 5.6875rem;
  height: 5.4375rem;
  background: #ff2020;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.shape-rect:hover { filter: brightness(1.15); transform: scale(1.04); }

.shape-rect p {
  font-family: 'Hermeneus One', serif;
  font-size: 0.9375rem;
  color: white;
  text-align: right;
  white-space: nowrap;
  margin: 0;
}

.shape-triangle {
  position: absolute;
  left: 16.0625rem;
  top: 4.8125rem;
  width: 15.5rem;
  height: 16.9375rem;
  cursor: pointer;
}

.shape-triangle-inner {
  position: absolute;
  left: 6.7%;
  right: 6.7%;
  top: 0;
  bottom: 25%;
  background: #2800ff;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  transform-origin: center bottom;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.shape-triangle:hover .shape-triangle-inner {
  filter: brightness(1.12);
  transform: scaleY(0.97);
}

.shape-circle {
  position: absolute;
  left: 22.375rem;
  top: 2.0625rem;
  width: 2.8125rem;
  height: 2.75rem;
  background: #f5a520;
  border-radius: 50%;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.shape-circle:hover { filter: brightness(1.1); transform: scale(1.12); }

.mind-text {
  position: absolute;
  left: 24.6875rem;
  top: 2.9375rem;
  transform: translateX(-100%);
  font-family: 'Hermeneus One', serif;
  font-size: 0.75rem;
  color: black;
  text-align: right;
  line-height: normal;
  white-space: nowrap;
}

.quote-text {
  position: absolute;
  left: 29.6875rem;
  top: 18.875rem;
  transform: translateX(-100%);
  font-family: 'Hermeneus One', serif;
  font-size: 0.75rem;
  color: black;
  text-align: right;
  line-height: normal;
  white-space: nowrap;
}
.quote-text p { margin: 0; }

/* ─────────────────────────────────────────────
   5. BLOG PAGE — OVERLAY PANELS
   ─────────────────────────────────────────────
*/
.overlay-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.12);
  z-index: 100;
}
.overlay-backdrop.is-open { display: block; }

.overlay-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 22rem;
  max-width: 100vw;
  height: 100vh;
  background: white;
  z-index: 101;
  overflow-y: auto;
  padding: 5rem 2.5rem 3rem;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}
.overlay-panel.is-open { transform: translateX(0); }

.overlay-close {
  position: absolute;
  top: 1.375rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: black;
  padding: 0.25rem 0.5rem;
  font-family: 'Goblin One', serif;
}
.overlay-close:hover { opacity: 0.4; }

.overlay-label {
  font-family: 'Hermeneus One', serif;
  font-size: 0.625rem;
  color: #acacac;
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.overlay-title {
  font-family: 'Goblin One', serif;
  font-size: 1.75rem;
  font-weight: normal;
  color: black;
  margin-bottom: 0.5rem;
}

.overlay-desc {
  font-family: 'Hermeneus One', serif;
  font-size: 0.75rem;
  color: #acacac;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.overlay-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid black;
}
.overlay-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid #e8e8e8;
  font-family: 'Hermeneus One', serif;
  font-size: 0.75rem;
}
.overlay-list .overlay-date {
  color: #acacac;
  flex-shrink: 0;
}
.overlay-list a {
  color: black;
  text-decoration: none;
}
.overlay-list a:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────
   6. ABOUT PAGE — HERO
   ─────────────────────────────────────────────
*/
.about-canvas {
  width: 35rem;
  height: 22.5rem;
  overflow: visible;
}

.about-curve-svg {
  position: absolute;
  left: 0.01rem;
  top: 3.176rem;
  z-index: 1;
  overflow: visible;
  width: 32.25rem;
  height: 19.1875rem;
}

.star-container {
  position: absolute;
  left: 6.1875rem;
  top: 7.25rem;
  width: 9.6875rem;
  height: 9.6875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.star-inner {
  width: 8.75rem;
  height: 8.75rem;
  clip-path: polygon(
    50% 0%,   61% 35%,  98% 35%,
    68% 57%,  79% 91%,  50% 70%,
    21% 91%,  32% 57%,   2% 35%,
    39% 35%
  );
  background: #e8d44d;
}

.rect-desire {
  position: absolute;
  left: 22.5625rem;
  top: 6.5rem;
  width: 7.3125rem;
  height: 1.9375rem;
  background: #8afff5;
  border: 1px solid #ffd4d4;
  z-index: 2;
  transition: opacity 0.35s ease;
}

.ellipse-success {
  position: absolute;
  left: 22.5625rem;
  top: 15.375rem;
  width: 7.6875rem;
  height: 3.6875rem;
  background: #c9b8f0;
  border-radius: 50%;
  z-index: 2;
  transition: opacity 0.35s ease;
}

.about-title {
  position: absolute;
  left: 13.0625rem;
  top: 0.3125rem;
  font-family: 'Monofett', monospace;
  font-size: 3rem;
  color: black;
  line-height: normal;
  white-space: nowrap;
  z-index: 2;
}

.text-block {
  position: absolute;
  font-family: 'Hermeneus One', serif;
  font-size: 0.75rem;
  color: black;
  text-align: center;
  line-height: normal;
  white-space: nowrap;
  z-index: 2;
  cursor: pointer;
  transition: opacity 0.35s ease;
}
.text-block:hover { opacity: 0.65; }
.text-block p { margin: 0; }

.text-desire {
  left: 26.34375rem;
  top: 6.5rem;
  transform: translateX(-50%);
  white-space: pre;
}

.text-quote {
  left: 10.84375rem;
  top: 11.125rem;
  transform: translateX(-50%);
}

.text-success {
  left: 26.4375rem;
  top: 16.3125rem;
  transform: translateX(-50%);
}

/* ─────────────────────────────────────────────
   7. PROJECTS PAGE — HERO
   ─────────────────────────────────────────────
*/
.projects-canvas {
  width: 35rem;
  height: 21.25rem;
}

.projects-title {
  position: absolute;
  left: 25rem;
  top: 1.375rem;
  width: 7.5625rem;
  height: 2.125rem;
  font-family: Impact, 'Impact Regular', sans-serif;
  font-size: 2rem;
  font-weight: 400;
  color: black;
  line-height: normal;
}

.quote-block {
  position: absolute;
  left: 31.875rem;
  top: 4.75rem;
  transform: translateX(-100%);
  font-family: 'Hermeneus One', serif;
  font-size: 0.75rem;
  color: black;
  text-align: right;
  line-height: normal;
  white-space: nowrap;
}
.quote-block p { margin: 0; }

.proj-box {
  position: absolute;
  background: #d9d9d9;
  cursor: pointer;
  transition: background 0.3s ease, opacity 0.35s ease;
}
.proj-box-main         { left: 1.375rem;   top: 10rem;     width: 15.4375rem; height: 11rem;    }
.proj-box-top-right    { left: 17.875rem;  top: 10rem;     width: 16rem;      height: 3.375rem; }
.proj-box-bottom-right { left: 17.875rem;  top: 14.125rem; width: 16rem;      height: 6.875rem; }
.proj-box:hover { background: #c0c0c0; }

/* ─────────────────────────────────────────────
   8. SIDEBAR LAYOUT (about + projects)
   ─────────────────────────────────────────────
*/
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 40vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid #e8e8e8;
  background: white;
}

.sidebar-canvas-wrap {
  width: calc(40vw - 4rem);
  height: calc(100vh - 4rem);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-main {
  margin-left: 40vw;
  min-height: 100vh;
  padding: 7rem 3.5rem 6rem;
}

/* ─────────────────────────────────────────────
   9. SIDEBAR HIGHLIGHT STATES
   ─────────────────────────────────────────────
   When any section is observed, dim sibling canvas elements.
   is-active elements remain at full opacity.
*/
.sidebar [data-canvas] [data-for] {
  transition: opacity 0.35s ease;
}

.sidebar [data-canvas].has-active [data-for]:not(.is-active) {
  opacity: 0.2;
}

.sidebar .proj-box.is-active {
  background: #aaaaaa;
}

/* Content spacing inside sidebar-main */
.sidebar-main .about-subsection {
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid #e8e8e8;
  padding-bottom: 3rem;
  margin-bottom: 3rem;
}
.sidebar-main .about-subsection:last-child {
  border-bottom: none;
}

.sidebar-main .section-label {
  margin-bottom: 2rem;
}

.sidebar-main .highlight-grid {
  margin-bottom: 3rem;
}

.sidebar-main .highlight-card {
  min-height: 30vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-left: 1px solid #e8e8e8;
  padding-left: 1rem;
}

/* ─────────────────────────────────────────────
   10. SHARED CONTENT SECTIONS
   ─────────────────────────────────────────────
*/
.content-section {
  background: white;
  padding: 5rem 2.5rem;
  scroll-margin-top: 3rem;
}

.content-inner {
  max-width: 35rem;
  margin: 0 auto;
}

.section-label {
  font-family: 'Hermeneus One', serif;
  font-size: 0.6875rem;
  color: #acacac;
  margin-bottom: 1.5rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 4rem;
}

.highlight-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scroll-margin-top: 3.5rem;
}

.highlight-card .card-date {
  font-family: 'Hermeneus One', serif;
  font-size: 0.6875rem;
  color: #acacac;
}

.highlight-card .card-title {
  font-family: 'Hermeneus One', serif;
  font-size: 0.8125rem;
  color: black;
  text-decoration: none;
}
.highlight-card .card-title:hover { text-decoration: underline; }

.highlight-card .card-excerpt {
  font-family: 'Hermeneus One', serif;
  font-size: 0.75rem;
  color: #acacac;
  line-height: 1.6;
}

.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid black;
}

.archive-list li {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #acacac;
  font-family: 'Hermeneus One', serif;
  font-size: 0.75rem;
}

.archive-list .entry-date {
  color: #acacac;
  white-space: nowrap;
  flex-shrink: 0;
}

.archive-list a {
  color: black;
  text-decoration: none;
}
.archive-list a:hover { text-decoration: underline; }

.about-subsection {
  margin-bottom: 3.5rem;
  scroll-margin-top: 3.5rem;
}

.about-subsection h2 {
  font-family: 'Hermeneus One', serif;
  font-size: 0.6875rem;
  font-weight: normal;
  color: #acacac;
  margin-bottom: 1rem;
}

.about-subsection p {
  font-family: 'Hermeneus One', serif;
  font-size: 0.8125rem;
  line-height: 1.8;
  color: black;
}

/* ─────────────────────────────────────────────
   11. NAVIGATION BAR (injected by navigation.js)
   ─────────────────────────────────────────────
*/
#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  justify-content: flex-end;
  gap: 2rem;
  padding: 1rem 2.5rem;
  background: white;
}

#site-nav a {
  font-family: 'Goblin One', serif;
  font-size: 0.75rem;
  color: black;
  text-decoration: none;
  white-space: nowrap;
}
#site-nav a:hover { opacity: 0.5; }

/* ─────────────────────────────────────────────
   12. ANIMATIONS
   ─────────────────────────────────────────────
*/
@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

@keyframes pulse-soft {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}

/* Star on about sidebar spins slowly */
.sidebar .star-inner {
  animation: spin-slow 24s linear infinite;
}

/* Mind circle on blog pulses (pauses while hovered for stable click) */
.page-blog .shape-circle {
  animation: pulse-soft 3s ease-in-out infinite;
}
.page-blog .shape-circle:hover {
  animation-play-state: paused;
}

/* ─────────────────────────────────────────────
   13. RESPONSIVE BREAKPOINTS
   ─────────────────────────────────────────────
*/

/* ── Tablet: 768px ── */
@media (max-width: 48rem) {
  .highlight-grid { grid-template-columns: repeat(2, 1fr); }

  .content-section { padding: 3rem 1.5rem; }

  #site-nav { gap: 1.25rem; padding: 0.75rem 1.5rem; }

  /* Sidebar: stack above content */
  .sidebar {
    position: static;
    width: 100%;
    height: 55vw;
    border-right: none;
    border-bottom: 1px solid #e8e8e8;
  }
  .sidebar-canvas-wrap {
    width: calc(100% - 3rem);
    height: calc(55vw - 3rem);
  }
  .sidebar-main {
    margin-left: 0;
    padding: 3rem 1.5rem 4rem;
  }
  .sidebar-main .about-subsection { min-height: auto; }
  .sidebar-main .highlight-card   { min-height: auto; }
}

/* ── Mobile: 480px ── */
@media (max-width: 30rem) {
  .highlight-grid { grid-template-columns: 1fr; }

  .content-section { padding: 2rem 1rem; }

  #site-nav {
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .sidebar       { height: 70vw; }
  .sidebar-canvas-wrap { height: calc(70vw - 2rem); }
  .sidebar-main  { padding: 2rem 1rem 3rem; }
}

/* ── Small mobile: 360px ── */
@media (max-width: 22.5rem) {
  #site-nav { gap: 0.5rem; font-size: 0.625rem; }
}
