:root {
  --o-bg: #000000;
  --o-fg: #ffffff;
  --o-muted: #8a8a8a;
  --o-line: #2a2a2a;
  --o-line-strong: #ffffff;
  --o-surface: #0a0a0a;
  --o-radius: 0;
  --o-font-display: "Space Grotesk", "Helvetica Neue", sans-serif;
  --o-font-body: "IBM Plex Sans", "Helvetica Neue", sans-serif;
  --o-max: 1120px;
  --o-pad: clamp(1.25rem, 4vw, 3rem);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--o-bg);
  color: var(--o-fg);
  font-family: var(--o-font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* Atmosphere: hard geometric grid */
.page-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 20%, transparent 75%);
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--o-pad);
  border-bottom: 1px solid var(--o-line);
  background: rgba(0, 0, 0, 0.85);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-mark {
  font-family: var(--o-font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-variant-numeric: slashed-zero;
  font-feature-settings: "zero" 1;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.site-nav a {
  padding: 0.35rem 0.45rem;
  border: 1px solid transparent;
  border-radius: var(--o-radius);
  transition: border-color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  border-color: var(--o-line-strong);
  outline: none;
}

/* Buttons — thin white outline on hover */
.btn-rect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem;
  border: 1px solid var(--o-fg);
  border-radius: var(--o-radius);
  background: var(--o-fg);
  color: var(--o-bg);
  font-family: var(--o-font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: outline 160ms ease, outline-offset 160ms ease, background 160ms ease, color 160ms ease;
  outline: 1px solid transparent;
  outline-offset: 0;
}

.btn-rect:hover,
.btn-rect:focus-visible {
  outline: 1px solid var(--o-fg);
  outline-offset: 3px;
}

.btn-rect--ghost {
  background: transparent;
  color: var(--o-fg);
}

.btn-rect--ghost:hover,
.btn-rect--ghost:focus-visible {
  background: transparent;
}

/* Hero */
.hero {
  min-height: calc(100vh - 57px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2.5rem, 8vh, 5rem) var(--o-pad);
  max-width: var(--o-max);
  border-bottom: 1px solid var(--o-line);
}

.hero-brand {
  margin: 0 0 1.5rem;
  font-family: var(--o-font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 12vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: slashed-zero;
  font-feature-settings: "zero" 1;
  opacity: 0;
  transform: translateY(18px);
  animation: brand-in 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 80ms forwards;
}

.hero-headline {
  margin: 0 0 0.85rem;
  max-width: 16ch;
  font-family: var(--o-font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.5vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(12px);
  animation: brand-in 800ms cubic-bezier(0.2, 0.7, 0.2, 1) 220ms forwards;
}

.hero-lede {
  margin: 0 0 2rem;
  max-width: 36rem;
  color: var(--o-muted);
  font-weight: 300;
  font-size: 1.05rem;
  opacity: 0;
  transform: translateY(12px);
  animation: brand-in 800ms cubic-bezier(0.2, 0.7, 0.2, 1) 340ms forwards;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(12px);
  animation: brand-in 800ms cubic-bezier(0.2, 0.7, 0.2, 1) 460ms forwards;
}

@keyframes brand-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sections */
.section {
  padding: clamp(3.5rem, 10vh, 6rem) var(--o-pad);
  max-width: var(--o-max);
  border-bottom: 1px solid var(--o-line);
}

.section-label {
  margin-bottom: 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--o-muted);
  font-weight: 500;
}

.section-title {
  margin: 0 0 0.75rem;
  font-family: var(--o-font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.section-lede {
  margin: 0 0 2.25rem;
  max-width: 38rem;
  color: var(--o-muted);
  font-weight: 300;
}

/* Atlas product frame */
.atlas-frame {
  margin-bottom: 2.5rem;
  border: 1px solid var(--o-line);
  background: var(--o-surface);
}

.atlas-chrome {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--o-line);
}

.atlas-chrome-title {
  font-family: var(--o-font-display);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.atlas-chrome-meta {
  color: var(--o-muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.atlas-canvas {
  position: relative;
  min-height: clamp(220px, 36vh, 360px);
  overflow: hidden;
  background:
    linear-gradient(180deg, #050505 0%, #000 100%);
}

.atlas-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 40px 40px;
}

.atlas-marker {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1px solid var(--o-fg);
  background: var(--o-bg);
}

.atlas-marker--a { top: 28%; left: 34%; }
.atlas-marker--b { top: 48%; left: 58%; }
.atlas-marker--c { top: 62%; left: 42%; }

.atlas-rail {
  position: absolute;
  top: 0;
  right: 0;
  width: min(220px, 38%);
  height: 100%;
  border-left: 1px solid var(--o-line);
  background: rgba(0, 0, 0, 0.72);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.atlas-rail-row {
  height: 28px;
  border: 1px solid var(--o-line);
}

.atlas-access-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.atlas-access-hint {
  margin: 1.5em 0 0;
}

/* Approach — rectangles, not cards */
.approach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--o-line);
}

.approach-cell {
  padding: 1.5rem 1.25rem;
  border-right: 1px solid var(--o-line);
  background: transparent;
}

.approach-cell:last-child {
  border-right: none;
}

.approach-cell h3 {
  margin: 0 0 0.75rem;
  font-family: var(--o-font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.approach-cell p {
  margin: 0;
  color: var(--o-muted);
  font-weight: 300;
  font-size: 0.95rem;
}

/* Team list */
.team-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--o-line);
}

.team-list li {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--o-line);
}

.team-list li:last-child {
  border-bottom: none;
}

.team-role {
  font-family: var(--o-font-display);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.team-desc {
  color: var(--o-muted);
  font-weight: 300;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.form-span-2 {
  grid-column: 1 / -1;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--o-muted);
  font-weight: 500;
}

input,
textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--o-line);
  border-radius: var(--o-radius);
  background: var(--o-bg);
  color: var(--o-fg);
  font-family: var(--o-font-body);
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
  outline: 1px solid transparent;
  outline-offset: 0;
  transition: outline 160ms ease, outline-offset 160ms ease, border-color 160ms ease;
}

input:hover,
textarea:hover,
input:focus-visible,
textarea:focus-visible {
  border-color: var(--o-fg);
  outline: 1px solid var(--o-fg);
  outline-offset: 2px;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.form-status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--o-line);
  font-size: 0.9rem;
}

.form-status--ok {
  border-color: var(--o-fg);
}

.form-status--err {
  border-color: var(--o-muted);
  color: var(--o-muted);
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.5rem var(--o-pad) 2.5rem;
  color: var(--o-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms cubic-bezier(0.2, 0.7, 0.2, 1), transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero[data-reveal] {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (max-width: 800px) {
  .approach-grid {
    grid-template-columns: 1fr;
  }

  .approach-cell {
    border-right: none;
    border-bottom: 1px solid var(--o-line);
  }

  .approach-cell:last-child {
    border-bottom: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .team-list li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .site-nav:not(.site-nav--admin) {
    display: none;
  }

  .atlas-rail {
    display: none;
  }

  .inbox-grid {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    max-width: none;
  }
}

/* Auth + inbox */
.auth-shell,
.inbox-shell {
  position: relative;
  z-index: 1;
  padding: clamp(2.5rem, 8vh, 4rem) var(--o-pad) 4rem;
  max-width: var(--o-max);
}

.auth-panel {
  max-width: 420px;
  border: 1px solid var(--o-line);
  padding: 1.75rem 1.5rem 2rem;
  background: var(--o-surface);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.flash-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.flash {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--o-line);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.flash--error {
  border-color: var(--o-muted);
  color: var(--o-muted);
}

.flash--ok {
  border-color: var(--o-fg);
}

.site-nav--admin {
  align-items: center;
  gap: 0.75rem;
}

.nav-user {
  color: var(--o-muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.inline-form {
  display: inline;
  margin: 0;
}

.btn-rect--compact {
  padding: 0.45rem 0.75rem;
  font-size: 0.68rem;
}

.inbox-intro {
  margin-bottom: 2rem;
}

.inbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--o-line);
}

.inbox-box {
  min-width: 0;
  border-right: 1px solid var(--o-line);
  background: var(--o-surface);
}

.inbox-box:last-child {
  border-right: none;
}

.inbox-box-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--o-line);
}

.inbox-box-header h2 {
  margin: 0;
  font-family: var(--o-font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.inbox-count {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--o-muted);
}

.inbox-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(70vh, 720px);
  overflow: auto;
}

.inbox-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--o-line);
}

.inbox-item:last-child {
  border-bottom: none;
}

.inbox-meta {
  margin-bottom: 0.65rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--o-muted);
  text-transform: uppercase;
}

.inbox-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
}

.inbox-row span {
  color: var(--o-muted);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 0.2rem;
}

.inbox-row strong,
.inbox-row a {
  font-weight: 400;
  word-break: break-word;
}

.inbox-row a:hover,
.inbox-row a:focus-visible {
  outline: 1px solid var(--o-fg);
  outline-offset: 2px;
}

.inbox-row--block {
  grid-template-columns: 1fr;
  gap: 0.35rem;
}

.inbox-empty {
  margin: 0;
  padding: 1.5rem 1.25rem;
  color: var(--o-muted);
  font-weight: 300;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-brand,
  .hero-headline,
  .hero-lede,
  .cta-row,
  [data-reveal] {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
