:root {
  color-scheme: light dark;
  --bg: #0b0b0c;
  --fg: #f5f5f2;
  --muted: rgba(245, 245, 242, 0.6);
  --accent: #e8622c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Header pinned to the top, content centred in what is left — so a short page
   still sits in the middle rather than under the header. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

main > * { max-width: 32rem; width: 100%; }

/* Visible only once focused: keyboard users can jump the header. */
.skip-link {
  position: absolute;
  left: -9999px;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 0 0 6px 0;
  z-index: 10;
}

.skip-link:focus { left: 0; top: 0; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(245, 245, 242, 0.12);
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}

.brand span { color: var(--accent); }

.account {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.account form { margin: 0; }

/* The address can be long; never let it push the controls off screen. */
.who {
  color: var(--muted);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account a {
  color: var(--fg);
  text-decoration: none;
  opacity: 0.85;
}

.account a:hover { opacity: 1; }

/* A button that reads as a link, so sign-out can be a POST without looking
   like a call to action competing with the page's own. */
.linklike {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.linklike:hover { color: var(--fg); }

/* One visible focus treatment for everything interactive. */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

@media (max-width: 30rem) {
  .site-header { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .account { justify-content: space-between; }
  .who { max-width: none; }
}

h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

h1 span { color: var(--accent); }

.lede {
  font-size: 1.1rem;
  opacity: 0.75;
  margin: 0 0 2rem;
}

.status {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
}

code {
  background: rgba(232, 98, 44, 0.12);
  color: var(--accent);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

footer {
  margin-top: 3rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
  margin: 1.5rem 0;
}

label {
  font-size: 0.85rem;
  color: var(--muted);
}

input {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(245, 245, 242, 0.2);
  border-radius: 6px;
  background: rgba(245, 245, 242, 0.05);
  color: var(--fg);
  font-size: 1rem;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  margin-top: 0.8rem;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: transparent;
  border: 1px solid rgba(245, 245, 242, 0.25);
  color: var(--fg);
  font-weight: 400;
}

.error {
  background: rgba(220, 60, 60, 0.15);
  border: 1px solid rgba(220, 60, 60, 0.4);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  margin: 0;
}

.scopes {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.scopes li { margin: 0.3rem 0; }

.muted {
  font-size: 0.85rem;
  color: var(--muted);
}

.muted a { color: var(--muted); }

/* Links styled as buttons (the index call to action, the header's Sign in). */
a.button {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

a.button.compact { padding: 0.4rem 0.8rem; font-weight: 600; }

a.button.secondary {
  background: transparent;
  border: 1px solid rgba(245, 245, 242, 0.25);
  color: var(--fg);
  font-weight: 400;
}

.cta {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 0 1.5rem;
}

.notice {
  background: rgba(232, 98, 44, 0.12);
  border: 1px solid rgba(232, 98, 44, 0.4);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

.notice a { color: var(--fg); }

/* Prose pages — about, privacy, terms. The centred single-panel layout is for
   forms; a policy nobody can read is the same as not having one. */
main.document {
  justify-content: flex-start;
  text-align: left;
  padding-bottom: 3rem;
}

main.document > * { max-width: 44rem; }

main.document h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-top: 1rem; }

main.document h2 {
  font-size: 1.1rem;
  margin: 2rem 0 0.5rem;
  color: var(--accent);
}

main.document p, main.document li { line-height: 1.6; opacity: 0.85; }

main.document ul { padding-left: 1.2rem; }

main.document li { margin: 0.4rem 0; }

main.document .lede { margin-bottom: 1rem; }

.site-footer {
  border-top: 1px solid rgba(245, 245, 242, 0.12);
  padding: 1rem 1.25rem 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.site-footer nav {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.site-footer a { color: var(--muted); }

.site-footer a:hover { color: var(--fg); }

.site-footer .operator { margin: 0.6rem 0 0; }

.version { font-size: 0.8rem; color: var(--muted); margin-top: 3rem; }

/* The password page saying who is asking. Quiet, but not so quiet that the
   one person who should read it never does. */
.assurance {
  border: 1px solid rgba(245, 245, 242, 0.15);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  margin-top: 1.5rem;
  line-height: 1.5;
}

/* Show/hide control sitting inside the password input. */
.password-field { position: relative; display: flex; }

.password-field input { flex: 1; padding-right: 2.75rem; }

button.reveal {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.75rem;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  color: var(--muted);
}

button.reveal:hover { color: var(--fg); }

button.reveal[hidden] { display: none; }

button.reveal svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button.reveal .eye-closed,
button.reveal[aria-pressed="true"] .eye-open { display: none; }

button.reveal[aria-pressed="true"] .eye-closed { display: block; }

/* Index: what Officine Generative is, and the applications behind the account. */
.intro { line-height: 1.6; opacity: 0.85; margin: 0 0 1.5rem; }

h2.section {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2rem 0 0.75rem;
}

.apps { text-align: left; }

.apps h2.section { text-align: center; }

.app-card {
  border: 1px solid rgba(245, 245, 242, 0.15);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  background: rgba(245, 245, 242, 0.03);
}

.app-card + .app-card { margin-top: 0.75rem; }

.app-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.app-card h3 { margin: 0; font-size: 1.15rem; }

.app-card p { margin: 0.6rem 0 0.9rem; line-height: 1.5; opacity: 0.85; }

.app-host { margin-left: 0.6rem; font-size: 0.8rem; color: var(--muted); }

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 98, 44, 0.45);
  background: rgba(232, 98, 44, 0.12);
  color: var(--accent);
  white-space: nowrap;
}

/* Footer address. Without scripts the halves are drawn here, so the "@" exists
   only in the stylesheet; with scripts contact.js swaps in a real link. */
.site-footer .contact { margin: 0.3rem 0 0; }

.mail::before { content: attr(data-u) "\0040" attr(data-d); }
