/*
 * The Iron Prophet — base layout styles. Design tokens live in tokens.css,
 * self-hosted type in fonts.css, the signature seam in fissure.css. This
 * file is the machined shell: top bar, footer, page scaffolding.
 */

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

html {
  color-scheme: dark;
}

[x-cloak] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 50% -5%, rgba(255, 106, 0, 0.05), transparent 60%),
    var(--void);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  min-width: 0;
  margin-inline: auto;
  padding: var(--s-3);
}

a {
  color: var(--ember-glow);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 var(--s-2);
  background: linear-gradient(180deg, var(--iron-900), var(--void));
  min-width: 0;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ember-deep), transparent);
  opacity: 0.6;
}

.locale-switcher {
  position: absolute;
  right: var(--s-2);
  display: flex;
  gap: var(--s-1);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.topbar-auth {
  position: absolute;
  left: var(--s-2);
  display: flex;
  align-items: center;
  gap: var(--s-1);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.topbar-auth__avatar {
  border-radius: 50%;
  display: block;
}

.topbar-auth__link {
  color: var(--ash);
  text-decoration: none;
  letter-spacing: 0.04em;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.topbar-auth__link:hover {
  color: var(--steel);
}

.topbar-auth__link--signin {
  color: var(--ember-glow);
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--ember-deep);
  border-radius: var(--r-md);
  background: rgba(255, 106, 0, 0.08);
}

.topbar-auth__link--signin:hover {
  color: var(--ember-glow);
  background: rgba(255, 106, 0, 0.16);
  border-color: var(--ember);
}

.locale-switcher__form {
  display: contents;
}

.locale-switcher__link {
  color: var(--ash);
  text-decoration: none;
  letter-spacing: 0.04em;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.locale-switcher__link.is-active {
  color: var(--ember-glow);
}

.locale-switcher__link:not(.is-active):hover {
  color: var(--steel);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  background: var(--steel-clip-short);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.site-footer {
  padding: 2rem 1rem 3rem;
  text-align: center;
  border-top: 1px solid rgba(51, 54, 61, 0.5);
  min-width: 0;
}

.tagline {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
}

.site-status {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4a4e57;
}

/*
 * Buttons — primary (ember, ignites on hover), secondary (iron plate, for
 * a step like Transit's Back), tertiary (a plain underlined link, e.g.
 * "Or face the Mirror"). Bare `.button` is the primary.
 */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.9rem;
  text-decoration: none;
  color: #160a00;
  background: var(--ember-grad);
  border: 0;
  border-radius: var(--r-md);
  box-shadow: inset 0 1px 0 rgba(255, 220, 180, 0.7), 0 0 0 1px rgba(255, 150, 60, 0.35),
    0 12px 34px -8px rgba(255, 106, 0, 0.6);
  padding: 0.875rem 1.625rem;
  min-height: 44px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 235, 205, 0.85), 0 0 0 1px rgba(255, 180, 110, 0.6),
    0 18px 46px -8px rgba(255, 106, 0, 0.85);
}

.button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: inset 0 1px 0 rgba(255, 200, 150, 0.6), 0 0 0 1px rgba(255, 150, 60, 0.35),
    0 8px 20px -8px rgba(255, 106, 0, 0.6);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.button--secondary {
  color: var(--steel);
  background: var(--metal-raised);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 16px -8px rgba(0, 0, 0, 0.8);
}

.button--secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 22px -8px rgba(0, 0, 0, 0.85);
}

.button--secondary:active:not(:disabled) {
  transform: translateY(0);
}

.button--tertiary {
  display: inline;
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  font-size: 0.9rem;
  color: var(--ash);
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  min-height: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.button--tertiary:hover {
  color: var(--ember-glow);
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .button--secondary {
    transition: none;
  }
}

.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 1.5rem;
  line-height: 1;
  background: var(--steel-clip);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.lede {
  font-family: var(--font-passage);
  font-style: italic;
  color: var(--ash);
}
