@font-face {
  font-family: "DM Sans";
  src: url("/fonts/dm-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fbf7ee;
  --white: #fffcf4;
  --ink: #171e30;
  --muted: #50515b;
  --wine: #9a342d;
  --wine-deep: #76241f;
  --night: #182839;
  --border: #d7ccba;
  --gold: #d99b51;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select, summary { touch-action: manipulation; }
[hidden] { display: none !important; }
a { color: inherit; }
p { margin: 0; line-height: 1.58; }
h1, h2, h3 { margin: 0; line-height: 1.06; }
h1, h2 { font-family: var(--serif); font-weight: 400; }
h2 { font-size: clamp(2.45rem, 5vw, 4.15rem); }
h3 { font-size: 1.14rem; }
:focus-visible { outline: 3px solid #ab4937; outline-offset: 4px; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: fixed; top: 0.5rem; left: 0.5rem; z-index: 5; padding: 0.75rem 1rem; background: var(--white); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

.site-header { border-bottom: 1px solid #e6dccb; }
.nav { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; font: 1.65rem/1 var(--serif); text-decoration: none; white-space: nowrap; }
.brand-mark { background: var(--wine); color: var(--white); display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; font: 1rem/1 var(--sans); }
.brand-tag { vertical-align: middle; margin-left: 0.55rem; padding-left: 0.55rem; border-left: 1px solid var(--border); color: var(--wine-deep); font: 700 0.72rem/1 var(--sans); letter-spacing: 0.14em; }
.nav nav, .site-footer nav { display: flex; align-items: center; gap: clamp(0.9rem, 3vw, 2rem); }
.nav nav > a:not(.button), .site-footer a { text-decoration: none; font-size: 0.92rem; }
.nav nav > a:not(.button):hover, .site-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }

.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: 0.68rem 1.25rem; border: 1px solid transparent; border-radius: 5px; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; transition: background-color 120ms, border-color 120ms; }
.button-small { min-height: 41px; padding: 0.55rem 0.9rem; font-size: 0.91rem; }
.button-primary { color: var(--white); background: var(--wine); }
.button-primary:hover { background: var(--wine-deep); }
.button-secondary { border-color: var(--border); color: var(--ink); background: transparent; }
.button-secondary:hover { background: #eee5d6; border-color: #bcb09b; }
button:disabled { cursor: wait; opacity: 0.65; }
.eyebrow { font-weight: 700; font-size: 0.82rem; letter-spacing: 0.15em; color: var(--wine-deep); }
.subtle, .field-help { color: var(--muted); font-size: 0.9rem; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 40px; padding-block: 54px 58px; }
.hero h1 { max-width: 620px; margin-block: 13px 17px; font-size: clamp(3.8rem, 6.4vw, 6rem); letter-spacing: -0.045em; line-height: 0.94; }
.hero h1 em { font-weight: 400; color: var(--wine); }
.hero-summary { font-size: clamp(1rem, 1.65vw, 1.16rem); color: var(--muted); max-width: 29rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-block: 1.55rem 0.8rem; }
.hero-art { margin: 0; position: relative; isolation: isolate; border-radius: 8px; overflow: hidden; background: var(--night); box-shadow: 0 16px 36px #18283926; }
.hero-art img { width: 100%; height: auto; aspect-ratio: 1.28; object-fit: cover; }

.demo-section { background: var(--night); color: #fff7e9; padding-block: 44px 52px; }
.demo-section .eyebrow, .create-section .eyebrow { color: var(--gold); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; margin-bottom: 1.4rem; }
.section-heading h2, .how-section h2, .create-section h2 { margin-top: 0.3rem; }
.section-heading > p { max-width: 22.5rem; color: #d9e0e2; }
.envelope-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.7rem; }
.envelope { min-width: 0; min-height: 145px; border: 1px solid #eadaba; border-radius: 6px; color: var(--ink); background: #fcf2db; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.54rem; padding: 0.66rem 0.28rem; cursor: pointer; transition: transform 140ms, background-color 140ms; }
.envelope:hover { transform: translateY(-3px); background: #fffbec; }
.envelope:active { transform: none; }
.envelope-day { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.09em; }
.envelope-day strong { font: 2rem/0.9 var(--serif); vertical-align: -0.12rem; }
.envelope-status { color: #5a5043; font-size: 0.86rem; font-weight: 600; text-align: center; }
.envelope-mark { display: grid; place-items: end center; width: 46px; height: 30px; border: 1px solid #a15446; border-radius: 3px; color: #fff3d6; background: linear-gradient(31deg, transparent 48%, #a15446 49%, #a15446 51%, transparent 52%) top left / 50% 67% no-repeat, linear-gradient(-31deg, transparent 48%, #a15446 49%, #a15446 51%, transparent 52%) top right / 50% 67% no-repeat, #e9b7a3; }
.envelope-mark span { display: grid; place-items: center; position: relative; top: -2px; width: 17px; height: 17px; border-radius: 50%; background: var(--wine); font-size: 0.71rem; }
.envelope-ready { background: #ffe2af; border-color: #e0b766; }
.envelope-sealed { background: #ebdfcf; border-color: #ddcdb4; }
.envelope-sealed .envelope-mark { filter: saturate(0.65); }
.envelope-empty .envelope-mark { opacity: 0.78; }
.envelope-empty .envelope-mark span { visibility: hidden; }
.demo-actions { padding-block: 1.5rem 3rem; }

.how-section { padding-block: 54px 58px; }
.how-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; padding: 0; margin: 1.6rem 0 0; list-style: none; }
.how-steps li { border-top: 1px solid var(--border); padding-block: 1rem 0; }
.how-steps p, .create-copy > p:last-child { color: var(--muted); margin-top: 0.5rem; }
.step-symbol { display: inline-block; margin-right: 0.4rem; color: var(--wine); font-size: 1.25rem; }
.how-steps h3 { display: inline; }
.create-section { background: #ede5d4; border-block: 1px solid #e1d6c4; padding-block: 54px; }
.create-section .eyebrow { color: var(--wine-deep); }
.create-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: clamp(1rem, 4vw, 4rem); }
.create-copy { padding-top: 0.7rem; max-width: 31rem; }
.create-form { padding: 1.45rem; border: 1px solid #daceb8; background: var(--white); border-radius: 8px; }
label { display: block; font-weight: 700; margin-bottom: 0.37rem; }
input, select, textarea { display: block; padding: 0.7rem 0.75rem; width: 100%; min-height: 47px; border: 1px solid #b8ab97; border-radius: 4px; color: var(--ink); background: #fffefa; }
input[readonly] { cursor: text; }
textarea { resize: vertical; }
form input + label, form textarea + label { margin-top: 0.9rem; }
.field-help { margin-top: 0.42rem; }
form .button { margin-top: 0.85rem; }
.form-status { margin-top: 0.65rem; }
.form-status:empty { display: none; }
.form-status[data-state="error"] { color: var(--wine-deep); font-weight: 700; }
.form-status[data-state="success"] { color: #24604d; font-weight: 700; }
.challenge { max-width: 100%; margin-top: 0.5rem; }
.challenge:empty { margin-top: 0; }

.calendar-layout { padding-block: 56px 72px; }
.calendar-intro { margin-bottom: 1.35rem; }
.calendar-intro h1, .article h1 { font-size: clamp(3.3rem, 6vw, 5.5rem); letter-spacing: -0.035em; overflow-wrap: anywhere; margin-block: 0.32rem 0.7rem; }
.calendar-intro > p:last-child { color: var(--muted); }
.calendar-layout .envelope-grid { margin-block: 1.25rem 0.9rem; }
.owner-panel { padding: 1.1rem 1.3rem; background: var(--white); border: 1px solid var(--border); border-radius: 7px; }
.owner-share, .share-buttons, .calendar-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.7rem; }
.owner-panel h2 { font-size: 2rem; }
.owner-panel details { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.owner-panel details p, .owner-panel details input { margin-block: 0.4rem 0.7rem; }
summary { cursor: pointer; font-weight: 700; width: fit-content; }
.calendar-tools { margin-top: 1.1rem; }
.text-button { border: 0; background: transparent; color: var(--wine-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; min-height: 44px; }

.letter-dialog { max-width: min(480px, calc(100% - 24px)); width: 100%; max-height: calc(100dvh - 20px); padding: 1.2rem clamp(0.9rem, 5vw, 2rem) 1.6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--white); color: var(--ink); box-shadow: 0 18px 70px #12182960; }
.letter-dialog::backdrop { background: #111e2bb8; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.letter-dialog h2 { font-size: clamp(2.25rem, 8vw, 3.15rem); margin-bottom: 0.7rem; }
.close-button { width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 50%; background: transparent; color: var(--ink); font-size: 1.45rem; cursor: pointer; }
.letter-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.letter-signature { color: var(--wine-deep); margin-top: 0.9rem; font-family: var(--serif); font-size: 1.6rem; font-style: italic; white-space: pre-wrap; overflow-wrap: anywhere; }
.letter-dialog p + .button, .letter-dialog p + input { margin-top: 0.9rem; }
.article { max-width: 750px; padding-block: 54px 64px; }
.article-intro { font-size: 1.14rem; color: var(--muted); }
.article h2 { margin: 1.75rem 0 0.4rem; font-size: 2.15rem; }
.article li { margin-block: 0.9rem; line-height: 1.58; }
.article .button { margin-top: 1rem; }
.site-footer { border-top: 1px solid var(--border); padding-block: 1.35rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem 1rem; }
.site-footer .footer-brand { font-family: var(--serif); font-size: 1.38rem; }

@media (max-width: 900px) {
  .wrap { width: min(100% - 38px, 1120px); }
  .hero { gap: 26px; padding-block: 38px 44px; }
  .hero h1 { font-size: clamp(3.35rem, 7vw, 5.3rem); }
  .envelope-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 630px) {
  .wrap { width: calc(100% - 32px); }
  .nav { min-height: 61px; }
  .brand { font-size: 1.38rem; gap: 0.42rem; }
  .brand-mark { width: 27px; height: 27px; font-size: 0.87rem; }
  .brand-tag, .nav-how, .nav nav > a.button { display: none; }
  .hero { grid-template-columns: 1fr; gap: 22px; padding-block: 29px 32px; }
  .hero h1 { font-size: clamp(3.35rem, 10.8vw, 5rem); margin-block: 10px 13px; }
  .hero-summary { max-width: 27rem; }
  .hero-actions { margin-top: 1.15rem; }
  .hero-art img { aspect-ratio: 1.55; }
  .section-heading { flex-direction: column; align-items: flex-start; }
  .demo-section, .create-section { padding-block: 33px 39px; }
  .envelope-grid { gap: 0.45rem; }
  .envelope { min-height: 114px; padding: 0.45rem 0.18rem; }
  .envelope-mark { width: 38px; height: 24px; }
  .envelope-mark span { width: 14px; height: 14px; font-size: 0.58rem; }
  .envelope-status { font-size: 0.82rem; }
  .how-section { padding-block: 36px 39px; }
  .how-steps { grid-template-columns: 1fr; gap: 0.85rem; }
  .create-inner { grid-template-columns: 1fr; gap: 1.1rem; }
  .create-form { padding: 1.05rem; }
  .footer-inner { flex-wrap: wrap; }
  .calendar-layout, .article { padding-block: 36px 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}
