/* ============ BASE — structure + variables ============ */
:root {
  /* Default (Skiss) palette — themes override these */
  --bg: #f6f5f1;
  --paper: #fbfaf7;
  --ink: #15140f;
  --ink-2: #4a4842;
  --ink-3: #8a8780;
  --line: #e5e2d8;
  --line-2: #d8d4c7;
  --panel: #15140f;
  --panel-ink: #f6f5f1;
  --panel-ink-2: #a8a59b;
  --panel-line: #2a2823;
  --accent: #15140f;
  --radius: 0px;

  --font-sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-display: var(--font-sans);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --bg-pattern: none;

  font-family: var(--font-sans);
}

* { box-sizing: border-box; }

html, body, #root {
  height: 100%;
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-pattern);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; }
a { color: var(--ink); text-underline-offset: 3px; }
.app { height: 100%; }

/* ============ Brand ============ */
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand__mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
}
.brand--top .brand__mark { width: 24px; height: 24px; }
.brand__name {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ============ Login ============ */
.login {
  min-height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 40px;
}
.login__inner {
  width: 100%;
  max-width: 380px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.login__head { display: flex; flex-direction: column; gap: 10px; }
.login__title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0;
}
.login__sub { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 32ch; }
.login__legal {
  text-align: center;
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

/* ============ Form ============ */
.form { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex;
  justify-content: space-between;
}
.field__aux {
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  color: var(--ink-3);
  text-decoration: none;
}
.field__aux:hover { color: var(--ink); }
.field input {
  appearance: none;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  background: transparent;
  padding: 8px 0 10px;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  border-radius: 0;
  transition: border-color 0.2s var(--ease);
  font-family: var(--font-sans);
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus { border-bottom-color: var(--ink); }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin-top: -4px;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box {
  width: 16px; height: 16px;
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  color: transparent;
  transition: color 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
  border-radius: var(--radius);
}
.check input:checked + .check__box {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.check__label {
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}

.btn {
  appearance: none;
  border: 1px solid var(--ink);
  background: transparent;
  padding: 14px 18px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.1s var(--ease);
  font-family: var(--font-sans);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ink); color: var(--bg); margin-top: 6px; }
.btn--primary:hover { background: #000; }
.btn:disabled { opacity: 0.5; cursor: progress; }

.form__error {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b8442a;
  margin-top: -8px;
}

.menu__item { text-decoration: none; }
.menu__arrow--soon {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--panel-ink-2);
  opacity: 0.6;
}

/* ============ Home ============ */
.home { position: relative; height: 100%; overflow: hidden; }
.top {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 28px;
}
.top .brand { justify-self: center; }

.hbtn {
  justify-self: start;
  width: 40px; height: 40px;
  background: transparent;
  border: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}
.hbtn span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease), background 0.25s var(--ease);
  transform-origin: center;
}
.hbtn.is-open span { background: var(--panel-ink); }
.hbtn.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hbtn.is-open span:nth-child(2) { opacity: 0; }
.hbtn.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.avatar {
  justify-self: end;
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.avatar:hover { background: var(--ink); color: var(--bg); }

.stage {
  height: calc(100% - 84px);
  display: grid;
  place-items: center;
  padding: 24px;
}
.hello { width: 100%; max-width: 520px; text-align: center; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.hello .eyebrow { color: var(--ink-3); }
.hello__title {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.025em;
  margin: 0;
}
.hello__cta {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.hello__cta:hover { background: var(--ink); color: var(--bg); }

/* ============ Scrim ============ */
.scrim {
  position: absolute;
  inset: 0;
  background: rgba(21, 20, 15, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
  z-index: 2;
}
.scrim.is-on { opacity: 1; pointer-events: auto; }

/* ============ Menu ============ */
.menu {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: min(420px, 92vw);
  background: var(--panel);
  color: var(--panel-ink);
  transform: translateX(-101%);
  transition: transform 0.5s var(--ease);
  z-index: 3;
  display: flex;
  flex-direction: column;
  padding: 22px 0 0;
}
.menu.is-open { transform: translateX(0); }
.menu__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px 24px;
}
.menu__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--panel-ink-2);
}
.menu__close {
  width: 32px; height: 32px;
  background: transparent;
  border: 0;
  color: var(--panel-ink);
  cursor: pointer;
  display: grid; place-items: center;
  opacity: 0.7;
  transition: opacity 0.18s var(--ease);
}
.menu__close:hover { opacity: 1; }

.menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
}
.menu__list li {
  border-top: 1px solid var(--panel-line);
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  transition-delay: calc(80ms + var(--i) * 50ms);
}
.menu__list li:last-child { border-bottom: 1px solid var(--panel-line); }
.menu.is-open .menu__list li { opacity: 1; transform: translateX(0); }

.menu__item {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px 28px;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: var(--panel-ink);
  transition: background 0.18s var(--ease), padding 0.25s var(--ease);
  font-family: var(--font-sans);
}
.menu__item:hover { background: rgba(255,255,255,0.04); padding-left: 34px; }
.menu__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--panel-ink-2);
}
.menu__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.menu__label { font-size: 18px; letter-spacing: -0.01em; }
.menu__hint { font-size: 12px; color: var(--panel-ink-2); font-family: var(--font-mono); letter-spacing: 0.02em; }
.menu__arrow {
  color: var(--panel-ink-2);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s var(--ease), transform 0.25s var(--ease);
}
.menu__item:hover .menu__arrow { opacity: 1; transform: translateX(0); color: var(--panel-ink); }

.menu__foot {
  padding: 18px 28px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.menu__foot-item {
  background: transparent;
  border: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--panel-ink-2);
  cursor: pointer;
}
.menu__foot-item:hover { color: var(--panel-ink); }
.menu__foot-meta { font-family: var(--font-mono); font-size: 10px; color: var(--panel-ink-2); letter-spacing: 0.08em; }

/* ============ Toast ============ */
.toast {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: var(--panel);
  color: var(--panel-ink);
  padding: 16px 48px 16px 20px;
  min-width: 320px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 4;
  animation: toast-in 0.35s var(--ease);
  border-radius: var(--radius);
}
.toast__title { font-size: 14px; letter-spacing: 0.02em; }
.toast__sub { font-size: 11px; color: var(--panel-ink-2); font-family: var(--font-mono); }
.toast__x {
  position: absolute;
  top: 6px; right: 8px;
  background: transparent;
  border: 0;
  color: var(--panel-ink-2);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.toast__x:hover { color: var(--panel-ink); }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
