@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Noto+Serif+SC:wght@400;500;600;700;900&display=swap");

:root {
  color-scheme: light;
  --paper: #f4f0e7;
  --ink: #202824;
  --muted: #71776e;
  --line: #d8d6c9;
  --orange: #e8663e;
  --green: #c7d8a5;
  --mono: "DM Mono", "Courier New", monospace;
  --sans: "DM Sans", "Noto Sans SC", sans-serif;
  --serif: "Noto Serif SC", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--green); color: var(--ink); }

.page-shell { max-width: 1440px; margin: 0 auto; padding: 0 7.1%; }
.topbar {
  height: 82px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); font-size: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .08em; }
.brand-mark { color: var(--orange); font-size: 25px; line-height: 1; transform: rotate(-35deg); }
.topbar-note, .archive-link { color: var(--muted); }
.status-dot { width: 7px; height: 7px; display: inline-block; margin-right: 8px; border-radius: 50%; background: #95ae73; box-shadow: 0 0 0 3px #95ae7320; }
.archive-link { transition: color .2s; }
.archive-link:hover { color: var(--orange); }
.archive-link span { margin-left: 7px; color: var(--orange); font: 11px var(--mono); }

.hero { min-height: 630px; position: relative; display: grid; grid-template-columns: .95fr 1.05fr; align-items: center; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-copy { z-index: 2; padding: 72px 0 80px; }
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; color: var(--muted); font: 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.eyebrow-line { width: 25px; height: 1px; background: var(--orange); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 22px; font: 600 clamp(54px, 6.2vw, 88px)/1.22 var(--serif); letter-spacing: -.085em; }
.title-accent { color: var(--orange); }
.hero-description { max-width: 360px; margin-bottom: 30px; color: #62695f; font: 14px/2 var(--serif); }
.primary-link { display: inline-flex; align-items: center; gap: 28px; padding: 13px 17px 13px 20px; background: var(--ink); color: var(--paper); font-size: 12px; transition: background .2s, transform .2s; }
.primary-link:hover { background: var(--orange); transform: translateY(-2px); }
.link-arrow { font-size: 17px; }
.hero-caption { margin-top: 48px; color: var(--muted); font-size: 11px; }
.caption-star { margin-right: 8px; color: var(--orange); font-size: 17px; vertical-align: -2px; }

.moon-scene { height: 520px; position: relative; display: flex; align-items: center; justify-content: center; }
.moon { width: min(34vw, 410px); aspect-ratio: 1; position: absolute; top: 51px; left: 50%; transform: translateX(-50%); overflow: hidden; border-radius: 50%; background: #dce3c3; box-shadow: inset -26px -17px 0 #c3ceaa, 0 0 80px #dce3c34a; }
.moon::after { content: ""; position: absolute; width: 45%; height: 110%; top: -5%; right: -12%; border-radius: 50%; background: #29332c; opacity: .91; }
.moon-crater { position: absolute; z-index: 1; display: block; border-radius: 50%; background: #bbc69f; box-shadow: inset 5px 5px 0 #aeb895; }
.crater-one { width: 53px; height: 53px; top: 25%; left: 24%; }
.crater-two { width: 26px; height: 26px; top: 58%; left: 16%; }
.crater-three { width: 36px; height: 36px; top: 67%; left: 45%; }
.orbit { width: 475px; height: 170px; position: absolute; z-index: 1; top: 165px; left: 50%; border: 1px solid #63705d40; border-radius: 50%; transform: translateX(-50%) rotate(-27deg); }
.orbit-two { width: 520px; height: 240px; top: 154px; transform: translateX(-50%) rotate(22deg); border-color: #63705d25; }
.planet { position: absolute; z-index: 2; width: 17px; height: 17px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 7px #e8663e1c; }
.planet-small { top: 130px; right: 14%; }
.scene-star, .scene-spark { position: absolute; z-index: 2; color: var(--orange); }
.star-one { top: 99px; left: 14%; font-size: 19px; }
.star-two { top: 61px; right: 24%; font-size: 14px; color: #53624e; }
.star-three { bottom: 109px; left: 18%; font-size: 35px; color: #58634f; }
.star-four { right: 12%; bottom: 170px; font-size: 22px; }
.postbox { position: absolute; z-index: 3; top: 228px; left: 50%; width: 103px; transform: translateX(-50%); filter: drop-shadow(9px 12px 0 #27302918); }
.postbox-cap { width: 90px; height: 24px; margin: 0 auto -1px; border-radius: 50% 50% 4px 4px / 100% 100% 4px 4px; background: #e8663e; border: 2px solid var(--ink); }
.postbox-body { height: 167px; position: relative; border: 2px solid var(--ink); border-radius: 14px 14px 7px 7px; background: var(--orange); }
.postbox-slot { width: 56px; height: 8px; position: absolute; top: 30px; left: 21px; border-radius: 9px; background: var(--ink); }
.postbox-badge { width: 31px; height: 31px; position: absolute; top: 59px; left: 34px; display: grid; place-items: center; border: 1px solid #2028247a; border-radius: 50%; color: var(--ink); font: 14px var(--serif); }
.postbox-foot { width: 48px; height: 17px; position: absolute; bottom: -17px; left: 25px; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); background: #e8663e; }
.scene-label { position: absolute; right: 0; bottom: 31px; left: 0; display: flex; justify-content: space-between; color: #8c9186; font: 9px var(--mono); letter-spacing: .12em; }
.scene-spark { font-size: 13px; }
.spark-one { top: 220px; left: 20%; color: #66725b; }
.spark-two { right: 18%; bottom: 115px; }
.hero-bottom { position: absolute; bottom: 23px; left: 0; right: 0; display: flex; justify-content: space-between; color: #888d82; font: 9px var(--mono); letter-spacing: .08em; }

.write-section { display: grid; grid-template-columns: .8fr 1.2fr; gap: 12%; padding: 104px 0 110px; border-bottom: 1px solid var(--line); }
.section-intro { position: relative; }
.section-intro h2 { margin: 0 0 16px; font: 500 26px/1.5 var(--serif); letter-spacing: -.04em; }
.section-intro > p:not(.eyebrow) { color: var(--muted); font: 13px/2 var(--serif); }
.postmark { width: 108px; height: 108px; margin: 45px 0 0 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid #e8663e80; border-radius: 50%; color: var(--orange); transform: rotate(-12deg); }
.postmark span { font: 7px var(--mono); letter-spacing: .13em; }
.postmark strong { font: 13px var(--serif); }
.letter-form { padding-top: 3px; }
.field-label { display: block; margin-bottom: 14px; font-size: 12px; font-weight: 600; }
.letter-form textarea { width: 100%; min-height: 175px; resize: vertical; padding: 20px; border: 1px solid var(--line); border-radius: 0; outline: none; background: #f8f6f0; color: var(--ink); font: 13px/2 var(--serif); transition: border-color .2s, box-shadow .2s; }
.letter-form textarea:focus, .date-field input:focus { border-color: #79866c; box-shadow: 0 0 0 3px #c7d8a544; }
.letter-form textarea::placeholder { color: #a0a297; }
.form-meta { display: flex; justify-content: space-between; margin: 9px 0 27px; color: #92968c; font: 9px var(--mono); }
.form-options { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.date-field { display: grid; gap: 9px; color: var(--muted); font-size: 10px; }
.date-field input { width: 174px; padding: 11px 12px; border: 1px solid var(--line); outline: none; background: transparent; color: var(--ink); font: 11px var(--mono); }
.send-button { min-width: 170px; display: flex; justify-content: space-between; align-items: center; padding: 15px 17px; border: 0; background: var(--orange); color: #fffaf1; cursor: pointer; font-size: 12px; transition: background .2s, transform .2s; }
.send-button:hover { background: var(--ink); transform: translateY(-2px); }
.privacy-note { margin: 20px 0 0; color: #8d9287; font-size: 10px; }
.privacy-note span { margin-right: 7px; color: #758269; }
.form-message { min-height: 16px; margin: 12px 0 0; color: #65784f; font-size: 11px; }

.archive-section { min-height: 340px; padding: 91px 0 104px; }
.archive-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 34px; }
.archive-heading .eyebrow { margin-bottom: 15px; }
.archive-heading h2 { margin: 0; font: 500 31px var(--serif); letter-spacing: -.06em; }
.heading-period { color: var(--orange); }
.archive-count { padding-bottom: 5px; color: #90958a; font: 9px var(--mono); letter-spacing: .09em; }
.archive-count span { margin-right: 7px; color: var(--orange); }
.empty-state { min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #d3d2c7; color: var(--muted); text-align: center; }
.empty-icon { margin-bottom: 9px; color: #8b9877; font-size: 23px; }
.empty-state p { margin-bottom: 5px; color: var(--ink); font: 13px var(--serif); }
.empty-state span { font-size: 10px; }
.letter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.letter-card { position: relative; padding: 20px 22px; border: 1px solid var(--line); background: #f8f6f0; animation: arrive .35s ease-out both; }
.letter-card-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 13px; color: #878d81; font: 9px var(--mono); }
.letter-card-date { color: var(--orange); }
.letter-card-content { margin: 0; color: #414941; font: 12px/1.9 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; }
.delete-letter { position: absolute; right: 15px; bottom: 12px; padding: 3px; border: 0; background: transparent; color: #9b9e94; cursor: pointer; font-size: 10px; }
.delete-letter:hover { color: var(--orange); }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.footer { min-height: 78px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: #858b80; font-size: 10px; }
.footer-brand { color: var(--ink); font-size: 11px; }
.footer-brand .brand-mark { font-size: 20px; }
.footer-coordinate { font: 9px var(--mono); letter-spacing: .08em; }
.toast { position: fixed; z-index: 10; right: 24px; bottom: 24px; padding: 13px 18px; background: var(--ink); color: var(--paper); font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 760px) {
  .page-shell { padding: 0 6%; }
  .topbar { height: 68px; }
  .topbar-note { display: none; }
  .hero { min-height: unset; grid-template-columns: 1fr; padding-bottom: 54px; }
  .hero-copy { padding: 64px 0 0; }
  h1 { font-size: clamp(57px, 15vw, 78px); }
  .hero-description { max-width: 320px; }
  .hero-caption { margin-top: 29px; }
  .moon-scene { height: min(112vw, 430px); margin: -7px -5% 0; }
  .moon { width: min(74vw, 350px); top: 29px; }
  .orbit { width: 90vw; top: 118px; }
  .orbit-two { top: 125px; }
  .postbox { top: 190px; transform: translateX(-50%) scale(.87); }
  .planet-small { top: 86px; right: 13%; }
  .star-one { top: 80px; }
  .star-three { bottom: 87px; }
  .scene-label { bottom: 18px; }
  .hero-bottom { bottom: 19px; }
  .write-section { grid-template-columns: 1fr; gap: 30px; padding: 72px 0 75px; }
  .section-intro { max-width: 420px; }
  .postmark { position: absolute; right: 8px; bottom: 0; width: 85px; height: 85px; margin: 0; }
  .postmark strong { font-size: 11px; }
  .form-options { align-items: stretch; flex-direction: column; }
  .date-field input { width: 100%; }
  .send-button { width: 100%; }
  .archive-section { padding: 70px 0 78px; }
  .archive-heading h2 { font-size: 26px; }
  .archive-count { max-width: 100px; text-align: right; line-height: 1.8; }
  .letter-list { grid-template-columns: 1fr; }
  .footer { min-height: 86px; gap: 10px; }
  .footer > span:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
