/**
 * Shared by every page: the reset, the page defaults, and the pieces that repeat across pages
 * (the wordmark, the language and theme pill). Linked after theme.css and before the page's own
 * stylesheet. Colours, sizes, corners and shadows come from the tokens in theme.css.
 */

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

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

/* A flat ground that fades in from the browser bar colour at the top. The landing page and the
   designer replace it with their gradient. */
body {
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--bg);
  background-image: linear-gradient(to bottom, var(--bg-edge), var(--bg) 96px);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

/* A visitor who asked their system for less motion gets no transitions and no animations.
   The landing page also stops turning the light object (app.js). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

/* The wordmark: always lowercase, Cormorant 600, in the text colour (BRAND_GUIDELINES.md section 5) */
.wordmark {
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  line-height: 1.1;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

/* The pill at the top right: language switch and theme toggle */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 4px 6px 4px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--fs-sm);
  font-weight: 500;
  user-select: none;
  white-space: nowrap;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 2px 4px;
  font-family: inherit;
  transition: color 0.15s ease;
}

.lang-btn:hover { color: var(--text); }

/* Text that stands in the markup in both languages: <html lang> shows one. theme-init.js sets it
   before the first paint, so a page reads in the visitor's language before any script has run.
   The legal pages and the 404 page are written that way; on the designer, the thanks page and the
   order status page the build fills every data-i18n element with both (build.js). */
html[lang="de"] .lang-en,
html:not([lang="de"]) .lang-de {
  display: none;
}

/* The language shown is the one in <html lang> */
html[lang="de"] .lang-btn[data-lang="de"],
html:not([lang="de"]) .lang-btn[data-lang="en"] {
  color: var(--text);
  font-weight: 600;
}

.lang-sep { color: var(--timber); font-size: var(--fs-xs); }

.theme-toggle-btn {
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  color: var(--text);
  border-color: var(--muted);
  transform: scale(1.05);
}

/* The moon in light, the sun in dark */
.theme-toggle-btn .icon-sun { display: none; }
.theme-toggle-btn .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle-btn .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle-btn .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle-btn .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle-btn .icon-moon { display: none; }
}

/* The row of links at the foot of the landing page and the legal pages */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 16px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px;
  transition: color 0.15s ease;
}

.footer-links a:hover,
.footer-links a[aria-current="page"] {
  color: var(--text);
}

.footer-links .dot {
  color: var(--text-faint);
  opacity: 0.5;
}

/* Form pieces, shared by the waitlist dialog (landing page) and the order pane (designer) */
.input-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

/* 16px: a smaller input makes iOS zoom into the page on focus */
.text-input {
  flex: 1;
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: var(--fs-md);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.text-input:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}

.submit-btn {
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-family: var(--font-serif-text);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-button);
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.submit-btn:hover { opacity: 0.92; }
.submit-btn:active { transform: scale(0.98); }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.form-note,
.form-error {
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--muted);
}

.form-error {
  color: var(--danger);
}

.form-success {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--success-soft);
  border: 1px solid var(--success-line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: left;
}

.form-success svg {
  width: 20px;
  height: 20px;
  color: var(--success);
  flex-shrink: 0;
}

.form-success strong {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.form-success p {
  margin-top: 2px;
  font-size: var(--fs-sm);
  line-height: 1.35;
  color: var(--muted);
}
