/* ============================================================
   Fans sagen Danke — Stylesheet
   Monochrome Abschiedsseite: abgestuftes Grau, Tiefschwarz / Off-White,
   Briefe als weißes Papier. Ruhig, würdevoll.
   Farb-Token-Namen (--amber/--oxblood) historisch beibehalten,
   tragen aber bewusst monochrome Werte.
   ============================================================ */

:root {
  /* Palette — light theme (default), monochrom */
  --ground:      #eceae7;   /* soft neutral ground */
  --surface:     #f5f4f2;   /* raised */
  --surface-2:   #fbfaf9;
  --paper:       #ffffff;   /* letter card = weißes Papier */
  --paper-edge:  #e3e1dd;
  --ink:         #1a1a1c;   /* main text */
  --ink-soft:    #55545a;   /* muted */
  --ink-faint:   #8d8c90;
  --amber:       #232227;   /* "Akzent" = Tiefschwarz-Ink (Buttons/Fokus) */
  --amber-strong:#3c3b41;   /* Hover / betonte Labels */
  --oxblood:     #4b4a50;   /* gedämpfter Ton (Pflichtfeld, Signatur, Status) */
  --on-accent:   #f6f5f3;   /* Text auf gefülltem Akzent */
  --hair:        #dcdad5;
  --shadow:      0 1px 2px rgba(20,20,22,.05), 0 8px 24px rgba(20,20,22,.07);
  --shadow-lift: 0 2px 6px rgba(20,20,22,.09), 0 18px 42px rgba(20,20,22,.14);

  --maxw: 1120px;
  --radius: 14px;
  --radius-lg: 20px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Caveat", "Segoe Script", cursive;
}

/* Dark theme via OS preference (unless user forced light) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:      #131314;
    --surface:     #1b1b1d;
    --surface-2:   #232325;
    --paper:       #ecebe8;   /* Briefe bleiben helles Papier */
    --paper-edge:  #d2d0cb;
    --ink:         #ecebe8;   /* text on dark ground */
    --ink-soft:    #a9a8a4;
    --ink-faint:   #78777a;
    --amber:       #ecebe8;   /* Akzent = Off-White auf Dunkel */
    --amber-strong:#ffffff;
    --oxblood:     #b7b5b0;
    --on-accent:   #17171a;   /* dunkler Text auf hellem Akzent */
    --hair:        #2c2c2e;
    --shadow:      0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.5);
    --shadow-lift: 0 2px 8px rgba(0,0,0,.5), 0 24px 60px rgba(0,0,0,.6);
  }
}

/* Explicit dark toggle wins both ways */
:root[data-theme="dark"] {
  --ground:      #131314;
  --surface:     #1b1b1d;
  --surface-2:   #232325;
  --paper:       #ecebe8;
  --paper-edge:  #d2d0cb;
  --ink:         #ecebe8;
  --ink-soft:    #a9a8a4;
  --ink-faint:   #78777a;
  --amber:       #ecebe8;
  --amber-strong:#ffffff;
  --oxblood:     #b7b5b0;
  --on-accent:   #17171a;
  --hair:        #2c2c2e;
  --shadow:      0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.5);
  --shadow-lift: 0 2px 8px rgba(0,0,0,.5), 0 24px 60px rgba(0,0,0,.6);
}

/* Briefe sind immer dunkle Tinte auf hellem Papier — stabile "auf Papier"-Töne. */
:root { --paper-ink: #232227; --paper-ink-soft: #67666b; --paper-edge-hair: #e3e1dd; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
img { max-width: 100%; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

a { color: inherit; }

/* ---------- Buttons ---------- */
.btn {
  --bg: transparent; --fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font-body); font-weight: 600; font-size: .96rem;
  line-height: 1; letter-spacing: .01em;
  padding: .78em 1.25em; border-radius: 999px;
  border: 1.5px solid transparent; background: var(--bg); color: var(--fg);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.btn-lg { font-size: 1.02rem; padding: .95em 1.55em; }
.btn-amber { --bg: var(--amber); --fg: var(--on-accent); border-color: var(--amber); box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--amber) 70%, transparent); }
.btn-amber:hover { --bg: var(--amber-strong); border-color: var(--amber-strong); }
.btn-ghost { --fg: var(--ink); border-color: var(--hair); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber-strong); }

.link-btn { background: none; border: none; color: var(--amber-strong); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}
.head-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: .6em; text-decoration: none; font-weight: 700; }
.brand-txt { font-family: var(--font-display); font-size: 1.18rem; letter-spacing: .005em; }
.brand-mark {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 14%, transparent);
}
.head-nav { display: flex; align-items: center; gap: 1.1rem; }
.head-nav > a:not(.btn) { text-decoration: none; font-weight: 600; color: var(--ink-soft); font-size: .95rem; }
.head-nav > a:not(.btn):hover { color: var(--amber-strong); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(64px, 10vw, 120px) 0 clamp(48px, 6vw, 80px);
  background:
    radial-gradient(100% 80% at 50% -20%, color-mix(in srgb, var(--ink) 8%, transparent), transparent 60%);
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--hair), transparent);
}
.hero-inner { position: relative; max-width: 860px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .16em; font-size: .76rem; font-weight: 700;
  color: var(--amber-strong); margin: 0 0 .9rem;
}
.hero-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.9rem, 8.5vw, 5.6rem); line-height: .98; letter-spacing: -.015em;
  margin: 0 0 1.1rem; text-wrap: balance;
}
.hero-lead {
  font-size: clamp(1.05rem, 1.8vw, 1.28rem); color: var(--ink-soft);
  max-width: 60ch; margin: 0 0 1.8rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 2.4rem; }
.hero-stats { display: flex; gap: 2.4rem; margin: 0; flex-wrap: wrap; }
.hero-stats > div { display: flex; flex-direction: column-reverse; gap: .1rem; }
.hero-stats dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); }
.hero-stats dd {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem); line-height: 1; color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- Sections ---------- */
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-head { max-width: 60ch; margin-bottom: 2.2rem; }
.section-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.05; letter-spacing: -.01em;
  margin: 0 0 .5rem; text-wrap: balance;
}
.section-sub { color: var(--ink-soft); font-size: 1.08rem; margin: 0; }

.wall-section { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface) 45%, transparent)); }

/* ---------- Brief-Wand (Masonry via columns) ---------- */
.wall {
  columns: 3 300px;
  column-gap: 22px;
}
.wall-loading, .wall-empty {
  color: var(--ink-faint); font-style: italic; padding: 2rem 0;
}
.letter {
  break-inside: avoid; margin: 0 0 22px;
  background: var(--paper); color: var(--paper-ink);
  border: 1px solid var(--paper-edge); border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.25rem; box-shadow: var(--shadow);
  position: relative;
  transition: transform .16s ease, box-shadow .2s ease;
}
.letter:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.letter.is-featured { border-color: color-mix(in srgb, var(--amber) 55%, var(--paper-edge)); }
.letter.is-featured::before {
  content: "Herausgehoben"; position: absolute; top: -10px; left: 16px;
  background: var(--amber); color: var(--on-accent); font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; padding: .25em .6em; border-radius: 999px;
}
.letter-quote {
  font-size: 1.06rem; line-height: 1.62; color: var(--paper-ink);
  margin: 0 0 1rem; white-space: pre-wrap; overflow-wrap: anywhere;
}
.letter-video {
  width: 100%; border-radius: 10px; background: #000; margin: 0 0 1rem;
  display: block; aspect-ratio: 16 / 10; object-fit: cover;
}
.letter-sign { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; border-top: 1px dashed var(--paper-edge-hair); padding-top: .8rem; }
/* Signatur immer dunkle Tinte auf hellem Papier (paper ist in beiden Themes hell) */
.letter-name { font-family: var(--font-hand); font-size: 1.6rem; line-height: 1; color: #45434a; }
.letter-meta { text-align: right; font-size: .78rem; color: var(--paper-ink-soft); line-height: 1.35; }
.letter-meta .city { font-weight: 600; display: block; }

.wall-more { text-align: center; margin-top: 1.4rem; }

/* ---------- Formular ---------- */
.form-section { background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 55%, transparent), transparent); }
/* Volle Seitenbreite: eigener, breiter Container statt der 1120px-Grenze */
.form-wrap { max-width: 1500px; display: block; }
.form-intro { max-width: 70ch; margin: 0 auto 2rem; text-align: center; }
.form-intro .section-head, .form-intro .section-sub { }
.form-notes { margin: 1.4rem auto 0; padding: 0; list-style: none; display: grid; gap: .7rem; max-width: 60ch; text-align: left; }
.form-notes li { position: relative; padding-left: 1.5rem; color: var(--ink-soft); font-size: .96rem; }
.form-notes li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }

.card {
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.form-card { padding: clamp(24px, 4vw, 56px); display: grid; gap: 1.7rem; }
.field { display: grid; gap: .55rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.field label { font-weight: 600; font-size: 1rem; }
.req { color: var(--oxblood); }
.opt { color: var(--ink-faint); font-weight: 500; font-size: .82em; }
.field input[type="text"], .field textarea {
  font: inherit; color: var(--ink); font-size: 1.05rem;
  background: var(--surface-2); border: 1.5px solid var(--hair);
  border-radius: 12px; padding: 1em 1.05em; width: 100%; resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}
/* Das große Schreibfeld — der Kern der Abschiedsseite */
#f-msg { min-height: clamp(240px, 34vh, 420px); line-height: 1.7; font-size: 1.12rem; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--amber);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 18%, transparent);
}
.counter { justify-self: end; font-size: .78rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* File drop */
.filedrop { position: relative; border: 1.5px dashed var(--hair); border-radius: 12px; background: var(--surface-2); transition: border-color .15s ease, background .15s ease; }
.filedrop.dragover { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, var(--surface-2)); }
.filedrop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.filedrop-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem; padding: 1.6rem 1rem; pointer-events: none; }
.filedrop-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber-strong); font-size: .9rem; }
.filedrop-text { font-weight: 600; }
.filedrop-hint { font-size: .82rem; color: var(--ink-faint); }
.filedrop-picked { padding: 1rem; }
.video-preview { width: 100%; max-height: 260px; border-radius: 10px; background: #000; display: block; }
.filedrop-meta { display: flex; align-items: center; gap: .7rem; margin-top: .7rem; flex-wrap: wrap; font-size: .86rem; }
.video-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.video-size { color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.checkbox-field { }
.checkbox { display: flex; align-items: flex-start; gap: .6rem; font-weight: 500; font-size: .95rem; cursor: pointer; }
.checkbox input { margin-top: .18em; width: 18px; height: 18px; accent-color: var(--amber); }

.form-foot { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.form-status { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.form-status.error { color: var(--oxblood); font-weight: 600; }
.form-status.ok { color: var(--amber-strong); font-weight: 600; }

.turnstile-box:empty { display: none; }
.turnstile-box { min-height: 0; }

.upload-progress { margin-top: .4rem; }
.upload-bar { height: 8px; border-radius: 999px; background: var(--hair); overflow: hidden; }
.upload-bar > span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--amber), var(--amber-strong)); transition: width .2s ease; }
.upload-label { margin: .5rem 0 0; font-size: .84rem; color: var(--ink-soft); }

/* Thanks overlay */
.thanks-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 22px;
  background: color-mix(in srgb, #000 55%, transparent); backdrop-filter: blur(4px); }
.thanks-card { max-width: 440px; text-align: center; padding: 2.2rem 2rem; display: grid; gap: .8rem; justify-items: center; }
.thanks-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--amber); color: var(--on-accent); font-size: 1.6rem; font-weight: 700; }
.thanks-card h3 { font-family: var(--font-display); font-size: 1.5rem; margin: 0; }
.thanks-card p { color: var(--ink-soft); margin: 0; }

/* ---------- Hero-Brief ---------- */
.hero-letter { display: grid; gap: .95rem; }
.hero-letter p { margin: 0; }
.hero-letter-close { font-style: italic; color: var(--ink); }

/* ---------- Info-Button ---------- */
.btn-info { gap: .5em; }
.info-i {
  display: inline-grid; place-items: center; width: 1.35em; height: 1.35em;
  border-radius: 50%; border: 1.5px solid currentColor;
  font-family: var(--font-display); font-style: italic; font-size: .82em; line-height: 1;
}
.form-hinweis-link { margin: 1.2rem 0 0; }

/* ---------- Hinweis-Overlay ---------- */
.info-overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 22px;
  background: color-mix(in srgb, #000 62%, transparent); backdrop-filter: blur(5px); }
.info-card {
  position: relative; max-width: 680px; width: 100%; max-height: 86vh; overflow-y: auto;
  text-align: left; padding: clamp(26px, 4vw, 48px); display: grid; gap: 1rem;
}
.info-close {
  position: absolute; top: 10px; right: 14px; background: none; border: none;
  font-size: 1.7rem; line-height: 1; color: var(--ink-faint); cursor: pointer; padding: .1em .2em;
}
.info-close:hover { color: var(--ink); }
.info-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 1.5rem 0 0; }
.info-body { display: grid; gap: .95rem; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.66; }
.info-body p { margin: 0; }
.info-years { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); text-align: center; letter-spacing: .01em; }
.info-close-line { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); text-align: center; }
.info-card .btn-amber { justify-self: start; margin-top: .4rem; }

/* ---------- Feld-Hinweis ---------- */
.field-hint { font-size: .84rem; color: var(--ink-faint); line-height: 1.4; }

/* ---------- E-Mail-Bestätigung ---------- */
.verify-card { max-width: 460px; text-align: center; }
.verify-card .info-title { margin-right: 1.5rem; text-align: left; }
.verify-text { color: var(--ink-soft); margin: 0; text-align: left; }
.verify-text strong { color: var(--ink); }
.verify-code {
  font: inherit; font-family: var(--font-display); font-size: 1.9rem; font-weight: 600;
  letter-spacing: .3em; text-indent: .3em; text-align: center;
  color: var(--ink); background: var(--surface-2);
  border: 1.5px solid var(--hair); border-radius: 12px; padding: .5em .3em; width: 100%;
}
.verify-code::placeholder { letter-spacing: normal; text-indent: 0; font-family: var(--font-body); font-size: 1rem; }
.verify-code:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 18%, transparent); }
.verify-actions { display: grid; gap: .8rem; justify-items: center; }
.verify-actions .btn-amber { width: 100%; }
.verify-hint { font-size: .82rem; color: var(--ink-faint); margin: 0; text-align: left; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--hair); padding: 2.4rem 0; margin-top: 2rem; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.foot-line { margin: 0; color: var(--ink-faint); font-size: .86rem; max-width: 60ch; }
.foot-meta { margin: 0; display: flex; align-items: center; gap: .6rem; font-size: .86rem; color: var(--ink-faint); }
.foot-admin { color: var(--ink-faint); text-decoration: none; }
.foot-admin:hover { color: var(--amber-strong); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .form-wrap { grid-template-columns: 1fr; }
  .form-intro { position: static; }
  .wall { columns: 2 260px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .field-row { grid-template-columns: 1fr; }
  .head-nav > a:not(.btn) { display: none; }
  .wall { columns: 1; }
  .hero-stats { gap: 1.6rem; }
}
