/* ════════════════════════════════════════════
   TEENAGE ENGINEERING SYSTEM — BABUSHKA PHONE
   Shared design tokens, base styles, navigation
   ════════════════════════════════════════════ */

:root {
  --bg:          #e5e5e5;
  --bg-alt:      #f0f0f0;
  --ink:         #0f0e12;
  --ink-50:      rgba(15,14,18,.50);
  --ink-25:      rgba(15,14,18,.25);
  --ink-10:      rgba(15,14,18,.10);
  --ink-06:      rgba(15,14,18,.06);
  --accent:      #e8611a;          /* TE orange */
  --accent-dim:  #c4500f;
  --rule:        rgba(15,14,18,.12);

  --pw:          980px;            /* page width */
  --mw:          clamp(20px, 4.5vw, 45px);  /* margin */
  --gw:          10px;             /* gutter */

  --font:        'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── UTILITY ─── */
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent); font-weight: 400; }
a.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ─── GRID LAYOUT ─── */
.page {
  max-width: var(--pw);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--mw);
  padding-right: var(--mw);
}

/* 12-col grid row */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: calc(var(--gw) / -2);
  margin-right: calc(var(--gw) / -2);
}
.row > * {
  padding-left: calc(var(--gw) / 2);
  padding-right: calc(var(--gw) / 2);
}
/* column spans */
.c1  { width: calc(100% / 12 * 1); }
.c2  { width: calc(100% / 12 * 2); }
.c3  { width: calc(100% / 12 * 3); }
.c4  { width: calc(100% / 12 * 4); }
.c5  { width: calc(100% / 12 * 5); }
.c6  { width: calc(100% / 12 * 6); }
.c7  { width: calc(100% / 12 * 7); }
.c8  { width: calc(100% / 12 * 8); }
.c9  { width: calc(100% / 12 * 9); }
.c10 { width: calc(100% / 12 * 10); }
.c12 { width: 100%; }

/* ─── TYPOGRAPHY SCALE ─── */
.t-xs  { font-size: .75rem; letter-spacing: .04em; }
.t-s   { font-size: .875rem; }
.t-m   { font-size: 1rem; }
.t-l   { font-size: clamp(1.25rem, 2.2vw, 1.5rem); }
.t-xl  { font-size: clamp(1.75rem, 3.6vw, 2.25rem); }
.t-2xl { font-size: clamp(2.25rem, 5vw, 3rem); }
.t-3xl { font-size: clamp(3rem, 7vw, 4.2rem); }

.weight-300 { font-weight: 300; }
.weight-400 { font-weight: 400; }
.weight-500 { font-weight: 500; }
.upper      { text-transform: uppercase; letter-spacing: .1em; }
.ink-50     { color: var(--ink-50); }
.ink-25     { color: var(--ink-25); }

/* ─── HAIRLINE RULES ─── */
.rule      { border-top: 1px solid var(--rule); }
.rule-b    { border-bottom: 1px solid var(--rule); }
.rule-l    { border-left: 1px solid var(--rule); }
.rule-r    { border-right: 1px solid var(--rule); }

/* ─── NAVIGATION ─── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  transition: background .25s;
}
.nav.scrolled { background: rgba(229,229,229,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.nav-inner {
  max-width: var(--pw);
  margin: 0 auto;
  padding: 0 var(--mw);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: .875rem;
  font-weight: 500;
  line-height: 1;
}
.nav-logo .accent { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2.4rem;
  align-items: center;
}
.nav-links a {
  font-size: .75rem;
  font-weight: 400;
  color: var(--ink-50);
  letter-spacing: .02em;
  transition: color .2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links .nav-cta {
  color: var(--accent);
  font-weight: 500;
}
.nav-links .nav-cta:hover { color: var(--accent-dim); }

/* nav auth buttons */
.nav-user {
  font-size: .72rem;
  font-weight: 400;
  color: var(--ink-50);
  letter-spacing: .02em;
}
.nav-links form { display: inline; }
.nav-links form button {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: .75rem;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  letter-spacing: .02em;
  padding: 0;
  transition: color .2s;
}
.nav-links form button:hover { color: var(--accent-dim); }

/* ─── SECTION SPACING ─── */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

.section-head {
  margin-bottom: 48px;
}
.section-head .label {
  font-size: .7rem;
  font-weight: 400;
  color: var(--ink-50);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.section-head h2 {
  font-size: clamp(1.75rem, 3.8vw, 2.5rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.section-head h2 .accent { color: var(--accent); font-weight: 400; }
.section-head p {
  margin-top: 12px;
  font-size: .9rem;
  color: var(--ink-50);
  line-height: 1.6;
  max-width: 480px;
}

/* ─── CTA BUTTON (shared) ─── */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1.4rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .03em;
  border: none;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.hero-cta:hover { background: var(--accent-dim); }
.hero-cta svg { width: 14px; height: 14px; }

/* ─── FOOTER ─── */
.footer {
  background: #1a1a1a;
  color: rgba(255,255,255,.4);
  padding: 40px 0 28px;
}
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-logo {
  font-size: .8rem;
  font-weight: 500;
  color: rgba(255,255,255,.7);
}
.footer-logo .accent { color: var(--accent); }
.footer-links {
  display: flex;
  gap: 1.8rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  font-size: .72rem;
  color: rgba(255,255,255,.4);
  transition: color .2s;
}
.footer-links a:hover { color: rgba(255,255,255,.8); }

.footer-bottom {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-bottom p {
  font-size: .68rem;
  color: rgba(255,255,255,.22);
}

/* ─── REVEAL ANIMATION ─── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s cubic-bezier(.25,.46,.45,.94), transform .55s cubic-bezier(.25,.46,.45,.94);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }
.reveal-d4 { transition-delay: .32s; }

/* ─── FLASH MESSAGES ─── */
.flash-notice {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--rule);
}
.flash-notice-inner {
  max-width: var(--pw);
  margin: 0 auto;
  padding: 10px var(--mw);
  font-size: .82rem;
  color: var(--accent);
  font-weight: 400;
}

/* ─── AUTH FORMS ─── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 52px;
}

.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px var(--mw);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--rule);
  padding: 40px 36px;
}

.auth-label {
  font-size: .7rem;
  font-weight: 400;
  color: var(--ink-50);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.auth-title {
  font-size: clamp(1.5rem, 3vw, 1.8rem);
  font-weight: 300;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: 32px;
}
.auth-title .accent { color: var(--accent); font-weight: 400; }

.auth-field {
  margin-bottom: 20px;
}

.auth-field label {
  display: block;
  font-size: .7rem;
  font-weight: 400;
  color: var(--ink-50);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.auth-field input {
  width: 100%;
  padding: .7rem .9rem;
  border: 1px solid var(--rule);
  background: #fff;
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 300;
  color: var(--ink);
  transition: border-color .2s;
}
.auth-field input:focus {
  border-color: var(--accent);
  outline: none;
}
.auth-field input::placeholder {
  color: var(--ink-25);
}

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: .75rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .03em;
  border: none;
  cursor: pointer;
  transition: background .2s;
  margin-top: 8px;
}
.auth-submit:hover { background: var(--accent-dim); }

.auth-errors {
  border-left: 2px solid var(--accent);
  padding: 12px 16px;
  margin-bottom: 24px;
}
.auth-errors p {
  font-size: .82rem;
  color: var(--accent);
  line-height: 1.5;
}

.auth-links {
  text-align: center;
  margin-top: 24px;
  font-size: .82rem;
  color: var(--ink-50);
}
.auth-links a {
  color: var(--accent);
  font-weight: 400;
}
.auth-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-forgot {
  text-align: right;
  margin-top: -12px;
  margin-bottom: 20px;
}
.auth-forgot a {
  font-size: .7rem;
  color: var(--ink-50);
  letter-spacing: .02em;
  transition: color .2s;
}
.auth-forgot a:hover { color: var(--accent); }

/* ─── DASHBOARD ─── */
.dash-page {
  padding-top: calc(52px + 48px);
  padding-bottom: 80px;
}

.dash-header {
  margin-bottom: 48px;
}
.dash-header .label {
  font-size: .7rem;
  font-weight: 400;
  color: var(--ink-50);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.dash-header h1 {
  font-size: clamp(1.75rem, 3.8vw, 2.5rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.dash-header h1 .accent { color: var(--accent); font-weight: 400; }

.dash-card {
  border: 1px solid var(--rule);
  padding: 32px 28px;
}
.dash-card + .dash-card {
  margin-top: -1px;
}
.dash-card-label {
  font-size: .7rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.dash-card h3 {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 4px;
}
.dash-card p {
  font-size: .82rem;
  color: var(--ink-50);
  line-height: 1.55;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .nav-links { gap: 0; }

  .row { flex-direction: column; }
  .row > .c5, .row > .c7 { width: 100%; }

  .auth-card { padding: 32px 24px; }
}
