/* RÖSTFABRIK, roestfabrik.at */

@font-face {
  font-family: "Archivo Black";
  src: url("fonts/ArchivoBlack-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Archivo";
  src: url("fonts/Archivo-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Farbwerte: jeder Wert steht genau einmal hier.
     Akzentfarbe Opalrot (Kremer Pigmente 11302), Startwerte bis zum Abgleich mit dem Pigmentmuster.
     Zum Tauschen nur --accent-light und --accent-dark ändern. */
  --accent-light: #BC4118;  /* 4,60:1 zum Hintergrund */
  --accent-dark: #E0603A;   /* 5,04:1 zum Hintergrund */

  --light-bg: #F0EDE6;
  --light-text: #171717;
  --light-muted: #5C5852;  /* 6,04:1 auf Hintergrund */
  --light-line: #8A857C;   /* 3,14:1, Rahmen von Eingabefeld und Instagram-Button */

  --dark-bg: #171717;
  --dark-text: #F0EDE6;
  --dark-muted: #A6A39C;   /* 7,12:1 auf Hintergrund */
  --dark-line: #6E6A64;    /* 3,34:1 */

  /* Hell ist Standard */
  --bg: var(--light-bg);
  --text: var(--light-text);
  --muted: var(--light-muted);
  --line: var(--light-line);
  --accent: var(--accent-light);
  color-scheme: light;

  --display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --reveal-start: 0.9s;
}

/* Dunkel: per Wahl (data-theme, gesetzt vom Skript im head) oder ohne JavaScript per Systemeinstellung */
:root[data-theme="dark"] {
  --bg: var(--dark-bg);
  --text: var(--dark-text);
  --muted: var(--dark-muted);
  --line: var(--dark-line);
  --accent: var(--accent-dark);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: var(--dark-bg);
    --text: var(--dark-text);
    --muted: var(--dark-muted);
    --line: var(--dark-line);
    --accent: var(--accent-dark);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Startseite ---------- */

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 1.5rem 3.5rem;
  text-align: center;
}

/* Schriftzug: Laufweite und Kerning am Logo ausgemessen (assets/logo.jpg).
   Kerning ist pro Buchstabe fix gesetzt, damit es in jedem Browser gleich sitzt. */
.logo {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.25rem, 12.3vw, 8.5rem);
  line-height: 1;
  letter-spacing: -0.0113em;
  font-kerning: none;
  white-space: nowrap;
  text-transform: none;
}

.logo-word {
  display: inline-block;
  margin-right: 0.0113em; /* Laufweite nach dem letzten Buchstaben ausgleichen */
}

.logo .l {
  display: inline-block;
}

.logo .k-ro { margin-right: -0.017em; } /* Kerning R–Ö */
.logo .k-fa { margin-right: -0.094em; } /* Kerning F–A */

.intro {
  max-width: 30rem;
  margin: clamp(2rem, 6vw, 3.5rem) auto 0;
  font-size: clamp(1.125rem, 2.2vw, 1.3125rem);
  line-height: 1.5;
  text-wrap: balance;
}

.signup {
  width: 100%;
  max-width: 30rem;
  margin: clamp(2rem, 5vw, 3rem) auto 0;
}

.signup-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.signup input[type="email"] {
  flex: none;
  width: 100%;
  min-width: 0;
  height: 3.5rem;
  padding: 0 1.125rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.0625rem; /* ≥16px, sonst zoomt iOS beim Fokus */
  appearance: none;
  transition: border-color 0.15s;
}

.signup input[type="email"]::placeholder {
  color: var(--muted);
  opacity: 1;
}

.signup input[type="email"]:hover,
.signup input[type="email"]:focus {
  border-color: var(--text);
  outline: none;
}

.signup input[type="email"]:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  height: 3.5rem;
  padding: 0 1.75rem;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--display);
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.08s;
}

.btn:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.btn:active {
  transform: translateY(2px);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.btn-ghost {
  height: 3rem;
  padding: 0 1.375rem;
  border-color: var(--line);
  background: transparent;
  color: var(--text);
  font-size: 0.8125rem;
}

.btn-ghost:hover {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost svg {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
}

.signup-msg {
  margin: 0.875rem 0 0;
  font-size: 0.9375rem;
  min-height: 1.5em;
}

.signup-msg:empty {
  display: none;
}

.signup-msg[data-state="error"] {
  color: var(--accent);
}

.signup.is-done .signup-row {
  display: none;
}

.signup.is-done .signup-msg {
  margin: 0;
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--accent);
  font-size: 1.0625rem;
}

.note {
  max-width: 26rem;
  margin: 1.25rem auto 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-wrap: balance;
}

.social {
  margin: clamp(2.5rem, 6vw, 3.5rem) 0 0;
}

.foot {
  padding: 1.5rem 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.8125rem;
  text-align: center;
}

.foot p {
  margin: 0;
}

.foot nav {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.foot a {
  display: inline-block;
  padding: 0.375rem 0;
}

/* Farbmodus-Umschalter: nur sichtbar, wenn JavaScript läuft (data-theme gesetzt) */
.mode {
  display: none;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.75rem;
}

[data-theme] .mode {
  display: flex;
}

.mode button {
  padding: 0.375rem 0.5rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: color 0.15s;
}

.mode button:hover {
  color: var(--accent);
}

.mode button[aria-pressed="true"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: default;
}

@media (min-width: 34em) {
  .signup-row {
    flex-direction: row;
    gap: 0;
  }

  .signup input[type="email"] {
    flex: 1;
    width: auto;
    border-right: 0;
  }
}

/* ---------- Bewegung: nur wenn erwünscht ---------- */

@media (prefers-reduced-motion: no-preference) {

  /* Stanzen: Buchstaben erscheinen nacheinander mit kurzem hartem Ruck */
  .logo .l {
    animation: stamp 0.15s cubic-bezier(0.2, 0, 0, 1) both;
    animation-delay: calc(0.15s + var(--i) * 0.11s);
  }

  @keyframes stamp {
    0%   { opacity: 0; transform: translateY(-0.16em) scale(1.08); }
    1%   { opacity: 1; transform: translateY(-0.16em) scale(1.08); }
    60%  { opacity: 1; transform: translateY(0.025em) scale(1); }
    100% { opacity: 1; transform: none; }
  }

  /* Gestaffeltes Einblenden nach dem Logo */
  .reveal {
    animation: rise 0.6s cubic-bezier(0.2, 0.6, 0.2, 1) both;
    animation-delay: calc(var(--reveal-start) + var(--r, 0) * 0.13s);
  }

  @keyframes rise {
    from { opacity: 0; transform: translateY(0.75rem); }
    to   { opacity: 1; transform: none; }
  }
}

/* ---------- Unterseiten (Impressum, Datenschutz) ---------- */

.page-head {
  padding: 2rem 1.5rem 0;
  text-align: center;
}

.page-head a {
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: -0.0113em;
  text-decoration: none;
}

.page {
  flex: 1;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}

.page h1 {
  margin: 0 0 2.5rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.75rem, 7vw, 2.75rem);
  line-height: 1.1;
  hyphens: auto;
  overflow-wrap: break-word;
}

.page h2 {
  margin: 3rem 0 1rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.1875rem;
  line-height: 1.25;
}

.page h3 {
  margin: 2rem 0 0.5rem;
  font-family: var(--body);
  font-weight: 400;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.page p,
.page address {
  margin: 0 0 1rem;
  font-style: normal;
}

.page dl {
  margin: 0;
}

.page dt {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page dd {
  margin: 0.125rem 0 0;
}
