/* ==========================================================================
   Loving Daily Reminders
   Warm editorial minimalism: analog journal meets handcrafted hardware.

   Z-index scale (systemic layers only):
     1   #hardware-3d-canvas   fixed WebGL stage
     2   main content sections
     50  .site-nav
     59  .vignette
     60  .grain
     100 .loader
   ========================================================================== */

:root {
  --bg:      #EDE0D2;   /* warm beige */
  --ink:     #3A1E10;   /* dark chocolate */
  --accent:  #C28055;   /* caramel / sienna */
  --muted:   #7A5D4A;
  --trim:    #D4C0AE;

  --dark-bg:    #311807;
  --dark-ink:   #EDE0D2;
  --dark-muted: #C8B09D;
  --dark-trim:  rgba(237, 224, 210, 0.18);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Nunito', system-ui, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);

  --gutter: clamp(1.25rem, 6vw, 6rem);
}

/* ------------------------------------------------------------------ reset */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, p, blockquote, figure, ol { margin: 0; }

ol { padding: 0; list-style: none; }

a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 110;
  padding: 0.6rem 1.2rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

::selection { background: var(--accent); color: var(--bg); }

/* ------------------------------------------------------------- atmosphere */

.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 280px 280px;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 59;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 38%,
              transparent 55%,
              rgba(58, 30, 16, 0.10) 100%);
}

/* ----------------------------------------------------------------- loader */

.loader {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.boot .loader { display: flex; }

/* Pure-CSS failsafe: if scripts never dismiss the veil, it lifts itself.
   Kept outside the reduced-motion kill block on purpose. */
.boot .loader { animation: loader-bail 0.6s ease 9s forwards; }

@keyframes loader-bail {
  to { opacity: 0; visibility: hidden; }
}

.loader.done {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s var(--ease-out), visibility 0s 0.7s;
}

.loader-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.loader-brand em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 2.4rem;
  line-height: 1.1;
  padding-bottom: 0.12em;
}
.loader-brand span {
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

.loader-track {
  width: 170px;
  height: 2px;
  background: var(--trim);
  overflow: hidden;
}
.loader-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.loader-pct {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------------------------------------ WebGL stage */

#hardware-3d-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  display: block;
}

.no-3d #hardware-3d-canvas { display: none; }

/* --------------------------------------------------------------- nav bar */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.site-nav.is-scrolled {
  background: rgba(237, 224, 210, 0.84);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(58, 30, 16, 0.08);
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.05;
}
.brand-word {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.5rem;
  padding-bottom: 0.1em;
}
.brand-sub {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

/* -------------------------------------------------------------- buttons */
/* Shape system: interactive elements are pills; paper surfaces
   (polaroids, photos) keep near-sharp 2px corners. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 0.85rem 1.9rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.25s var(--ease-out),
              background-color 0.25s ease,
              color 0.25s ease,
              border-color 0.25s ease;
}
.btn:active { transform: translateY(1px) scale(0.98); }

.btn-solid {
  background: var(--ink);
  color: var(--bg);
}
.btn-solid:hover { background: #4d2a17; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--trim);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-nav {
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 1.4rem;
  font-size: 0.72rem;
}
.btn-nav:hover { background: #4d2a17; }

/* ----------------------------------------------------- kinetic type masks */

.mask {
  display: block;
  overflow: hidden;
  /* Reserve for italic descenders (y g j p q) so the overflow clip
     never amputates them. */
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

.mask-line {
  display: block;
  will-change: transform;
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
  align-items: center;
  padding: 5.5rem var(--gutter) 4rem;
}

.hero-copy { max-width: 42rem; }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.6rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 5.2vw, 4.6rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.hero-title .line-accent,
.manifesto-title .line-accent,
.follow-title .line-accent {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  margin-top: 1.8rem;
  max-width: 30rem;
  font-weight: 300;
  font-size: 1.05rem;
  color: var(--muted);
}

.hero-actions {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.hero-device-fallback {
  display: none;
  justify-self: center;
  align-self: center;
}
.hero-device-fallback img {
  width: min(280px, 64vw);
  filter: drop-shadow(0 24px 40px rgba(58, 30, 16, 0.22));
  animation: float-loop 5.5s ease-in-out infinite;
}

@keyframes float-loop {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* Show the flat render when the WebGL stage is off. */
.no-3d .hero-device-fallback { display: flex; }

/* --------------------------------------------------------------- product */

.product {
  position: relative;
  z-index: 2;
  padding: 4rem 0;
}

.beat-slot {
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
}

.feature-beat {
  width: min(24rem, 38%);
  will-change: transform, opacity;
}
.beat-left  { margin-right: auto; }
.beat-right { margin-left: auto; text-align: right; }

.beat-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.15;
}

.beat-body {
  margin-top: 1rem;
  font-weight: 300;
  color: var(--muted);
}

/* ------------------------------------------------- memories: polaroid spine */

.memories {
  position: relative;
  z-index: 2;
  min-height: 230vh;
  padding-bottom: 14vh;
}

.memory-rails {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.polaroid-col {
  position: absolute;
  width: clamp(170px, 21vw, 300px);
  display: flex;
  flex-direction: column;
  gap: 9vh;
  will-change: transform;
}
.polaroid-col-left  { left: 4vw;  top: -6vh; }
.polaroid-col-right { right: 4vw; top: 14vh; }

.polaroid {
  background: #FBF5EC;
  padding: 10px 10px 38px;
  border-radius: 2px;
  box-shadow: 0 14px 34px rgba(58, 30, 16, 0.18);
  transform: rotate(var(--tilt, 0deg));
  margin-top: var(--drift, 0);
}
.polaroid img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 1px;
}
.polaroid figcaption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--muted);
  text-align: center;
  margin-top: 9px;
  line-height: 1.2;
}

.manifesto {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0 var(--gutter);
}

.manifesto-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.6vw, 3.8rem);
  line-height: 1.18;
  text-align: center;
  max-width: 18ch;
}

.manifesto-line { display: block; padding-bottom: 0.1em; }

.manifesto-line .ch { display: inline; }

/* --------------------------------------------------------- the dark act */
/* One deliberate shift into evening for About, Timeline and Follow.
   Entered through a curved cap that GSAP flattens on approach. */

.act-dark {
  position: relative;
  z-index: 2;
  background: var(--dark-bg);
  color: var(--dark-ink);
  margin-top: 9rem;
}

.act-cap {
  position: absolute;
  bottom: 100%;
  left: -4%;
  width: 108%;
  height: 130px;
  background: var(--dark-bg);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transform-origin: center bottom;
  will-change: transform;
}

.act-dark ::selection { background: var(--accent); color: var(--dark-bg); }

/* ----------------------------------------------------------------- about */

.about {
  position: relative;
  padding: clamp(6rem, 14vh, 10rem) var(--gutter);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 11fr);
  column-gap: clamp(2rem, 6vw, 6rem);
  row-gap: 4rem;
  align-items: start;
}

/* The left flank stays open: the device floats here mid-scroll. */
.about-device-space {
  grid-column: 1;
  grid-row: 2;
  min-height: 46vh;
}

.about-words {
  grid-column: 2;
  grid-row: 1;
  max-width: 34rem;
  padding-top: 6vh;
}

.founders-quote {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.7rem, 3.4vw, 2.7rem);
  line-height: 1.3;
  padding-bottom: 0.12em;
}

.founders-quote .word {
  display: inline-block;
  will-change: transform, opacity;
}

.founders-id { margin-top: 2.4rem; }

.founders-names {
  font-weight: 600;
  letter-spacing: 0.06em;
}

.founders-line {
  color: var(--dark-muted);
  font-weight: 300;
  font-size: 0.95rem;
}

.founders-body {
  margin-top: 1.4rem;
  color: var(--dark-muted);
  font-weight: 300;
  max-width: 28rem;
}

.founders-photo {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  align-self: start;
  width: min(340px, 80%);
  margin-left: 1.5rem;
  background: #FBF5EC;
  padding: 10px 10px 14px;
  border-radius: 2px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
  transform: rotate(-2.5deg);
}
.founders-photo img {
  width: 100%;
  border-radius: 1px;
}
.founders-photo figcaption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
  line-height: 1.2;
}

/* -------------------------------------------------------------- timeline */

.timeline {
  padding: clamp(5rem, 12vh, 9rem) var(--gutter) clamp(5rem, 12vh, 9rem);
}

.timeline-head {
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  line-height: 1.12;
}

.section-sub {
  margin-top: 1rem;
  color: var(--dark-muted);
  font-weight: 300;
}

.timeline-body {
  position: relative;
  margin: 4.5rem auto 0;
  max-width: 56rem;
  padding: 0 1.5rem;
}

.spine {
  position: absolute;
  left: 50%;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  transform: translateX(-50%);
  background: var(--dark-trim);
}
.spine-fill {
  position: absolute;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--accent);
  transform-origin: top center;
  will-change: transform;
}

/* Hidden starting states exist only while the GSAP choreography is
   actually running (html.anim is set by JS); every other context gets
   the resolved resting state. */
html.anim .spine-fill { transform: scaleY(0); }

.milestones {
  display: grid;
  gap: 3.2rem;
}

.milestone {
  position: relative;
  width: 100%;
}

.milestone::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0.45rem;
  transform: translateX(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--dark-bg);
  border: 1px solid var(--dark-muted);
  transition: transform 0.6s var(--ease-pop), background-color 0.3s ease;
}
html.anim .milestone:not(.is-in)::before { transform: scale(0); }

.milestone[data-state="done"]::before { background: var(--dark-muted); }
.milestone[data-state="now"]::before  { background: var(--accent); border-color: var(--accent); }

.milestone[data-state="now"] .milestone-title { color: var(--accent); }

.milestone-date,
.milestone-title,
.milestone-body {
  width: min(28rem, calc(50% - 3rem));
}

.milestone {
  display: grid;
  gap: 0.35rem;
}

.milestone:nth-child(odd) {
  text-align: right;
}

.milestone:nth-child(odd) .milestone-date,
.milestone:nth-child(odd) .milestone-title,
.milestone:nth-child(odd) .milestone-body {
  margin-left: auto;
  padding-right: 3rem;
}

.milestone:nth-child(even) {
  text-align: left;
}

.milestone:nth-child(even) .milestone-date,
.milestone:nth-child(even) .milestone-title,
.milestone:nth-child(even) .milestone-body {
  margin-right: auto;
  padding-left: 3rem;
}

.milestone-date {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--dark-muted);
}

.milestone-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.55rem;
  line-height: 1.2;
  margin-top: 0.4rem;
}

.milestone-body {
  margin-top: 0.4rem;
  font-weight: 300;
  color: var(--dark-muted);
  max-width: 32rem;
}

/* ---------------------------------------------------------------- follow */

.follow {
  padding: clamp(5rem, 12vh, 9rem) var(--gutter) clamp(6rem, 14vh, 10rem);
  text-align: center;
}

.follow-title {
  max-width: 28ch;
  margin-left: auto;
  margin-right: auto;
  white-space: nowrap;
}

.follow-sub {
  margin-top: 1.4rem;
  max-width: 30rem;
  margin-left: auto;
  margin-right: auto;
  color: var(--dark-muted);
  font-weight: 300;
}

.social-rows {
  margin: 3.5rem auto 0;
  width: min(46rem, 100%);
  border-top: 1px solid var(--dark-trim);
}

.social-row {
  width: 100%;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.7rem 1rem;
  border-bottom: 1px solid var(--dark-trim);
  text-decoration: none;
  overflow: hidden;
}

/* Warm left-sweep underlay on hover. */
.social-row::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(194, 128, 85, 0.14);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease-out);
}
.social-row:hover::before,
.social-row:focus-visible::before { transform: scaleX(1); }

.social-row > * { position: relative; }

.social-name {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
}

.social-handle {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--dark-muted);
}

.social-arrow {
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.35s var(--ease-out);
}
.social-row:hover .social-arrow,
.social-row:focus-visible .social-arrow {
  transform: translate(4px, -4px);
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 2.2rem var(--gutter) 2.6rem;
  border-top: 1px solid var(--dark-trim);
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--dark-muted);
}

.footer-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--dark-ink);
  padding-bottom: 0.1em;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1024px) {
  .feature-beat { width: min(22rem, 46%); }
  .polaroid-col { width: clamp(150px, 19vw, 240px); }
}

@media (max-width: 767px) {

  /* The WebGL theatre is off below 768px; everything resolves to a
     clean single column. */

  .hero {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding-top: 6.5rem;
    text-align: left;
  }
  .hero-device-fallback { display: flex; }

  .beat-slot {
    min-height: 0;
    padding: 3.5rem var(--gutter);
  }
  .feature-beat,
  .beat-left,
  .beat-right {
    width: 100%;
    margin: 0;
    text-align: left;
  }

  .memories { min-height: 0; padding-bottom: 6rem; }

  /* Rails become a static, humanly scattered two-column collage. */
  .memory-rails {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    padding: 0 var(--gutter);
  }
  .polaroid-col {
    position: static;
    width: auto;
    gap: 1.6rem;
  }
  .polaroid-col-right { margin-top: 3rem; }

  .manifesto {
    position: static;
    min-height: 0;
    padding-top: 5rem;
  }

  .act-dark { margin-top: 6rem; }
  .act-cap { height: 64px; }

  .about-grid { grid-template-columns: 1fr; }
  .about-device-space { display: none; }
  .about-words { grid-column: 1; grid-row: 1; padding-top: 0; }
  .founders-photo {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    width: min(320px, 86%);
  }

  .timeline-body {
    max-width: 100%;
    padding: 0 var(--gutter);
  }

  .spine,
  .spine-fill,
  .milestone::before {
    left: 1.2rem;
    transform: none;
  }

  .milestone:nth-child(odd),
  .milestone:nth-child(even) {
    text-align: left;
  }

  .milestone-date,
  .milestone-title,
  .milestone-body {
    width: auto;
    margin: 0;
    padding: 0 0 0 3rem;
  }

  .social-row {
    grid-template-columns: 1fr auto;
  }
  .social-handle { display: none; }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* -------------------------------------------------------- reduced motion */
/* Everything resolves to its clean, static, readable resting state.
   GSAP triggers, the WebGL scroll bindings and the rail translations are
   all skipped in JS when this query matches; the rules below cover the
   pure-CSS movers. The loader failsafe animation is deliberately
   left alive. */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .hero-device-fallback img { animation: none; }

  .polaroid { transform: none; margin-top: 0; }
  .founders-photo { transform: none; }

  .act-cap { transform: scaleY(0.25); }

  .spine-fill { transform: scaleY(1); }
  .milestone::before,
  .milestone.is-in::before { transform: scale(1); transition: none; }

  .social-row::before { transition: none; }
  .social-arrow { transition: none; }
  .btn { transition: none; }
  .btn:active { transform: none; }
}
