/* ============================================================
   amamiya.xyz — Frutiger-Aero Monochrome Weather Diary
   palette : strict 7-step grey, no chromatic hues
   typography : Roboto Slab + JetBrains Mono
   ============================================================ */

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

html {
  background: #0d0d0d;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Roboto Slab", Georgia, serif;
  font-weight: 400;
  color: #d4d4d4;
  background: #0d0d0d;
  overflow: hidden;
  height: 100vh;
}

/* ============================================================
   GRID — split-screen 5:7 (41.66 / 58.33)
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: 41.66vw 58.33vw;
  height: 100vh;
  width: 100vw;
  position: relative;
  overflow: hidden;
}

/* ============================================================
   LEFT PANE — the shrine
   ============================================================ */
.shrine {
  position: relative;
  height: 100vh;
  background: #1f1f1f;
  overflow: hidden;
  z-index: 3;
}

/* faint vertical noise texture */
.shrine-noise {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(242,242,242,0.0) 0px,
      rgba(242,242,242,0.0) 2px,
      rgba(242,242,242,0.55) 2px,
      rgba(242,242,242,0.55) 3px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(13,13,13,0.0) 0px,
      rgba(13,13,13,0.0) 1px,
      rgba(13,13,13,0.4) 1px,
      rgba(13,13,13,0.4) 2px
    );
  mix-blend-mode: overlay;
}

/* aero radial highlight pinned top-left */
.shrine::before {
  content: "";
  position: absolute;
  inset: -10% -25% auto auto;
  width: 80%;
  height: 60%;
  background: radial-gradient(
    ellipse at top right,
    rgba(242,242,242,0.10) 0%,
    rgba(242,242,242,0.04) 35%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 1;
}

/* aero radial highlight pinned bottom-left, weaker */
.shrine::after {
  content: "";
  position: absolute;
  inset: auto auto -15% -10%;
  width: 70%;
  height: 50%;
  background: radial-gradient(
    ellipse at bottom left,
    rgba(242,242,242,0.05) 0%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 1;
}

.shrine-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: clamp(2.4rem, 4.5vw, 4rem) clamp(1.8rem, 3.6vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.4rem, 2.4vw, 2.2rem);
}

/* ---------- WORDMARK ---------- */
.wordmark {
  font-family: "Roboto Slab", Georgia, serif;
  font-weight: 800;
  font-size: clamp(3rem, 6.5vw, 5.75rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  color: #f2f2f2;
  text-shadow:
    0 1px 0 rgba(13,13,13,0.6),
    0 2px 14px rgba(0,0,0,0.45);
  /* aero gloss highlight on the type */
  background: linear-gradient(
    180deg,
    #f2f2f2 0%,
    #f2f2f2 40%,
    #d4d4d4 75%,
    #a8a8a8 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.declaration {
  font-family: "Roboto Slab", Georgia, serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: #a8a8a8;
  letter-spacing: 0.005em;
}

/* ---------- DIARY CARD (frutiger-aero panel) ---------- */
.diary-card {
  position: relative;
  background: rgba(58,58,58,0.40);
  backdrop-filter: blur(20px) saturate(0%);
  -webkit-backdrop-filter: blur(20px) saturate(0%);
  border: 1px solid rgba(242,242,242,0.08);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(242,242,242,0.12),
    inset 0 -1px 0 rgba(13,13,13,0.4),
    0 24px 48px rgba(0,0,0,0.45);
  padding: 1.25rem 1.4rem 1.1rem;
  overflow: hidden;
}

/* aero bevel — top inner highlight band */
.diary-bevel {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 38%;
  background: linear-gradient(
    180deg,
    rgba(242,242,242,0.12) 0%,
    rgba(242,242,242,0.04) 50%,
    transparent 100%
  );
  pointer-events: none;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.diary-header,
.diary-row {
  display: grid;
  grid-template-columns: 1.4fr 0.95fr 0.7fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.1rem;
  position: relative;
  z-index: 1;
}

.diary-header {
  font-family: "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6b6b6b;
  border-bottom: 1px solid #3a3a3a;
  padding-bottom: 0.7rem;
  margin-bottom: 0.25rem;
}

.diary-list {
  list-style: none;
}

.diary-row {
  border-bottom: 1px solid rgba(58,58,58,0.5);
  font-family: "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: #d4d4d4;
}

.diary-row:last-child {
  border-bottom: none;
}

.diary-col-date {
  color: #d4d4d4;
}

.diary-col-dur {
  color: #a8a8a8;
}

.diary-col-int {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* intensity dot SVGs */
.dots {
  width: 36px;
  height: 12px;
  overflow: visible;
}

.dots circle {
  fill: #a8a8a8;
}

.dots circle.dot-empty {
  fill: none;
  stroke: #6b6b6b;
  stroke-width: 0.6;
}

/* card footer */
.diary-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.85rem;
  margin-top: 0.4rem;
  border-top: 1px solid rgba(58,58,58,0.5);
  font-family: "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6b6b6b;
}

.diary-meta-num {
  font-family: "Roboto Slab", Georgia, serif;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: none;
  color: #a8a8a8;
}

/* ---------- SHRINE FOOT ---------- */
.shrine-foot {
  margin-top: auto;
  font-family: "Roboto Slab", Georgia, serif;
  font-weight: 400;
  font-size: 0.84rem;
  line-height: 1.75;
  color: #6b6b6b;
  max-width: 28ch;
  font-style: italic;
}

/* ============================================================
   SEPARATOR — sinusoidal rain-trail divider between panes
   ============================================================ */
.separator {
  position: absolute;
  top: 0;
  left: 41.66vw;
  width: 16px;
  height: 100vh;
  transform: translateX(-8px);
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}

.separator-path {
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  animation:
    sep-draw 4.5s ease-out 0.2s forwards,
    sep-breathe 11s ease-in-out 5s infinite;
}

@keyframes sep-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes sep-breathe {
  0%, 100% { stroke-width: 0.5; opacity: 0.7; }
  50%      { stroke-width: 1.2; opacity: 1; }
}

/* ============================================================
   RIGHT PANE — the sky
   ============================================================ */
.sky {
  position: relative;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: #0d0d0d;
}

/* ---------- LAYER 1 :: photographs ---------- */
.photo-stack {
  position: fixed;
  top: 0;
  left: 41.66vw;
  width: 58.33vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

.photo {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s ease;
  background-size: cover;
  background-position: center;
  /* monochrome rain-on-glass synthesised via layered radial-gradients */
  filter: saturate(0%) contrast(1.05) brightness(0.95);
}

/* default visible photo on load = morning */
.photo.is-active {
  opacity: 1;
}

/* photo 1 — morning : pale, fine drizzle, tiny droplets */
.photo-1 {
  background:
    radial-gradient(circle at 12% 22%, rgba(242,242,242,0.18) 0 1px, transparent 2px),
    radial-gradient(circle at 24% 41%, rgba(242,242,242,0.22) 0 1.5px, transparent 3px),
    radial-gradient(circle at 38% 18%, rgba(242,242,242,0.14) 0 1px, transparent 2px),
    radial-gradient(circle at 56% 64%, rgba(242,242,242,0.20) 0 2px, transparent 4px),
    radial-gradient(circle at 71% 32%, rgba(242,242,242,0.16) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 58%, rgba(242,242,242,0.24) 0 2px, transparent 4px),
    radial-gradient(circle at 18% 78%, rgba(242,242,242,0.18) 0 1.5px, transparent 3px),
    radial-gradient(circle at 47% 88%, rgba(242,242,242,0.22) 0 2px, transparent 4px),
    radial-gradient(circle at 92% 84%, rgba(242,242,242,0.18) 0 1px, transparent 2px),
    linear-gradient(180deg, #2a2a2a 0%, #1c1c1c 60%, #131313 100%);
  background-size:
    50% 50%, 50% 50%, 50% 50%, 50% 50%,
    50% 50%, 50% 50%, 50% 50%, 50% 50%,
    50% 50%, 100% 100%;
  background-repeat: repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, no-repeat;
}

/* photo 2 — midday : heavier drops, larger blobs */
.photo-2 {
  background:
    radial-gradient(circle at 14% 28%, rgba(212,212,212,0.45) 0 3px, rgba(212,212,212,0.10) 5px, transparent 8px),
    radial-gradient(circle at 32% 14%, rgba(242,242,242,0.32) 0 2px, transparent 5px),
    radial-gradient(circle at 48% 52%, rgba(242,242,242,0.55) 0 4px, rgba(242,242,242,0.10) 7px, transparent 11px),
    radial-gradient(circle at 67% 26%, rgba(212,212,212,0.38) 0 3px, transparent 6px),
    radial-gradient(circle at 79% 71%, rgba(242,242,242,0.50) 0 5px, rgba(242,242,242,0.08) 9px, transparent 14px),
    radial-gradient(circle at 22% 82%, rgba(212,212,212,0.35) 0 3px, transparent 6px),
    radial-gradient(circle at 88% 12%, rgba(212,212,212,0.30) 0 2px, transparent 5px),
    linear-gradient(180deg, #353535 0%, #232323 55%, #161616 100%);
  background-size:
    50% 50%, 50% 50%, 50% 50%, 50% 50%,
    50% 50%, 50% 50%, 50% 50%, 100% 100%;
  background-repeat: repeat, repeat, repeat, repeat, repeat, repeat, repeat, no-repeat;
}

/* photo 3 — dusk : low contrast, longer streaks */
.photo-3 {
  background:
    linear-gradient(95deg, transparent 18%, rgba(168,168,168,0.18) 19%, transparent 21%),
    linear-gradient(95deg, transparent 38%, rgba(168,168,168,0.14) 39%, transparent 42%),
    linear-gradient(95deg, transparent 58%, rgba(168,168,168,0.20) 59%, transparent 61%),
    linear-gradient(95deg, transparent 78%, rgba(168,168,168,0.16) 79%, transparent 82%),
    radial-gradient(circle at 28% 40%, rgba(242,242,242,0.30) 0 2px, transparent 5px),
    radial-gradient(circle at 62% 70%, rgba(242,242,242,0.32) 0 3px, transparent 6px),
    radial-gradient(circle at 84% 30%, rgba(242,242,242,0.26) 0 2px, transparent 5px),
    linear-gradient(180deg, #2c2c2c 0%, #1a1a1a 50%, #0d0d0d 100%);
  background-size:
    100% 100%, 100% 100%, 100% 100%, 100% 100%,
    50% 50%, 50% 50%, 50% 50%, 100% 100%;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat,
                     repeat, repeat, repeat, no-repeat;
}

/* photo 4 — night : darker, fewer larger drops */
.photo-4 {
  background:
    radial-gradient(circle at 22% 33%, rgba(168,168,168,0.55) 0 5px, rgba(168,168,168,0.15) 9px, transparent 14px),
    radial-gradient(circle at 58% 62%, rgba(168,168,168,0.60) 0 6px, rgba(168,168,168,0.12) 11px, transparent 16px),
    radial-gradient(circle at 78% 18%, rgba(168,168,168,0.45) 0 4px, rgba(168,168,168,0.10) 8px, transparent 13px),
    radial-gradient(circle at 38% 84%, rgba(168,168,168,0.50) 0 5px, transparent 10px),
    linear-gradient(180deg, #1a1a1a 0%, #101010 60%, #050505 100%);
  background-size:
    60% 60%, 60% 60%, 60% 60%, 60% 60%, 100% 100%;
  background-repeat: repeat, repeat, repeat, repeat, no-repeat;
}

/* photo 5 — deep-night : near-black, sparse silver droplets */
.photo-5 {
  background:
    radial-gradient(circle at 35% 25%, rgba(212,212,212,0.55) 0 4px, rgba(212,212,212,0.10) 7px, transparent 11px),
    radial-gradient(circle at 65% 55%, rgba(212,212,212,0.50) 0 5px, transparent 10px),
    radial-gradient(circle at 84% 80%, rgba(212,212,212,0.45) 0 3px, transparent 7px),
    linear-gradient(180deg, #0d0d0d 0%, #060606 50%, #000000 100%);
  background-size: 70% 70%, 70% 70%, 70% 70%, 100% 100%;
  background-repeat: repeat, repeat, repeat, no-repeat;
}

/* photo 6 — dawn-after : grey-pearl wash, pane drying */
.photo-6 {
  background:
    radial-gradient(circle at 18% 38%, rgba(242,242,242,0.30) 0 1.5px, transparent 4px),
    radial-gradient(circle at 44% 68%, rgba(242,242,242,0.25) 0 1px, transparent 3px),
    radial-gradient(circle at 72% 22%, rgba(242,242,242,0.28) 0 1.5px, transparent 4px),
    linear-gradient(180deg, #4a4a4a 0%, #2e2e2e 50%, #1a1a1a 100%);
  background-size: 50% 50%, 50% 50%, 50% 50%, 100% 100%;
  background-repeat: repeat, repeat, repeat, no-repeat;
}

/* ---------- LAYER 2 :: SVG rain trails ---------- */
.rain {
  position: fixed;
  top: 0;
  left: 41.66vw;
  width: 58.33vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
}

.trail {
  fill: none;
  stroke: #d4d4d4;
  stroke-width: 0.4;
  stroke-linecap: round;
  opacity: 0.55;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation:
    drip 2.2s ease-in forwards,
    fadeOut 9s 2.2s forwards;
}

@keyframes drip {
  to { stroke-dashoffset: 0; }
}

@keyframes fadeOut {
  to { opacity: 0; }
}

/* ---------- LAYER 3 :: frosted-glass overlay ---------- */
.frost {
  position: fixed;
  top: 0;
  left: 41.66vw;
  width: 58.33vw;
  height: 100vh;
  z-index: 3;
  pointer-events: none;
  background: rgba(31,31,31,0.18);
  backdrop-filter: blur(2.5px) saturate(0%);
  -webkit-backdrop-filter: blur(2.5px) saturate(0%);
  /* extra aero gloss diagonal sheen */
  background-image:
    linear-gradient(
      125deg,
      rgba(242,242,242,0.06) 0%,
      transparent 30%,
      transparent 70%,
      rgba(13,13,13,0.18) 100%
    );
}

/* ---------- LAYER 4 :: aero highlight blooms ---------- */
.bloom-layer {
  position: fixed;
  top: 0;
  left: 41.66vw;
  width: 58.33vw;
  height: 100vh;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.bloom {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(242,242,242,0.10) 0%,
    rgba(242,242,242,0.04) 40%,
    transparent 70%
  );
  filter: blur(2px);
  animation: bloom-drift 18s linear infinite;
  will-change: transform, opacity;
}

.bloom-a { left: 14%; animation-delay: 0s;   }
.bloom-b { left: 38%; animation-delay: -6s;  }
.bloom-c { left: 64%; animation-delay: -12s; }
.bloom-d { left: 86%; animation-delay: -3s;  }

@keyframes bloom-drift {
  0%   { transform: translateY(-20vh); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(110vh); opacity: 0; }
}

/* ---------- LAYER 5 :: scroll markers / hour stamps ---------- */
.sky-content {
  position: relative;
  z-index: 5;
  width: 100%;
}

.scroll-marker {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 0 clamp(2rem, 4vw, 4rem) clamp(2.4rem, 5vh, 4rem);
  pointer-events: none;
}

.hour-stamp {
  font-family: "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.32em;
  color: rgba(168,168,168,0.7);
  margin-bottom: 0.45rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.hour-note {
  font-family: "Roboto Slab", Georgia, serif;
  font-weight: 400;
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  line-height: 1.6;
  color: rgba(242,242,242,0.78);
  max-width: 30ch;
  font-style: italic;
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
}

/* hide scrollbar but keep scrolling */
.sky::-webkit-scrollbar {
  width: 0;
  background: transparent;
}
.sky {
  scrollbar-width: none;
}

/* ============================================================
   RESPONSIVE — collapse to vertical on small screens
   ============================================================ */
@media (max-width: 720px) {

  body {
    overflow-y: auto;
  }

  .grid {
    grid-template-columns: 1fr;
    grid-template-rows: 38vh 62vh;
    height: 100vh;
  }

  .shrine {
    height: 38vh;
  }

  .shrine-inner {
    padding: 1.4rem 1.2rem;
    gap: 0.9rem;
  }

  .wordmark {
    font-size: clamp(2.2rem, 9vw, 3.4rem);
  }

  .declaration {
    font-size: 0.85rem;
  }

  .diary-card {
    padding: 0.85rem 0.95rem 0.7rem;
    border-radius: 10px;
  }

  .diary-row {
    font-size: 0.7rem;
    padding: 0.35rem 0.05rem;
  }

  .diary-header {
    font-size: 0.6rem;
    letter-spacing: 0.14em;
  }

  .diary-footer {
    font-size: 0.55rem;
    padding-top: 0.55rem;
  }

  .shrine-foot {
    display: none;
  }

  .separator {
    top: 38vh;
    left: 0;
    width: 100vw;
    height: 16px;
    transform: translateY(-8px);
  }

  .separator-path {
    /* rotate by reusing same path - simpler: hide on mobile */
    display: none;
  }

  .sky {
    height: 62vh;
  }

  .photo-stack,
  .rain,
  .frost,
  .bloom-layer {
    position: absolute;
    top: 38vh;
    left: 0;
    width: 100vw;
    height: 62vh;
  }

  .scroll-marker {
    height: 62vh;
  }
}

/* ============================================================
   REDUCED-MOTION — degrade to static beauty
   ============================================================ */
@media (prefers-reduced-motion: reduce) {

  .separator-path {
    animation: none;
    stroke-dashoffset: 0;
    stroke-width: 1;
  }

  .trail {
    animation: none;
    stroke-dashoffset: 0;
    opacity: 0.4;
  }

  .bloom {
    animation: none;
    opacity: 0.4;
  }

  .photo {
    transition: none;
  }
}
