:root {
  --color-primary: #e60023;
  --color-primary-dark: #bd081c;
  --color-text: #1f1a24;
  --color-muted: #6b5f6f;
  --color-bg: #fffbfa;
  --color-card: #ffffff;
  --color-border: #efe5e8;
  --radius-card: 24px;
  --radius-input: 16px;
  --shadow-soft: 0 20px 70px rgba(31, 26, 36, 0.08);
  --primary: var(--color-primary);
  --primary-dark: var(--color-primary-dark);
  --background: var(--color-bg);
  --card: var(--color-card);
  --text: var(--color-text);
  --muted: var(--color-muted);
  --border: var(--color-border);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 14%, rgba(230, 0, 35, 0.035), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(189, 8, 28, 0.03), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--color-bg) 62%, #ffffff 100%);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

.shell {
  width: min(100% - 48px, 1440px);
  margin: 0 auto;
}

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

.site-header {
  position: relative;
  z-index: 20;
  padding: 26px 0;
  border-bottom: 1px solid rgba(239, 229, 232, 0.9);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--text);
  text-decoration: none;
  font-size: clamp(23px, 2vw, 30px);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand .mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  box-shadow: 0 16px 34px rgba(230, 0, 35, 0.16);
}

.accent,
h1 span,
h2 span,
h3 span {
  color: var(--primary);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 28px;
  font-weight: 850;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
}

.site-nav a:not(.button):hover,
.nav-button:hover {
  color: var(--primary);
}

.nav-form {
  margin: 0;
}

.nav-button {
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

main.shell {
  padding: clamp(42px, 6vw, 82px) 0;
}

.site-footer {
  padding: 28px 0 42px;
  border-top: 1px solid var(--border);
}

.site-footer nav {
  justify-content: center;
  flex-wrap: wrap;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(52px, 6.2vw, 92px);
  line-height: 0.98;
}

h2 {
  font-size: clamp(34px, 4.6vw, 66px);
  line-height: 1.03;
}

h3 {
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.12;
}

p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.28vw, 20px);
  line-height: 1.58;
}

.tiny {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

label {
  display: block;
  margin-bottom: 9px;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 0 16px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  font-weight: 760;
  outline: none;
  box-shadow: 0 10px 30px rgba(31, 26, 36, 0.03);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
  min-height: 132px;
  padding-top: 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(230, 0, 35, 0.08);
}

input[type="file"] {
  min-height: auto;
  padding: 14px;
}

.button {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 26px;
  color: #ffffff;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  text-decoration: none;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 16px 34px rgba(230, 0, 35, 0.2);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(230, 0, 35, 0.23);
}

button:focus-visible,
.button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.home-date-control:focus-visible {
  outline: 3px solid rgba(230, 0, 35, 0.22);
  outline-offset: 3px;
}

.button.secondary {
  color: var(--primary);
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: none;
}

.button.secondary:hover {
  border-color: rgba(230, 0, 35, 0.45);
  background: #fff7f8;
  box-shadow: none;
}

.button:disabled {
  opacity: 0.64;
  cursor: wait;
  transform: none;
}

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

.grid {
  display: grid;
  gap: 28px;
}

.hero-grid {
  grid-template-columns: minmax(0, 0.96fr) minmax(360px, 0.78fr);
  gap: clamp(42px, 7vw, 120px);
  align-items: center;
}

.two-col {
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
  align-items: start;
}

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

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

.card,
.form-panel {
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.card {
  padding: clamp(24px, 4vw, 44px);
  border-radius: var(--radius-card);
}

.form-panel {
  margin-top: 22px;
  padding: 18px;
  border-radius: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 14px;
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff7f8;
  font-size: 14px;
  font-weight: 900;
}

.hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 760;
}

.hint::before {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #ffffff;
  border-radius: 999px;
  background: var(--primary);
  content: "";
  box-shadow: inset 0 0 0 7px var(--primary), inset 0 0 0 9px #ffffff;
}

.preview-card {
  text-align: center;
}

.avatar-preview {
  width: min(260px, 72vw);
  height: min(260px, 72vw);
  margin: 28px auto;
  overflow: hidden;
  border: 10px solid #ffffff;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 35%, #ffffff, #fff0f2);
  box-shadow: inset 0 0 0 1px var(--border), 0 22px 56px rgba(31, 26, 36, 0.08);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.counter-days {
  color: var(--primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(58px, 7vw, 96px);
  font-weight: 900;
  line-height: 0.95;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.stat {
  min-width: 0;
  padding: 16px 12px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fffbfa;
}

.stat strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--primary);
  font-size: 21px;
}

.error-box {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  color: var(--primary-dark);
  border: 1px solid #f2adb7;
  border-radius: 14px;
  background: #fff0f2;
  font-weight: 800;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.theme-option {
  min-height: 96px;
  padding: 12px;
  color: var(--text);
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.theme-option[data-active="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(230, 0, 35, 0.08);
}

.theme-swatch {
  display: block;
  height: 42px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.seo-grid {
  margin-top: clamp(110px, 14vh, 160px);
}

.seo-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.seo-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-hero h1 {
  max-width: 680px;
}

.home-hero .hero-copy > p {
  max-width: 640px;
  margin-top: 24px;
}

.home-hero .form-panel {
  max-width: 720px;
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(31, 26, 36, 0.06);
}

.date-picker-host {
  position: relative;
}

.home-date-control {
  display: grid;
  width: 100%;
  min-height: 64px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(31, 26, 36, 0.03);
  cursor: pointer;
}

.home-date-control:hover,
.home-date-control.date-open {
  border-color: rgba(230, 0, 35, 0.5);
  box-shadow: 0 0 0 4px rgba(230, 0, 35, 0.08);
}

.home-date-icon {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
  color: var(--primary);
  border: 2px solid currentColor;
  border-radius: 7px;
  font-size: 0;
}

.home-date-icon::before {
  position: absolute;
  top: 5px;
  right: -2px;
  left: -2px;
  height: 2px;
  background: currentColor;
  content: "";
}

.home-date-icon::after {
  position: absolute;
  top: -4px;
  left: 5px;
  width: 10px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-left: 2px solid currentColor;
  content: "";
}

.home-date-text {
  color: var(--text);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 900;
}

.home-date-chevron {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--text);
  border-left: 1px solid var(--border);
}

.date-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  width: min(430px, calc(100vw - 56px));
  padding: 18px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(31, 26, 36, 0.13);
}

.date-quick-row,
.date-picker-header,
.date-weekdays,
.date-grid,
.date-footer {
  display: grid;
}

.date-quick-row {
  grid-template-columns: repeat(3, auto);
  gap: 10px;
  justify-content: start;
  margin-bottom: 22px;
}

.date-quick-row button,
.date-footer button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.date-quick-row button:first-child,
.date-quick-row button:hover,
.date-footer button:hover {
  color: var(--primary);
  background: #fff0f2;
}

.date-picker-header {
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  margin-bottom: 18px;
}

.date-picker-header strong {
  text-align: center;
  font-size: 23px;
  font-weight: 900;
}

.date-picker-header button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--text);
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 28px;
  cursor: pointer;
}

.date-weekdays,
.date-grid {
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.date-weekdays {
  margin-bottom: 8px;
}

.date-weekdays span {
  display: grid;
  min-height: 32px;
  place-items: center;
  color: var(--muted);
  font-weight: 760;
}

.date-day {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  color: var(--text);
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: inherit;
  font-size: 18px;
  font-weight: 720;
  cursor: pointer;
}

.date-day.empty {
  pointer-events: none;
}

.date-day:hover,
.date-day.today:not(.selected) {
  background: #fff0f2;
}

.date-day.selected {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(230, 0, 35, 0.24);
}

.date-footer {
  grid-template-columns: auto auto;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
}

.date-footer button {
  min-width: 88px;
  color: var(--primary);
}

.date-footer [data-clear] {
  border-color: transparent;
  background: transparent;
}

.home-preview.card {
  min-height: 560px;
  display: grid;
  align-content: center;
}

.home-preview h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4vw, 50px);
}

.home-preview .avatar-preview {
  width: min(300px, 58vw);
  height: min(300px, 58vw);
}

.home-preview .counter-days {
  font-size: clamp(72px, 8vw, 112px);
}

.account-counter-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 18px;
  align-items: center;
}

.memory-card,
.event-card,
.gift-card,
.milestone-card {
  border-radius: 18px;
}

footer nav,
.site-nav {
  display: flex;
}

@media (max-width: 1120px) {
  .hero-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .home-preview.card {
    min-height: auto;
  }
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 28px, 720px);
  }

  .site-header {
    padding: 18px 0;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand {
    font-size: 22px;
  }

  .brand .mark {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .site-nav {
    gap: 12px;
    flex-wrap: wrap;
  }

  .site-nav a:not(.button),
  .nav-button {
    font-size: 14px;
  }

  main.shell {
    padding: 34px 0;
  }

  h1 {
    font-size: clamp(44px, 14vw, 64px);
  }

  h2 {
    font-size: clamp(32px, 10vw, 48px);
  }

  .input-row,
  .field-grid,
  .theme-grid,
  .seo-three,
  .seo-two,
  .stat-grid,
  .account-counter-row {
    grid-template-columns: 1fr;
  }

  .input-row .button,
  .actions .button,
  .button {
    width: 100%;
  }

  .card {
    padding: 22px;
    border-radius: 22px;
  }

  .form-panel {
    border-radius: 16px;
  }

  .date-picker-popover {
    width: min(390px, calc(100vw - 42px));
  }
}

@media (max-width: 460px) {
  .topbar {
    gap: 14px;
  }

  .site-nav .button {
    width: auto;
    min-height: 44px;
    padding: 0 14px;
    font-size: 14px;
    white-space: nowrap;
  }

  .site-nav {
    justify-content: flex-end;
  }

  .site-nav a[href="/explore"],
  .site-nav a[href="/login"],
  .site-nav .pill {
    display: none;
  }

  .home-date-control {
    min-height: 58px;
  }

  .date-picker-popover {
    left: 50%;
    transform: translateX(-50%);
  }
}
