:root {
  color-scheme: light dark;
  --te2-red: #d52220;
  --te2-charcoal: #242424;
  --te2-ember: #ff6a1a;
  --te2-yellow: #ffc72c;
  --te2-ivory: #f4f0e8;
  --te2-ink: #171717;
  --te2-line: color-mix(in srgb, var(--te2-charcoal), var(--te2-ivory) 24%);
  --te2-panel: color-mix(in srgb, var(--te2-charcoal), var(--te2-ivory) 7%);
  --te2-muted: color-mix(in srgb, var(--te2-ivory), var(--te2-charcoal) 35%);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--te2-ivory);
  background: var(--te2-charcoal);
}

a { color: inherit; font-weight: 900; text-decoration: none; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--te2-yellow);
  outline-offset: 3px;
}

h1,
h2,
.eyebrow,
.brand-lockup strong {
  font-family: "Barlow Condensed", Inter, ui-sans-serif, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(4rem, 14vw, 10rem); line-height: .82; }
h2 { margin: 0 0 10px; font-size: 1.75rem; }
p { margin: 0; }

.landing-shell {
  width: min(1120px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 48px 0;
}

.landing-copy {
  display: grid;
  gap: 18px;
  max-width: 760px;
}

.landing-logo {
  width: min(420px, 82vw);
  height: auto;
}

.eyebrow {
  color: var(--te2-red);
  font-size: 1.25rem;
}

.descriptor {
  max-width: 620px;
  color: var(--te2-muted);
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 800;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--te2-red);
  color: var(--te2-ivory);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0 16px;
}

.button:hover,
button:hover { background: var(--te2-ember); }

.text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--te2-muted);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--te2-line);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup img { width: 78px; height: auto; }
.brand-lockup span { display: grid; gap: 0; }
.brand-lockup strong { color: var(--te2-red); font-size: 2rem; line-height: .85; }
.brand-lockup small { font-size: .72rem; font-weight: 900; text-transform: uppercase; }

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

nav a,
.ghost {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--te2-muted);
  padding: 8px 10px;
}

nav a:hover,
.ghost:hover { border-color: var(--te2-ember); color: var(--te2-ivory); }
nav a.active { background: var(--te2-red); color: var(--te2-ivory); }
nav form { margin: 0; }

.app-main {
  width: min(1180px, calc(100vw - 32px));
  margin: 28px auto 56px;
}

.page-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--te2-line);
  margin-bottom: 18px;
}

.page-title h1 { font-size: clamp(2.6rem, 7vw, 5.5rem); }
.user-pill { color: var(--te2-muted); font-weight: 900; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.tile,
.panel,
.login-panel {
  border: 1px solid var(--te2-line);
  border-radius: 8px;
  background: var(--te2-panel);
  padding: 20px;
}

.tile {
  min-height: 140px;
  display: grid;
  align-content: space-between;
}

.tile span { color: var(--te2-muted); font-weight: 900; text-transform: uppercase; }
.tile strong { font-size: 1.35rem; }

.login-page { display: grid; align-items: center; }

.login-shell {
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 420px);
  align-items: center;
  gap: 34px;
}

.login-logo { width: min(420px, 90%); }
.login-shell h1 { font-size: clamp(3rem, 8vw, 6rem); }
.login-shell p { color: var(--te2-muted); font-weight: 800; }
.login-panel { display: grid; gap: 14px; }

label {
  display: grid;
  gap: 6px;
  color: var(--te2-muted);
  font-size: .9rem;
  font-weight: 900;
}

input {
  width: 100%;
  border: 1px solid var(--te2-line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--te2-charcoal), var(--te2-ivory) 11%);
  color: var(--te2-ivory);
  font: inherit;
  padding: 11px 12px;
}

.error { color: var(--te2-yellow); font-weight: 900; }

@media (prefers-color-scheme: light) {
  :root {
    --te2-panel: #ffffff;
    --te2-muted: #555555;
    --te2-line: #c8c3ba;
  }

  body {
    background: var(--te2-ivory);
    color: var(--te2-ink);
  }

  input {
    background: #ffffff;
    color: var(--te2-ink);
  }

  .button,
  button,
  nav a.active { color: #ffffff; }
}

@media (max-width: 760px) {
  .app-header,
  .page-title,
  .login-shell {
    display: grid;
    align-items: stretch;
  }

  nav { align-items: stretch; }
  nav a, nav form, .ghost { width: 100%; }
  .ghost { justify-content: center; }
}
