/* ============================================================
   NachtPoet — "Schreibtisch bei Nacht" / Zettel aesthetic
   Shared styling for all sub-pages (vita, geschichten, kontakt,
   origami, danke, impressum, datenschutz).
   ============================================================ */

:root {
  --ink: #0c1118;
  --ink-2: #141b26;
  --ink-3: #1b2431;
  --paper: #f2ead8;
  --paper-warm: #ece0c2;
  --paper-cool: #e6e6dc;
  --paper-cream: #f7efdb;
  --paper-yellow: #f4dc8c;
  --paper-pink: #e8c7bd;
  --paper-shadow: rgba(0, 0, 0, .55);
  --amber: #e8a451;
  --amber-soft: #f4c17a;
  --ink-text: #1a1510;
  --ink-faded: #4a4238;
  --red: #b84a3b;
  --stamp: #8a2b20;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; }

/* ---- Global desk surface ---- */

.nightshell {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(232, 164, 81, .06), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(184, 74, 59, .05), transparent 60%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
  overflow: hidden;
}

.nightshell::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1200' height='800'><filter id='w'><feTurbulence type='turbulence' baseFrequency='0.01 0.15' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 0 0.04  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23w)'/></svg>");
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
}

.grain::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9  0 0 0 0 0.85  0 0 0 0 0.7  0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: .5;
  mix-blend-mode: soft-light;
  z-index: 100;
}

/* ---- Lamp (flickering warm glow) ---- */

.lamp {
  position: absolute;
  left: 75%;
  top: 12%;
  width: 900px;
  height: 900px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(244, 193, 122, .30) 0%, rgba(232, 164, 81, .18) 18%, rgba(184, 74, 59, .08) 38%, transparent 65%);
  pointer-events: none;
  filter: blur(2px);
  mix-blend-mode: screen;
  animation: flicker 9s infinite;
  z-index: 1;
}

.lamp-left { left: 12%; top: 65%; width: 700px; height: 700px; }

@keyframes flicker {
  0%, 100% { opacity: 1; }
  41% { opacity: .97; }
  42% { opacity: .9; }
  43% { opacity: 1; }
  45% { opacity: .95; }
  46% { opacity: 1; }
  90% { opacity: .98; }
  91% { opacity: .92; }
  92% { opacity: 1; }
}

/* ---- Typography helpers ---- */

.meta  { font-family: "Special Elite", "Courier New", monospace; letter-spacing: .02em; }
.hand  { font-family: "Caveat", cursive; }
.serif { font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif; }
.display { font-family: "Cormorant Garamond", serif; font-weight: 500; }

/* ---- Top Navigation ---- */

.topnav {
  position: relative;
  z-index: 10;
  padding: 28px 5% 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  max-width: 1500px;
  margin: 0 auto;
}

.topnav .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.topnav .brand img {
  height: 84px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .6));
}

.topnav .brand-label {
  color: var(--paper);
  font-size: 13px;
  letter-spacing: .3em;
  text-transform: uppercase;
}

.topnav .brand-label .dot { color: var(--amber); }

.topnav ul {
  display: flex;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.topnav ul a {
  color: rgba(242, 234, 216, .78);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.topnav ul a.active { color: var(--amber); }

.ul-hover { position: relative; }
.ul-hover::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s cubic-bezier(.2, .8, .25, 1);
}
.ul-hover:hover::after { transform: scaleX(1); }

/* ---- Page title block ---- */

.page-title-block {
  position: relative;
  z-index: 3;
  max-width: 1500px;
  margin: 10px auto 40px;
  padding: 30px 5% 10px;
}

.page-title-block .kicker {
  font-family: "Special Elite", monospace;
  font-size: 12px;
  letter-spacing: .25em;
  color: var(--amber);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.page-title-block h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(56px, 8vw, 120px);
  line-height: .95;
  margin: 0;
  font-weight: 500;
  font-style: italic;
  color: var(--paper);
}

.page-title-block .subtitle {
  font-family: "Caveat", cursive;
  color: var(--amber-soft);
  font-size: 26px;
  margin-top: 10px;
}

/* ---- Zettel: paper notes ---- */

.zettel-wrap {
  position: relative;
  z-index: 3;
  max-width: 1500px;
  margin: 0 auto;
  padding: 10px 5% 60px;
}

.zettel {
  position: relative;
  background: linear-gradient(175deg, #f3ead6 0%, #ece0c0 100%);
  color: var(--ink-text);
  padding: clamp(22px, 2.6vw, 40px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .4) inset,
    0 -1px 0 rgba(0, 0, 0, .08) inset,
    0 6px 14px -4px rgba(0, 0, 0, .55),
    0 20px 40px -10px rgba(0, 0, 0, .45);
  clip-path: polygon(
    0% 1.3%, 10% 0.4%, 25% 1.1%, 40% 0.2%, 60% 0.9%, 80% 0.3%, 100% 1.0%,
    99.1% 25%, 99.7% 50%, 98.9% 75%, 99.4% 100%,
    85% 99.3%, 70% 99.8%, 55% 99.1%, 35% 99.6%, 15% 99.2%, 0% 99.5%,
    0.7% 75%, 0.2% 50%, 0.8% 25%
  );
  margin: 0 auto;
}

.zettel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='p'><feTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23p)'/></svg>");
  mix-blend-mode: multiply;
  opacity: .35;
  pointer-events: none;
  clip-path: inherit;
}

.zettel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 255, 255, .15), transparent 45%),
    radial-gradient(140% 120% at 50% 120%, rgba(0, 0, 0, .22), transparent 55%);
  pointer-events: none;
  clip-path: inherit;
}

.zettel > * { position: relative; z-index: 1; }

.zettel.tone-warm  { background: linear-gradient(175deg, #f3ead6 0%, #ece0c0 100%); }
.zettel.tone-cool  { background: linear-gradient(175deg, #e9e8dc 0%, #d8d7c8 100%); }
.zettel.tone-cream { background: linear-gradient(175deg, #f7efdb 0%, #efe2bf 100%); }
.zettel.tone-yellow { background: linear-gradient(175deg, #f4dc8c 0%, #eac966 100%); }
.zettel.tone-pink  { background: linear-gradient(175deg, #e8c7bd 0%, #d9ad9c 100%); }
.zettel.tone-ink   { background: linear-gradient(175deg, #262018 0%, #1a1510 100%); color: #e8d7a8; }

.zettel.rot-n3 { transform: rotate(-3deg); }
.zettel.rot-n2 { transform: rotate(-2deg); }
.zettel.rot-n1 { transform: rotate(-1deg); }
.zettel.rot-0  { transform: rotate(0deg); }
.zettel.rot-p1 { transform: rotate(1deg); }
.zettel.rot-p2 { transform: rotate(2deg); }
.zettel.rot-p3 { transform: rotate(3deg); }

.zettel h2, .zettel h3, .zettel h4 {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 500;
  color: var(--ink-text);
  margin: 0 0 14px;
}

.zettel h2 { font-size: clamp(26px, 3vw, 38px); }
.zettel h3 { font-size: clamp(22px, 2.4vw, 28px); }
.zettel h4 { font-size: 20px; }

.zettel p {
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-text);
  margin: 0 0 14px;
}

.zettel p:last-child { margin-bottom: 0; }

.zettel ul, .zettel ol {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-text);
  padding-left: 22px;
  margin: 0 0 14px;
}

.zettel li { margin-bottom: 6px; }

.zettel a {
  color: var(--stamp);
  text-decoration: none;
  border-bottom: 1px dotted var(--stamp);
}

.zettel a:hover { color: var(--red); border-bottom-style: solid; }

.zettel .kicker {
  font-family: "Special Elite", monospace;
  font-size: 10px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--ink-faded);
  opacity: .75;
  margin-bottom: 10px;
}

.zettel .sig {
  font-family: "Caveat", cursive;
  font-size: 22px;
  color: var(--ink-faded);
  margin-top: 18px;
  text-align: right;
}

.zettel .note {
  font-family: "Caveat", cursive;
  font-size: 22px;
  color: var(--stamp);
  padding: 12px 0 4px;
  border-top: 1px dashed rgba(26, 21, 16, .3);
  margin-top: 18px;
  line-height: 1.35;
}

.zettel strong { color: var(--stamp); font-weight: 600; }

/* Tape + pins */

.tape {
  position: absolute;
  width: 80px;
  height: 22px;
  background: rgba(244, 220, 140, .55);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  z-index: 5;
}
.tape.tl { top: -10px; left: 20px; transform: rotate(-6deg); }
.tape.tr { top: -10px; right: 20px; transform: rotate(6deg); }
.tape.tc { top: -10px; left: 50%; transform: translateX(-50%) rotate(-2deg); }

.pin {
  position: absolute;
  top: -8px; left: 24px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a5a 0%, #b84a3b 60%, #6b1f18 100%);
  box-shadow: 0 3px 5px rgba(0, 0, 0, .5);
  z-index: 6;
}

/* ---- Layouts ---- */

.zettel-stack {
  display: grid;
  gap: clamp(24px, 3vw, 44px);
}

.zettel-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 3vw, 44px);
}

.zettel-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 44px);
}

.narrow-col {
  max-width: 820px;
  margin: 0 auto;
}

/* ---- Timeline ---- */

.timeline {
  position: relative;
  padding: 30px 20px;
  margin: 20px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(138, 43, 32, .45) 0px,
    rgba(138, 43, 32, .45) 8px,
    transparent 8px,
    transparent 16px
  );
  transform: translateX(-50%);
}

.timeline-item {
  display: grid;
  grid-template-columns: 1fr 140px 1fr;
  gap: 24px;
  align-items: start;
  align-items: first baseline;
  margin-bottom: 26px;
}

.timeline-item .year {
  grid-column: 2;
  grid-row: 1;
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 32px;
  line-height: 1;
  color: var(--stamp);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  position: relative;
}

.timeline-item .year::before {
  content: "✦";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  color: var(--amber);
  opacity: 0;
}

.timeline-item .event {
  grid-row: 1;
  font-family: "EB Garamond", Georgia, serif;
  color: var(--ink-text);
  font-size: 18px;
  line-height: 1.5;
  font-weight: 500;
}

.timeline-item:nth-child(odd) .event {
  grid-column: 3;
  text-align: left;
}

.timeline-item:nth-child(even) .event {
  grid-column: 1;
  text-align: right;
}

/* ---- Form (kontakt) ---- */

.form-zettel label {
  display: block;
  font-family: "Special Elite", monospace;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-faded);
  margin-bottom: 6px;
}

.form-zettel input,
.form-zettel textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .35);
  border: 1px solid rgba(26, 21, 16, .18);
  border-radius: 0;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 17px;
  color: var(--ink-text);
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, .06);
  transition: border-color .25s ease, background .25s ease;
}

.form-zettel input:focus,
.form-zettel textarea:focus {
  outline: none;
  border-color: var(--stamp);
  background: rgba(255, 255, 255, .55);
}

.form-zettel textarea {
  min-height: 160px;
  resize: vertical;
  font-family: "EB Garamond", Georgia, serif;
}

.form-zettel .form-group { margin-bottom: 20px; }

.form-zettel .submit-btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--amber);
  padding: 12px 32px;
  font-family: "Special Elite", monospace;
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .25s ease;
  text-decoration: none;
}

.form-zettel .submit-btn:hover {
  background: var(--amber);
  color: var(--ink);
}

.form-zettel .privacy-notice {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 14px;
  font-style: italic;
  color: var(--ink-faded);
  margin-top: 18px;
  line-height: 1.5;
}

/* ---- Origami diagram boxes ---- */

.diagram-image {
  overflow: hidden;
  margin: 0 -14px 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

.diagram-image img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .6s cubic-bezier(.2, .8, .25, 1);
}

.zettel:hover .diagram-image img { transform: scale(1.04); }

.diagram-meta {
  font-family: "Special Elite", monospace;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--ink-faded);
}

.embed-frame {
  width: 100%;
  border: 0;
  background: rgba(0, 0, 0, .15);
}

/* ---- Return / call-to-action button ---- */

.cta-row {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 40px 0 20px;
}

.cta-btn {
  display: inline-block;
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--amber);
  padding: 14px 34px;
  font-family: "Special Elite", monospace;
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all .25s ease;
}

.cta-btn:hover {
  background: var(--amber);
  color: var(--ink);
}

/* ---- Footer ---- */

.nightfoot {
  position: relative;
  z-index: 3;
  padding: 60px 5% 40px;
  border-top: 1px solid rgba(232, 164, 81, .15);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 40px;
  align-items: center;
  max-width: 1500px;
  margin: 0 auto;
}

.nightfoot .copy {
  font-family: "Special Elite", monospace;
  font-size: 11px;
  color: rgba(242, 234, 216, .55);
  letter-spacing: .2em;
  text-transform: uppercase;
}

.nightfoot .greeting {
  font-family: "Caveat", cursive;
  font-size: 28px;
  color: var(--amber);
  text-align: center;
}

.nightfoot .links {
  font-family: "Special Elite", monospace;
  font-size: 11px;
  color: rgba(242, 234, 216, .55);
  letter-spacing: .2em;
  text-transform: uppercase;
  text-align: right;
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.nightfoot .links a { color: inherit; text-decoration: none; }

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .topnav { padding: 20px 5% 14px; gap: 14px; }
  .topnav ul { gap: 16px; }
  .topnav ul a { font-size: 10px; letter-spacing: .15em; }
  .zettel-grid-2, .zettel-grid-3 { grid-template-columns: 1fr; }
  .timeline::before { left: 12px; }
  .timeline-item {
    grid-template-columns: 60px 1fr;
    gap: 16px;
  }
  .timeline-item .year {
    grid-column: 1;
    font-size: 22px;
    text-align: left;
  }
  .timeline-item:nth-child(odd) .event,
  .timeline-item:nth-child(even) .event {
    grid-column: 2;
    text-align: left;
  }
  .page-title-block h1 { font-size: clamp(42px, 12vw, 72px); }
  .zettel { clip-path: none; }
  .nightfoot { grid-template-columns: 1fr; text-align: center; }
  .nightfoot .links { justify-content: center; text-align: center; }
  .nightfoot .copy { text-align: center; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--ink-2); }
::-webkit-scrollbar-thumb { background: var(--ink-3); border-radius: 4px; }

/* fadeUp for content entrance */
@keyframes fadeUp {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.fadeUp { animation: fadeUp .7s ease both; }
.delay-1 { animation-delay: .12s; }
.delay-2 { animation-delay: .24s; }
.delay-3 { animation-delay: .36s; }
.delay-4 { animation-delay: .48s; }
.delay-5 { animation-delay: .60s; }
