:root {
  color-scheme: light;
  --ink: #243042;
  --muted: #687080;
  --paper: #fffdf5;
  --sun: #ffd166;
  --rose: #ef476f;
  --mint: #38b690;
  --sky: #5aa9e6;
  --violet: #7c6ee6;
  --line: rgba(36, 48, 66, 0.14);
  --shadow: 0 20px 50px rgba(74, 60, 30, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #fff7d6;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(239, 71, 111, 0.18), transparent 24%),
    radial-gradient(circle at 84% 14%, rgba(90, 169, 230, 0.22), transparent 26%),
    linear-gradient(135deg, #fff7d6 0%, #f8fbff 45%, #fff1f5 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 4px;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 28px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header {
  min-height: 56px;
  margin-bottom: 42px;
}

.brand,
.personal-home-link {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  min-width: 0;
  font-weight: 800;
}

.brand span:last-child {
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--sun);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.personal-home-link {
  min-height: 46px;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 253, 245, 0.82);
  box-shadow: 4px 4px 0 var(--sky);
  color: var(--ink);
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.personal-home-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--sky);
}

.portal-icon {
  position: relative;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--sun);
}

.portal-icon::before,
.portal-icon::after {
  position: absolute;
  content: "";
  background: var(--ink);
}

.portal-icon::before {
  width: 10px;
  height: 2px;
  top: 9px;
  left: 8px;
  transform: rotate(-35deg);
}

.portal-icon::after {
  width: 7px;
  height: 7px;
  top: 6px;
  right: 7px;
  border-top: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
  background: transparent;
}

.portal-copy {
  display: grid;
  gap: 2px;
  line-height: 1.05;
}

.portal-copy span:first-child {
  font-size: 14px;
}

.portal-copy span:last-child {
  color: #5b6473;
  font-size: 10px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  gap: 34px;
  align-items: center;
  min-height: calc(100vh - 180px);
  padding-bottom: 38px;
}

.eyebrow,
.panel-label {
  margin: 0 0 12px;
  color: #9f3151;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: 72px;
  line-height: 1.04;
  letter-spacing: 0;
  white-space: nowrap;
}

.hero-text {
  max-width: 660px;
  margin: 22px 0 0;
  color: #425066;
  font-size: 18px;
  line-height: 1.78;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-action {
  background: var(--rose);
  color: white;
  box-shadow: 5px 5px 0 var(--ink);
}

.secondary-action {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--sun);
}

.primary-action:hover,
.secondary-action:hover {
  transform: translate(-2px, -2px);
}

.copy-status {
  min-height: 26px;
  margin: 16px 0 0;
  color: #315b48;
  font-weight: 800;
}

.friend-dialog {
  width: min(520px, calc(100% - 28px));
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0;
  background: var(--paper);
  box-shadow: var(--shadow), 8px 8px 0 var(--sun);
  color: var(--ink);
}

.friend-dialog::backdrop {
  background: rgba(36, 48, 66, 0.34);
  backdrop-filter: blur(3px);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: white;
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.friend-form {
  display: grid;
  gap: 16px;
  padding: 30px;
}

.friend-form h2 {
  margin: 0;
  padding-right: 48px;
  font-size: 28px;
  line-height: 1.2;
}

.friend-dialog-copy {
  margin: 0;
  color: #425066;
  line-height: 1.75;
}

.friend-dialog-copy span {
  display: block;
  margin-top: 4px;
  color: rgba(66, 80, 102, 0.68);
}

.form-field {
  display: grid;
  gap: 8px;
  font-weight: 900;
}

.form-field input {
  min-height: 46px;
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.dialog-submit {
  width: 100%;
}

.dialog-status {
  min-height: 24px;
  margin: 0;
  color: #9f3151;
  font-weight: 800;
  line-height: 1.55;
}

.countdown-panel {
  position: relative;
  padding: 30px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(36, 48, 66, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(36, 48, 66, 0.07) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  box-shadow: var(--shadow), 8px 8px 0 var(--mint);
}

.tape {
  position: absolute;
  top: -16px;
  width: 86px;
  height: 30px;
  border: 1px solid rgba(36, 48, 66, 0.12);
  background: rgba(255, 209, 102, 0.72);
  transform: rotate(-8deg);
}

.tape-left {
  left: 28px;
}

.tape-right {
  right: 28px;
  transform: rotate(8deg);
}

.next-date {
  margin: 0 0 22px;
  color: #243042;
  font-size: 34px;
  font-weight: 900;
}

.timer-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Roboto Mono", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: 0;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.time-card,
.days-lived-card {
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.time-card {
  min-height: 112px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(90, 169, 230, 0.08), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 -5px 0 rgba(36, 48, 66, 0.06);
}

.time-card strong,
.days-lived-card strong {
  display: block;
  color: #152033;
  font-size: 44px;
  line-height: 1;
  text-shadow: 2px 0 0 rgba(90, 169, 230, 0.18), -2px 0 0 rgba(239, 71, 111, 0.10);
}

.time-card span,
.days-lived-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.days-lived-card {
  margin-top: 14px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(56, 182, 144, 0.12), rgba(255, 255, 255, 0.68)),
    #e9fbf4;
}

.days-lived-card strong {
  margin-top: 8px;
  font-size: 54px;
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti span {
  position: absolute;
  top: -40px;
  width: 12px;
  height: 24px;
  border-radius: 4px;
  animation: fall 12s linear infinite;
}

.confetti span:nth-child(1) { left: 8%; background: var(--rose); animation-delay: 0s; }
.confetti span:nth-child(2) { left: 24%; background: var(--sky); animation-delay: 2s; }
.confetti span:nth-child(3) { left: 42%; background: var(--sun); animation-delay: 4s; }
.confetti span:nth-child(4) { left: 62%; background: var(--mint); animation-delay: 1s; }
.confetti span:nth-child(5) { left: 78%; background: var(--violet); animation-delay: 3s; }
.confetti span:nth-child(6) { left: 92%; background: #f78c6b; animation-delay: 5s; }

@keyframes fall {
  0% {
    transform: translateY(-40px) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 0.75;
  }
  100% {
    transform: translateY(calc(100vh + 80px)) rotate(360deg);
    opacity: 0;
  }
}

.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;
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 26px;
  }

  .brand span:last-child {
    max-width: min(520px, calc(100vw - 86px));
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  h1 {
    font-size: 58px;
  }

  .countdown-panel {
    padding: 26px 18px 18px;
  }

}

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 22px, 1120px);
    padding-top: 16px;
  }

  h1 {
    font-size: 42px;
  }

  .hero-text {
    font-size: 16px;
  }

  .brand span:last-child {
    font-size: 13px;
  }

  .personal-home-link {
    width: 100%;
    justify-content: center;
  }

  .hero-actions,
  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .countdown-grid {
    grid-template-columns: 1fr;
  }

  .time-card {
    min-height: 94px;
  }

  .time-card strong,
  .days-lived-card strong {
    font-size: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
