:root {
  color-scheme: light;
  --cream: #fcf8ef;
  --sand: #f4ecdc;
  --paper: #fffcf6;
  --ink: #36251e;
  --muted: #685348;
  --brown: #694635;
  --accent: #805833;
  --gold: #b38a4d;
  --line: #ded0b9;
  --field: #a69076;
  --serif: "Baskervville", "Baskerville", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-block-start: 24px; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.6 var(--sans); }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; }
button, .type-card, .choice { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, p, figure { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.04em; }

.wrap { width: min(1120px, calc(100% - 88px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wordmark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.wordmark > span:last-child { font: italic 27px/.9 var(--serif); }
.wordmark small { display: block; font: 650 9px/1.4 var(--sans); letter-spacing: .19em; margin-block-start: 4px; }
.brand-seal { display: block; flex: none; width: 42px; height: 42px; object-fit: contain; }
.seal {
  flex: none;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #8b6538;
  border-radius: 47% 53% 45% 55% / 53% 45% 55% 47%;
  background: radial-gradient(circle at 35% 22%, #f0d093, #b68a4c 68%, #9b713e);
  box-shadow: inset 0 0 0 3px #b88e55, inset 0 0 0 4px #e6c38b, 0 2px 4px #4f332425;
  color: #39251a;
  font: italic 22px/1 var(--serif);
}
.header-link { text-decoration: none; font-size: 13px; font-weight: 650; }
.header-nav { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 2px 16px; }
.header-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.hero { display: grid; grid-template-columns: 1fr 1.025fr; gap: clamp(36px, 6vw, 88px); align-items: center; padding-block: 51px 54px; }
.hero-copy { padding-block: 10px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--accent); text-transform: uppercase; letter-spacing: .17em; font-size: 10px; line-height: 1.4; font-weight: 750; }
.eyebrow span { width: 24px; height: 1px; background: var(--gold); }
.hero h1 { font-size: clamp(41px, 5.25vw, 78px); line-height: .99; margin-block: 16px 22px; }
.hero h1 em { display: block; color: var(--brown); font-weight: inherit; }
.hero h1 span { display: block; margin-top: 12px; font-size: .54em; line-height: 1.1; letter-spacing: -.025em; }
.hero-copy > p:not(.eyebrow) { color: var(--muted); max-width: 42ch; }
.button {
  border: 1px solid transparent;
  border-radius: 3px;
  background: #634231;
  color: #fffaf1;
  font-size: 14px;
  font-weight: 650;
  padding: 10px 17px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-decoration: none;
}
.button:hover:not(:disabled) { background: #4e3225; }
.button span { color: #e5c496; font-size: 16px; line-height: 1; }
.hero .button { margin-block-start: 24px; }
.hero-photo { position: relative; padding: 7px; border: 1px solid #c9ad84; background: #f7ecda; box-shadow: 0 12px 28px #51351b13; }
.hero-photo img { display: block; width: 100%; height: auto; }

.writing-section { background: var(--sand); border-block: 1px solid var(--line); padding-block: 44px 58px; }
.writing-layout { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.paper { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-top: 2px solid var(--gold); padding: clamp(22px, 3vw, 38px); box-shadow: 0 3px 10px #593a2510; }
.paper h2 { font-size: clamp(31px, 3.1vw, 44px); line-height: 1.08; margin-block-end: 12px; }
.preview-notice { font-size: 13px; color: var(--muted); margin-block-end: 21px; }
.preview-notice strong { color: var(--ink); }

fieldset { border: 0; min-width: 0; margin: 0; padding: 0; }
legend { padding: 0; }
.type-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.type-card { position: relative; display: grid; align-content: start; gap: 1px; border: 1px solid var(--line); border-radius: 3px; min-height: 102px; padding: 13px 12px; background: var(--paper); }
.type-card:hover { border-color: var(--accent); }
.type-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: #f6ebd9; }
.type-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.type-card input { position: absolute; inset: 11px 10px auto auto; margin: 0; }
.type-name { font: 400 clamp(16px, 1.65vw, 23px)/1.22 var(--serif); letter-spacing: -.025em; }
.type-description { color: var(--muted); font-size: 11px; line-height: 1.35; }
.type-icon { position: relative; display: block; margin: 3px 0 8px; width: 17px; height: 13px; border: 1px solid var(--accent); border-radius: 1px; }
.type-icon::after { position: absolute; content: ""; }
.envelope::after { width: 9px; height: 9px; border: solid var(--accent); border-width: 0 1px 1px 0; transform: rotate(45deg); top: -4px; left: 3px; }
.envelope { overflow: hidden; }
.page { width: 12px; height: 15px; margin-top: 1px; }
.page::after { top: 4px; left: 2px; width: 6px; height: 4px; border-block: 1px solid var(--accent); }
.bubble { border-radius: 3px; }
.bubble::after { width: 5px; height: 5px; bottom: -3px; left: 3px; border: solid var(--accent); border-width: 0 0 1px 1px; transform: skewY(-35deg); background: inherit; }

.message-field, .choices, .form-end { margin-block-start: 24px; }
.field-title { display: block; font-weight: 700; font-size: 14px; }
.field-help { margin-block: 2px 9px; color: var(--muted); font-size: 13px; }
input[type="text"] { display: block; width: 100%; padding: 10px 12px; border: 1px solid var(--field); border-radius: 3px; background: #fffdf8; color: var(--ink); }
input[type="text"]::placeholder { color: var(--muted); opacity: .9; }
.letter-editor { border: 1px solid var(--field); border-radius: 4px; background: #fffdf8; }
.editor-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 9px; padding: 8px; border-bottom: 1px solid var(--line); background: #f6ebd9; }
.editor-controls label { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; font-weight: 650; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.editor-controls button, .editor-controls select { min-height: 34px; border: 1px solid var(--field); border-radius: 3px; background: var(--paper); color: var(--ink); padding: 3px 7px; font-size: 13px; }
.editor-controls button { min-width: 34px; }
.editor-controls button[aria-pressed="true"] { background: #e6d0aa; border-color: var(--accent); }
.editor-controls button:hover { border-color: var(--accent); }
.editor-content { position: relative; min-height: 145px; padding: 10px 12px; font: 16px/1.6 Arial, sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.editor-content:focus-visible { outline-offset: -2px; }
.editor-content[data-empty]::before { position: absolute; content: attr(data-placeholder); color: var(--muted); opacity: .9; pointer-events: none; }
#editor-status:empty, #dictation-status:empty { margin: 0; }
.count { text-align: end; font-size: 11px; color: var(--muted); margin-block-start: 5px; }
.choices .field-title { margin-block-end: 4px; }
.choice { display: flex; align-items: flex-start; gap: 9px; padding-block: 4px; font-size: 14px; line-height: 1.5; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--brown); width: 15px; height: 15px; flex: none; }
.choice input { margin: 3px 0 0; }
.pen-name { max-width: 310px; padding-block-start: 7px; margin-inline-start: 24px; }
.form-end { display: grid; gap: 15px; justify-items: start; border-top: 1px solid var(--line); padding-block-start: 16px; }
.acknowledgement { color: var(--ink); }
.confirmation { text-align: center; padding-block: 35px; }
.confirmation-seal { margin-block-end: 19px; }
.confirmation-seal::after { content: ""; width: 9px; height: 15px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.confirmation p { color: var(--muted); }
.confirmation button { margin-block-start: 23px; }

.guide { border: 1px solid #d8c4a4; background: #f8f0df; padding: clamp(20px, 2.35vw, 30px); }
.guide h2 { font-size: clamp(29px, 2.65vw, 38px); line-height: 1.1; margin-block: 11px 14px; }
.guide ul { margin: 0; padding-inline-start: 18px; font-size: 14px; color: var(--muted); }
.guide li + li { margin-block-start: 10px; }
.guide li::marker { color: var(--accent); }
.guide strong { color: var(--ink); }
.guide-note { border-top: 1px solid var(--line); margin-block-start: 17px; padding-block-start: 13px; color: var(--muted); font-size: 12px; }
.guide-note h3 { color: var(--ink); font-size: 14px; margin: 0 0 5px; }
.guide-note p + p { margin-top: 8px; }
.guide-note a, .footer-inner a { overflow-wrap: anywhere; }
.submit-error { color: #852a20; font-size: 14px; }

.inbox { max-width: 760px; padding-block: 38px; }
.inbox h1 { font-size: clamp(36px, 5vw, 60px); line-height: 1.1; }
.inbox > p { color: var(--muted); margin: 8px 0 24px; }
.inbox-letter { background: var(--paper); border: 1px solid var(--line); border-top: 2px solid var(--gold); padding: 20px; margin-block: 16px; }
.inbox-letter h2 { font-size: 28px; }
.inbox-letter p { color: var(--muted); font-size: 13px; }
.letter-body { margin-top: 12px; font-family: Arial, sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.inbox-pages { display: flex; flex-wrap: wrap; gap: 20px; }
.voice-preview { max-width: 740px; padding-block: 38px; }
.voice-preview h1 { font-size: clamp(38px, 6vw, 62px); line-height: 1.1; margin-bottom: 14px; }
.voice-preview > p { color: var(--muted); margin-bottom: 18px; }
.voice-preview .paper + .paper { margin-top: 18px; }
.voice-preview .paper p + p { margin-top: 10px; }
.voice-preview .paper p { color: var(--muted); }
.voice-preview fieldset { margin-block: 18px; }
.voice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 13px; }
.voice-preview audio { display: block; width: min(100%, 400px); }

.footer-inner { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 20px; padding-block: 22px; color: var(--muted); font-size: 12px; }
.footer-brand { font: italic 19px/1.25 var(--serif); color: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 850px) {
  .wrap { width: calc(100% - 56px); }
  .hero { gap: 30px; }
  .writing-layout { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 16px; }
  .type-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 36px); }
  .header-inner { min-height: 64px; }
  .wordmark > span:last-child { font-size: 24px; }
  .header-link { font-size: 12px; }
  .hero { grid-template-columns: 1fr; gap: 22px; padding-block: 28px 31px; }
  .hero-copy { padding-block: 0; }
  .hero h1 { font-size: clamp(42px, 11vw, 64px); margin-block: 12px 14px; }
  .hero .button { margin-block-start: 17px; }
  .writing-section { padding-block: 22px 31px; }
  .writing-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 390px) {
  .paper { padding-inline: 15px; }
  .type-options { gap: 6px; }
  .type-card { padding-inline: 8px; }
  .type-card input { inset-inline-end: 7px; }
}

.letter-font-sans { font-family: "Arial", sans-serif; }
.letter-font-georgia { font-family: "Georgia", serif; }
.letter-font-times { font-family: "Times New Roman", serif; }
.letter-font-mono { font-family: "Courier New", monospace; }
.letter-size-14, .editor-content font[size="2"] { font-size: 14px; }
.letter-size-16, .editor-content font[size="3"] { font-size: 16px; }
.letter-size-18, .editor-content font[size="4"] { font-size: 18px; }
.letter-size-20, .editor-content font[size="5"] { font-size: 20px; }
.letter-size-24, .editor-content font[size="6"] { font-size: 24px; }
.letter-color-ink { color: #36251e; }
.letter-color-brown { color: #754727; }
.letter-color-wine { color: #81374d; }
.letter-color-navy { color: #224b78; }
.letter-color-green { color: #3d5639; }