:root {
  --letter-bg: #080705;
  --letter-surface: rgba(13, 11, 8, 0.82);
  --letter-text: #f4efe2;
  --letter-muted: #b8af9d;
  --letter-gold: #d6a84a;
  --letter-gold-light: #ead8a5;
  --letter-ink: #100d08;
  --letter-line: rgba(214, 168, 74, 0.35);
  --letter-danger: #e7a88f;
  --letter-radius: 14px;
  --letter-serif: "Cormorant Garamond", "Times New Roman", serif;
  --letter-sans: "Montserrat", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--letter-text);
  background: var(--letter-bg);
  font-family: var(--letter-sans);
  font-size: 16px;
  line-height: 1.55;
}

button,
input { font: inherit; }

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

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

.letter-art,
.letter-shade,
.letter-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.letter-art {
  left: 42%;
  background: url("/assets/newsletter-eclipse.jpg") 72% 34% / cover no-repeat;
}

.letter-shade {
  background:
    linear-gradient(90deg, rgba(8, 7, 5, 0.99) 0%, rgba(8, 7, 5, 0.92) 35%, rgba(8, 7, 5, 0.3) 70%, rgba(8, 7, 5, 0.52) 100%),
    linear-gradient(0deg, rgba(8, 7, 5, 0.96) 0%, transparent 38%, rgba(8, 7, 5, 0.2) 100%);
}

.letter-noise {
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='4' stitchTiles='stitchTiles'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.92'/%3E%3C/svg%3E");
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 4;
  padding: 10px 14px;
  color: var(--letter-ink);
  background: var(--letter-gold-light);
  border-radius: 8px;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus { transform: none; }

.letter-header,
.letter-footer,
.letter-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 72px), 1360px);
  margin: 0 auto;
}

.letter-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: env(safe-area-inset-top);
}

.letter-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--letter-gold-light);
  font-family: var(--letter-serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.28em;
  white-space: nowrap;
}

.letter-brand-mark {
  width: 29px;
  height: 29px;
  position: relative;
  border: 1px solid var(--letter-gold);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(214, 168, 74, 0.12);
}

.letter-brand-mark::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(214, 168, 74, 0.58);
  border-radius: 50%;
}

.letter-languages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.letter-languages button {
  min-width: 42px;
  min-height: 38px;
  padding: 0 9px;
  color: var(--letter-muted);
  background: rgba(8, 7, 5, 0.46);
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.letter-languages button:hover,
.letter-languages button:focus-visible {
  color: var(--letter-text);
  border-color: var(--letter-line);
  outline: none;
}

.letter-languages button:active { transform: scale(0.97); }

.letter-languages button.active {
  color: var(--letter-ink);
  background: var(--letter-gold-light);
  border-color: var(--letter-gold-light);
}

.letter-shell {
  min-height: calc(100dvh - 126px);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  align-items: center;
  padding: 30px 0 54px;
}

.letter-panel {
  grid-column: 1;
  width: min(100%, 570px);
}

.letter-intro,
.letter-form,
.letter-success {
  animation: letter-enter 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.letter-form { animation-delay: 90ms; }

.letter-eyebrow {
  margin: 0 0 17px;
  color: var(--letter-gold);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2 { font-family: var(--letter-serif); font-weight: 500; }

h1 {
  margin: 0;
  font-size: clamp(56px, 6.2vw, 88px);
  line-height: 0.88;
  letter-spacing: -0.035em;
}

h1 span { display: block; }

.letter-copy {
  max-width: 500px;
  margin: 26px 0 0;
  color: #cbc3b2;
  font-size: 17px;
  font-weight: 300;
}

.letter-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 34px;
}

.letter-form[hidden] { display: none; }

.letter-field { display: grid; gap: 8px; }

.letter-field label {
  color: var(--letter-gold-light);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
}

.letter-field input {
  width: 100%;
  height: 54px;
  padding: 0 17px;
  color: var(--letter-text);
  background: rgba(8, 7, 5, 0.78);
  border: 1px solid rgba(234, 216, 165, 0.42);
  border-radius: var(--letter-radius);
  outline: none;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.letter-field input:hover { border-color: rgba(234, 216, 165, 0.66); }

.letter-field input:focus {
  background: rgba(8, 7, 5, 0.94);
  border-color: var(--letter-gold-light);
  box-shadow: 0 0 0 3px rgba(214, 168, 74, 0.15);
}

.letter-field input[aria-invalid="true"] {
  border-color: var(--letter-danger);
  box-shadow: 0 0 0 3px rgba(231, 168, 143, 0.12);
}

.letter-submit {
  align-self: end;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 22px;
  color: var(--letter-ink);
  background: linear-gradient(135deg, var(--letter-gold-light), var(--letter-gold));
  border: 1px solid var(--letter-gold-light);
  border-radius: var(--letter-radius);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 14px 34px rgba(142, 92, 19, 0.16);
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.letter-submit:hover,
.letter-submit:focus-visible {
  filter: brightness(1.06);
  box-shadow: 0 18px 42px rgba(142, 92, 19, 0.24);
  outline: none;
  transform: translateY(-2px);
}

.letter-submit:active { transform: translateY(0) scale(0.98); }

.letter-submit:disabled {
  cursor: wait;
  filter: saturate(0.65);
  opacity: 0.78;
  transform: none;
}

.letter-helper,
.letter-status {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
}

.letter-helper { color: #aaa18f; }

.letter-status {
  min-height: 16px;
  color: var(--letter-gold-light);
  font-weight: 500;
}

.letter-status[data-tone="error"] { color: var(--letter-danger); }

.letter-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.letter-success {
  max-width: 510px;
  margin-top: 34px;
  padding: 27px;
  background: var(--letter-surface);
  border: 1px solid var(--letter-line);
  border-radius: var(--letter-radius);
  backdrop-filter: blur(14px);
}

.letter-success[hidden] { display: none; }

.letter-success-line {
  display: block;
  width: 52px;
  height: 1px;
  margin-bottom: 21px;
  background: var(--letter-gold);
}

.letter-success h2 {
  margin: 0;
  font-size: 44px;
  line-height: 0.95;
}

.letter-success p {
  max-width: 420px;
  margin: 15px 0 22px;
  color: #cbc3b2;
  font-size: 14px;
}

.letter-success a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--letter-gold-light);
  border-bottom: 1px solid var(--letter-gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.letter-noscript {
  color: var(--letter-danger);
  font-size: 12px;
}

.unsubscribe-shell { grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr); }
.unsubscribe-panel h1 { font-size: clamp(50px, 5.6vw, 78px); line-height: 0.94; }
.unsubscribe-submit { margin-top: 30px; }
.unsubscribe-submit[hidden] { display: none; }
.unsubscribe-status { min-height: 20px; margin-top: 16px; }
.unsubscribe-back {
  display: inline-block;
  margin-top: 20px;
  color: var(--letter-gold-light);
  border-bottom: 1px solid var(--letter-gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.letter-footer {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8f8676;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.letter-footer a {
  color: var(--letter-muted);
  transition: color 180ms ease;
}

.letter-footer a:hover,
.letter-footer a:focus-visible { color: var(--letter-gold-light); }

@keyframes letter-enter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .letter-header,
  .letter-footer,
  .letter-shell { width: min(calc(100% - 40px), 700px); }

  .letter-art {
    left: 0;
    background-position: 68% 20%;
  }

  .letter-shade {
    background:
      linear-gradient(0deg, rgba(8, 7, 5, 0.99) 0%, rgba(8, 7, 5, 0.91) 57%, rgba(8, 7, 5, 0.32) 100%),
      linear-gradient(90deg, rgba(8, 7, 5, 0.72), rgba(8, 7, 5, 0.12));
  }

  .letter-shell {
    grid-template-columns: 1fr;
    align-items: end;
    padding-top: 54px;
  }

  .letter-panel { grid-column: auto; }
  .unsubscribe-shell { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .letter-header {
    height: 70px;
    padding-top: env(safe-area-inset-top);
  }

  .letter-brand { font-size: 20px; }
  .letter-brand-mark { width: 26px; height: 26px; }

  .letter-shell {
    min-height: calc(100dvh - 116px);
    padding: 38px 0 28px;
  }

  h1 {
    font-size: clamp(49px, 14vw, 66px);
    line-height: 0.9;
  }

  .letter-copy {
    margin-top: 21px;
    font-size: 15px;
  }

  .letter-form {
    grid-template-columns: 1fr;
    margin-top: 26px;
  }

  .letter-submit { width: 100%; }
  .letter-helper,
  .letter-status { grid-column: auto; }
  .letter-footer { min-height: 46px; }
}

@media (max-width: 390px), (max-height: 690px) and (max-width: 620px) {
  .letter-eyebrow { margin-bottom: 12px; }
  h1 { font-size: 48px; }
  .letter-copy { margin-top: 17px; font-size: 14px; }
  .letter-form { margin-top: 20px; gap: 9px; }
  .letter-field { gap: 6px; }
  .letter-field input,
  .letter-submit { height: 50px; }
  .letter-helper { font-size: 9px; }
}

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

@media (prefers-reduced-transparency: reduce) {
  .letter-success {
    background: #0d0b08;
    backdrop-filter: none;
  }
}
