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

:root {
  --white:        #ffffff;
  --lime-light:   #ebffc2;
  --lime:         #d3ff7c;
  --olive-dark:   #404339;
  --dark-badge:   #232520;
  --bar-task:     #d3ff7c;
  --bar-time:     #434549;
  --gray-mid:     #888880;
  --gray-light:   #d8d5cc;
  --black:        #0f0f0d;
  --input-bg:     #f6f9f2;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Instrument Sans', sans-serif;
  background: var(--white);
  color: var(--black);
  font-weight: 300;
  overflow-x: hidden;
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.25;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* ─── STICKY TIME ─── */
.sticky-time {
  position: fixed;
  top: 24px;
  right: 32px;
  z-index: 100;
  display: flex;
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.3s ease, visibility 0.3s ease;
}
.sticky-time.visible { opacity: 1; visibility: visible; }
.sticky-time:hover { transform: scale(1.06); }
.sticky-time-shadow {
  position: absolute;
  top: 5px; left: 5px; right: -5px; bottom: -5px;
  background: var(--lime);
  border: 1px solid var(--black);
  transform: rotate(-2deg);
}
.sticky-time-inner {
  position: relative;
  background: var(--white);
  border: 1px solid var(--black);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sticky-time-inner span {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  color: var(--gray-mid);
}
.sticky-colon {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  color: var(--gray-mid);
  margin: 0 2px;
}

/* ─── HERO ─── */
.hero {
  position: relative;
  min-height: 873px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 72px 64px 80px;
  overflow: hidden;
}

.hero-spiral {
  position: absolute;
  left: 0;
  top: 337px;
  width: 536px;
  height: 536px;
  object-fit: contain;
  pointer-events: none;
}

.hero-title-row {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 18px;
  margin-top: 4px;
}

.hero-title-row .hero-title {
  grid-column: 2;
  margin-top: 0;
}

.hero-balloon {
  grid-column: 3;
  justify-self: start;
  width: 120px;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

/* Slow left-right sway for hero art */
.hero-spiral,
.hero-balloon {
  will-change: transform;
  animation: heroSwayX 7.5s ease-in-out infinite alternate;
}

.hero-balloon {
  animation-duration: 6.5s;
  animation-direction: alternate-reverse;
}

@keyframes heroSwayX {
  from { transform: translateX(-8px); }
  to   { transform: translateX(8px); }
}

.hero-eyebrow {
  font-family: 'Instrument Serif', serif;
  font-size: 48px;
  font-weight: 300;
  text-align: center;
  color: var(--black);
  line-height: 1.1;
  position: relative;
  z-index: 2;
}

.hero-title {
  font-family: 'Instrument Serif', serif;
  font-size: 128px;
  font-weight: 400;
  text-align: center;
  letter-spacing: 2.56px;
  color: var(--black);
  line-height: 1;
  margin-top: 4px;
  position: relative;
  z-index: 2;
}

/* Input widget punch-in (triggered on DOMContentLoaded) */
.input-widget-wrapper {
  will-change: opacity, transform;
  opacity: 0;
  transform: scale(0.85);
}

body.hero-loaded .input-widget-wrapper {
  animation: inputPunchIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}

@keyframes inputPunchIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .input-widget-wrapper {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-spiral,
  .hero-balloon {
    animation: none !important;
    transform: none !important;
  }
}

.hero-bottom {
  margin-top: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  position: relative;
  z-index: 10;
  justify-content: center;
}

/* Time breakdown — below input */
.time-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bd-row {
  font-family: 'Instrument Serif', serif;
  font-size: 20px;
  font-weight: 300;
  color: var(--gray-mid);
  white-space: nowrap;
}

.bd-row .bd-val {
  color: var(--black);
  font-variant-numeric: tabular-nums;
}

/* Input column */
.input-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Input widget */
.input-widget-wrapper {
  position: relative;
}

.input-shadow {
  position: absolute;
  top: 8px; left: 8px; right: -8px; bottom: -8px;
  background: var(--lime);
  border: 1px solid var(--black);
  transform: rotate(-2.49deg) skewX(-0.88deg);
  pointer-events: none;
}

.input-widget {
  position: relative;
  background: var(--white);
  border: 1px solid var(--black);
  padding: 18px 38px;
  display: flex;
  gap: 28px;
  align-items: center;
}

.time-field {
  background: var(--input-bg);
  font-family: 'Instrument Serif', serif;
  font-size: 48px;
  color: var(--gray-mid);
  padding: 7px 0;
  width: 180px;
  border: none;
  outline: none;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.time-field::-webkit-inner-spin-button,
.time-field::-webkit-outer-spin-button { -webkit-appearance: none; }
.time-field::placeholder { color: var(--gray-mid); opacity: 0.4; }

.colon-sep {
  font-family: 'Instrument Serif', serif;
  font-size: 48px;
  color: var(--gray-mid);
  line-height: 1;
  user-select: none;
}

.arrow-btn {
  width: 68px;
  height: 68px;
  border: 1px solid #999;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--gray-mid);
  cursor: pointer;
  font-family: serif;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.5s ease;
}
.arrow-btn:hover { background: var(--input-bg); }
.arrow-btn.pointing-down { transform: rotate(-270deg); }

/* Zero state */
.zero-placeholder {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--gray-mid);
  font-weight: 300;
  text-align: center;
  margin-top: 8px;
}

/* Input hint — visible before first focus, fades out on focus */
.input-hint {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px;
  color: #888880;
  text-align: center;
  margin-top: 16px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.input-hint.hint-hidden {
  opacity: 0;
  visibility: hidden;
}

/* ─── COMPARISON SECTIONS ─── */
.comparison-sections {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}
.comparison-sections.gate-open {
  opacity: 1;
  visibility: visible;
}

/* ─── SECTION WRAPPER (for daily/weekly/yearly) ─── */
.section-block {
  position: relative;
  padding: 64px 64px 80px;
}

.section-heading {
  font-family: 'Instrument Serif', serif;
  font-size: 72px;
  line-height: 76px;
  letter-spacing: -1.44px;
  text-align: center;
  color: var(--black);
  margin-bottom: 72px;
  max-width: 900px;
  font-weight: 300;
  margin-left: auto;
  margin-right: auto;
}
.section-heading em { font-style: italic; }

.section-spiral {
  position: absolute;
  right: -80px;
  top: 80px;
  width: 420px;
  pointer-events: none;
  opacity: 0.9;
}
.section-spiral.rotated { transform: rotate(-3deg); }

/* ─── CARDS CONTAINER ─── */
.cards-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 144px;
}

/* ─── CARD SIDE IMAGES ─── */
.card-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.card-side-img {
  position: absolute;
  width: 280px;
  height: auto;
  filter: grayscale(100%);
  opacity: 0.85;
  top: 50%;
  pointer-events: none;
  will-change: transform;
  user-select: none;
}

/* negative left/right escape section-block's 64px padding to reach the viewport edge */
.card-img-left {
  left: -52px;
  transform: translateX(-30%) translateY(-50%);
}

.card-img-right {
  right: -52px;
  transform: translateX(30%) translateY(-50%);
}

@media (max-width: 900px) {
  .card-side-img { width: 180px; }
}

@media (max-width: 540px) {
  /* section-block padding is 32px at this breakpoint */
  .card-img-left  { left:  -20px; }
  .card-img-right { right: -20px; }
  .card-side-img  { width: 120px; }
}

/* ─── COMPARISON CARD ─── */
.comparison-card {
  width: 654px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 0;
  width: 654px;
}
.card-top.left  { flex-direction: row; }
.card-top.right { flex-direction: row; }

.card-text-block {
  width: 407px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card-text-block.right {
  text-align: right;
}

.activity-title {
  font-family: 'Instrument Serif', serif;
  font-size: 36px;
  line-height: 42px;
  color: var(--black);
  font-weight: 300;
}

.activity-body {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 16px;
  color: var(--gray-mid);
  letter-spacing: -0.5px;
  line-height: 1.25;
  font-weight: 300;
}

/* Badge */
.badge-wrapper {
  width: 235px;
  flex-shrink: 0;
  padding: 12px 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.badge-box {
  background: var(--dark-badge);
  padding: 12px 16px;
  text-align: center;
  min-width: 140px;
  --badge-rot: 0deg;
  transform: rotate(var(--badge-rot)) scale(0);
}
.badge-box.rot-left  { --badge-rot:  6deg; }
.badge-box.rot-right { --badge-rot: -6deg; }

.badge-num {
  font-family: 'Instrument Serif', serif;
  font-size: 64px;
  color: var(--lime);
  letter-spacing: -1.28px;
  line-height: 1;
  display: inline;
}

.badge-unit {
  font-family: 'Instrument Serif', serif;
  font-size: 36px;
  color: var(--lime);
  letter-spacing: -1.28px;
  line-height: 1;
  display: inline;
}

/* ─── BADGE STAMP ANIMATION ─── */
@keyframes badge-stamp {
  0%   { transform: rotate(var(--badge-rot)) scale(0);    }
  50%  { transform: rotate(var(--badge-rot)) scale(1.1);  }
  70%  { transform: rotate(var(--badge-rot)) scale(0.9);  }
  85%  { transform: rotate(var(--badge-rot)) scale(1.03); }
  100% { transform: rotate(var(--badge-rot)) scale(1);    }
}
.badge-box.stamped {
  animation: badge-stamp 0.5s ease-out forwards;
}

/* ─── BAR CHART CARD ─── */
.bar-card {
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  width: 654px;
  padding: 24px 0;
  overflow: hidden; /* bars must never escape the card */
}

.bar-row {
  display: flex;
  align-items: center;
  padding: 8px 24px;
  gap: 19px;
}
.bar-row.right {
  justify-content: flex-end;
}

.bar-label {
  width: 150px;
  flex-shrink: 0;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 16px;
  color: var(--black);
  line-height: 1.3;
  word-spacing: -0.36px;
}
.bar-row.right .bar-label {
  text-align: right;
  order: 2;
}
.bar-row.right .bar {
  order: 1;
}

.bar {
  height: 20px;
  border: 1px solid var(--black);
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  flex-shrink: 0;
}
.bar.task { background: var(--bar-task); }
.bar.time { background: var(--bar-time); }

/* Collage placeholder boxes */
.collage-placeholder {
  width: 508px;
  height: 437px;
  border: 1px solid var(--gray-light);
  border-radius: 4px;
  flex-shrink: 0;
  margin: 0 auto;
}
.collage-placeholder.white { background: var(--white); }
.collage-placeholder.lime-light { background: var(--lime-light); }

/* ─── AND FINALLY ─── */
.section-finally-outer {
  overflow: hidden;
}

.section-finally {
  padding: 100px 64px 120px;
  position: relative;
  transform: rotate(2deg);
  transform-origin: center center;
  overflow: visible;
}

.finally-heading {
  font-family: 'Instrument Serif', serif;
  font-size: 128px;
  color: var(--white);
  text-align: center;
  letter-spacing: -2.56px;
  line-height: 76px;
  margin-bottom: 80px;
  padding-top: 24px;
  font-weight: 300;
}

.finally-badge-row {
  display: flex;
  justify-content: center;
  margin-bottom: 72px;
}

.finally-badge {
  background: var(--dark-badge);
  width: 378px;
  padding: 20px 24px;
  text-align: center;
  transform: rotate(-6deg);
}

.finally-num {
  font-family: 'Instrument Serif', serif;
  font-size: 96px;
  color: var(--lime);
  line-height: 1;
  display: inline;
}

.finally-unit {
  font-family: 'Instrument Serif', serif;
  font-size: 64px;
  color: var(--lime);
  line-height: 1;
  display: inline;
  font-weight: 300;
}

.finally-sub {
  font-family: 'Instrument Serif', serif;
  font-size: 72px;
  color: var(--white);
  text-align: center;
  line-height: 1.1;
}

.finally-spiral {
  position: absolute;
  left: -200px;
  top: 50%;
  transform: translateY(-50%) rotate(-45.22deg);
  width: 480px;
  pointer-events: none;
  opacity: 0.85;
}

/* ─── CLOSER ─── */
.section-closer {
  height: 740px;
  position: relative;
  overflow: hidden;
}

.closer-t1 {
  font-family: 'Instrument Serif', serif;
  font-size: 48px;
  color: var(--black);
  position: absolute;
  left: 25%;
  top: 152px;
  white-space: nowrap;
}

.closer-t2 {
  font-family: 'Instrument Serif', serif;
  font-size: 48px;
  color: var(--black);
  position: absolute;
  right: 25%;
  top: 272px;
  white-space: nowrap;
}

.closer-bar {
  position: absolute;
  width: 959px;
  left: 50%;
  transform: translateX(-50%);
  top: 450px;
  background: var(--lime);
  border: 1px solid var(--black);
  padding: 12px 0 16px;
  text-align: center;
  z-index: 2;
}

.closer-bar-text {
  font-family: 'Instrument Serif', serif;
  font-size: 96px;
  text-decoration: underline;
  color: var(--black);
  text-align: center;
  line-height: 1;
  letter-spacing: -1.92px;
}

.closer-today {
  font-family: 'Instrument Serif', serif;
  font-size: 48px;
  color: var(--black);
  position: absolute;
  right: 8%;
  top: 588px;
  white-space: nowrap;
}

/* ─── SCROLL REVEAL ANIMATIONS ─── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* .closer-bar is centered via translateX(-50%), so the reveal transforms must include it */
.closer-bar.reveal   { transform: translateX(-50%) translateY(24px); }
.closer-bar.revealed { transform: translateX(-50%) translateY(0); }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .hero-title { font-size: 72px; }
  .hero-eyebrow { font-size: 32px; }
  .hero-bottom { gap: 24px; }
  .hero-spiral { width: 280px; height: 280px; }
  .hero-balloon { width: 88px; }
  .section-heading { font-size: 48px; line-height: 54px; }
  .comparison-card, .bar-card { width: 90vw; max-width: 654px; }
  .bar-card { width: 90vw; max-width: 654px; }
  .card-top { width: 90vw; max-width: 654px; }
  .card-text-block { width: 100%; }
  .finally-heading { font-size: 72px; }
  .closer-bar { width: 95vw; }
  .closer-bar-text { font-size: 48px; }
  .input-widget { padding: 14px 20px; }
  .time-field { width: 120px; font-size: 36px; }
}

/* ─── MOBILE ─── */
@media (max-width: 540px) {
  /* Hero — extra top breathing room; more space before comparison sections */
  .hero {
    padding: 96px 32px 88px;
    min-height: auto;
  }
  .hero-spiral {
    width: 180px;
    height: 180px;
    top: auto;
    bottom: -20px;
    opacity: 0.3;
  }
  .hero-eyebrow { font-size: 22px; }
  .hero-title { font-size: 58px; letter-spacing: 1.2px; }
  .hero-title-row { gap: 12px; }
  .hero-balloon { width: 64px; }
  .hero-bottom { margin-top: 32px; gap: 20px; }

  /* Input widget */
  .input-widget { padding: 12px 16px; gap: 10px; }
  .time-field { width: 76px; font-size: 30px; }
  .colon-sep { font-size: 30px; }
  .arrow-btn { width: 48px; height: 48px; font-size: 22px; }
  .zero-placeholder { font-size: 16px; }
  .bd-row { font-size: 16px; }

  /* Sticky time */
  .sticky-time { top: 14px; right: 14px; }
  .sticky-time-inner { padding: 8px 12px; gap: 6px; }
  .sticky-time-inner span, .sticky-colon { font-size: 20px; }

  /* Section blocks — more vertical rhythm between daily / weekly / yearly */
  .section-block { padding: 72px 32px 88px; }

  /* Space between yearly block and “And FINALLY” */
  .section-finally-outer {
    margin-top: 32px;
  }
  .section-heading {
    font-size: 30px;
    line-height: 36px;
    letter-spacing: -0.3px;
    margin-bottom: 40px;
  }
  .section-spiral { display: none; }
  .cards-container { gap: 84px; }

  /* Cards — stack vertically */
  .comparison-card { width: 100%; }
  .card-top {
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
  }
  .card-top.left  { flex-direction: row; }
  .card-top.right { flex-direction: row; }
  .card-text-block {
    width: auto;
    flex: 1;
    min-width: 0; /* prevent flex overflow that clips the badge */
  }
  .badge-wrapper { width: min(180px, 42vw); padding: 8px 0; }
  /* Keep rotation direction consistent with desktop, just smaller magnitude */
  .badge-box.rot-left  { --badge-rot:  3deg; }
  .badge-box.rot-right { --badge-rot: -3deg; }
  .activity-title { font-size: 22px; line-height: 28px; }
  .activity-body { font-size: 14px; }
  .badge-num { font-size: 48px; }
  .badge-unit { font-size: 28px; }

  /* Bar card */
  .bar-card { width: 100%; }
  .bar-label { width: 90px; font-size: 12px; }

  /* Finally */
  .section-finally { padding: 88px 32px 96px; transform: rotate(1deg); }
  .finally-heading {
    font-size: 52px;
    line-height: 56px;
    letter-spacing: -1px;
    margin-bottom: 48px;
    padding-top: 16px;
  }
  .finally-badge { width: auto; min-width: 220px; }
  .finally-num { font-size: 64px; }
  .finally-unit { font-size: 40px; }
  .finally-sub { font-size: 40px; }
  .finally-spiral { display: none; }

  /* Closer — switch absolute-positioned elements to flow layout */
  .section-closer {
    height: auto;
    padding: 168px 32px 168px;
    display: flex;
    flex-direction: column;
    overflow: visible; /* base style has overflow:hidden which clips the in-flow bar */
  }
  .closer-t1 {
    position: relative;
    left: auto;
    top: auto;
    font-size: 30px;
    white-space: normal;
    margin-bottom: 14px;
    text-align: left;
  }
  .closer-t2 {
    position: relative;
    right: auto;
    top: auto;
    font-size: 30px;
    white-space: normal;
    margin-bottom: 24px;
    text-align: right;
  }
  .closer-bar {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    margin-bottom: 24px;
  }
  /* Override the desktop reveal transforms — bar is now in flow, not translateX(-50%) centered */
  .closer-bar.reveal   { transform: translateY(24px); }
  .closer-bar.revealed { transform: translateY(0); }
  .closer-bar-text { font-size: 26px; letter-spacing: -0.5px; }
  .closer-today {
    position: relative;
    right: auto;
    top: auto;
    font-size: 30px;
    white-space: normal;
    text-align: right;
  }
}

/* ─── FOOTER ─── */
.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 20px 60px;
  border-top: 1px solid var(--gray-light);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12px;
  color: var(--gray-mid);
  text-align: center;
}

.footer-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-icon-link {
  display: flex;
  align-items: center;
  padding: 0 6px;
  color: var(--gray-mid);
  opacity: 0.6;
  transition: opacity 0.2s;
}
.footer-icon-link:hover { opacity: 1; }

@media (max-width: 540px) {
  .site-footer {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    text-align: center;
  }
}

/* ─── NAV HINT ─── */
.nav-hint {
  position: fixed;
  bottom: 32px;
  left: 48px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px;
  color: var(--gray-mid);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 50;
}
.nav-hint.visible { opacity: 1; }

.nav-key {
  font-family: monospace;
  font-size: 12px;
  color: var(--gray-mid);
  border: 1px solid var(--gray-light);
  border-radius: 4px;
  padding: 2px 6px;
  background: transparent;
  font-style: normal;
}

@media (max-width: 768px) {
  .nav-hint { display: none; }
}
