/* Tokens taken from the Alter Mobile mockup, which inverts the Modernist
   design system for dark. The accent values are that system's ramp:
   #ff563c is --color-accent-500, #ec3013 is --color-accent, and the light
   ground #f3f2f2 becomes the text colour here. */
:root {
  --ground: #0a0908;
  --raised: rgba(243, 242, 242, 0.045);
  --raised-hover: rgba(243, 242, 242, 0.08);
  --hairline: rgba(243, 242, 242, 0.07);
  --text: #f3f2f2;
  --muted: rgba(243, 242, 242, 0.5);
  --faint: rgba(243, 242, 242, 0.35);
  --accent: #ff563c;
  --accent-press: #ec3013;
  --font: 'Archivo', system-ui, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 800px at 50% 0%, #171210 0%, var(--ground) 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ── brand ─────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: 0.1em; }
.brand-sub { font-weight: 600; font-size: 9px; letter-spacing: 0.14em; color: var(--accent); }

.orb {
  width: 34px; height: 34px; flex: none;
  border-radius: 99px; display: grid; place-items: center;
  background: radial-gradient(circle at 40% 35%, #ff563c 0%, #ec3013 45%, #7a1608 100%);
  box-shadow: 0 0 20px rgba(236, 48, 19, 0.55);
}
.orb-core {
  width: 6px; height: 6px; border-radius: 99px; background: #fff;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .orb-core { animation: none; opacity: 1; }
  .progress-bar { transition: none; }
}

/* ── buttons ───────────────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-quiet, .btn-ghost, .btn-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font); font-weight: 700; font-size: 13px;
  border-radius: 14px; border: 1px solid transparent;
  cursor: pointer; color: var(--text);
}
.btn-primary, .btn-secondary { padding: 12px 18px; }
.btn-primary {
  background: linear-gradient(160deg, #ec3013 0%, #a81f0b 100%);
  box-shadow: 0 8px 28px rgba(236, 48, 19, 0.35); color: #fff;
}
.btn-primary:hover:not(:disabled)  { filter: brightness(1.08); }
.btn-primary:active:not(:disabled) { transform: scale(0.97); }
.btn-secondary { background: var(--raised); border-color: rgba(243, 242, 242, 0.09); }
.btn-secondary:hover:not(:disabled) { background: var(--raised-hover); }
.btn-secondary:active:not(:disabled) { transform: scale(0.97); }
.btn-quiet {
  background: none; color: var(--muted); font-weight: 600; padding: 10px 0;
  justify-content: flex-start;
}
.btn-quiet:hover { color: var(--text); }
.btn-ghost { background: none; color: var(--accent); padding: 8px 4px; }
.btn-ghost:hover:not(:disabled) { color: var(--accent-press); }
.btn-icon {
  width: 34px; height: 34px; padding: 0; flex: none; border-radius: 99px;
  background: var(--raised); border-color: rgba(243, 242, 242, 0.09);
}
.btn-icon:hover { background: var(--raised-hover); }
.btn-wide { width: 100%; padding: 15px; font-size: 14px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── login ─────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--faint);
}
.field input {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  background: var(--raised); border: 1px solid var(--hairline);
  color: var(--text);
  /* 16px keeps iOS Safari from zooming the page when the field takes focus. */
  font: 400 16px var(--font);
  caret-color: var(--accent);
}
.field input:focus { border-color: rgba(236, 48, 19, 0.55); outline: none; }
.error {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; font-size: 12.5px;
  background: rgba(236, 48, 19, 0.1); border: 1px solid rgba(236, 48, 19, 0.35);
  color: var(--accent);
}
.login-foot { margin: 0; font-size: 11px; color: var(--faint); text-align: center; }

/* ── app shell ─────────────────────────────────────────────── */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.sidebar {
  display: flex; align-items: center; gap: 16px;
  padding: max(20px, env(safe-area-inset-top)) 20px 16px;
  border-bottom: 1px solid var(--hairline);
}
.sidebar .side-section, .sidebar .side-spacer { display: none; }
.sidebar .btn-quiet { margin-left: auto; padding: 0; }
.content {
  flex: 1; display: flex; flex-direction: column; gap: 26px;
  padding: 24px 20px max(28px, env(safe-area-inset-bottom));
}
.app-head { display: flex; flex-direction: column; gap: 18px; }
.app-head h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }
.sub { margin: 5px 0 0; font-size: 13px; color: var(--muted); }
.actions { display: flex; gap: 10px; }
.actions button { flex: 1; }

.kicker {
  font-size: 10px; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 12px;
}
.empty { margin: 0; font-size: 13px; color: var(--muted); }

/* ── upload feedback ───────────────────────────────────────── */
.status {
  padding: 13px 15px; border-radius: 14px; font-size: 12.5px; line-height: 1.45;
  background: var(--raised); border: 1px solid var(--hairline);
  word-break: break-word;
}
.status.is-error {
  background: rgba(236, 48, 19, 0.1);
  border-color: rgba(236, 48, 19, 0.35); color: var(--accent);
}
.status.is-done { border-color: rgba(236, 48, 19, 0.35); }
.progress {
  height: 6px; border-radius: 99px; overflow: hidden;
  background: rgba(243, 242, 242, 0.08);
}
.progress-bar {
  height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, #ec3013, #ff563c);
  transition: width 0.2s ease;
}

/* ── captures ──────────────────────────────────────────────── */
.captures { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.capture {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border-radius: 16px; background: var(--raised); border: 1px solid var(--hairline);
}
.capture-kind {
  width: 28px; height: 28px; flex: none; border-radius: 9px; display: grid;
  place-items: center; background: rgba(236, 48, 19, 0.12);
  color: var(--accent); font-size: 9px; font-weight: 700;
}
.capture-title { font-size: 12.5px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.capture-meta { font-size: 10.5px; color: var(--faint); margin-top: 3px; }

/* ── quick note ────────────────────────────────────────────── */
.note-head { display: flex; align-items: center; gap: 12px; }
.note-title {
  margin: 0; flex: 1; font-size: 15px; font-weight: 700; letter-spacing: 0.06em;
}
.note-box {
  display: flex; flex-direction: column; gap: 14px;
  border-radius: 20px; padding: 18px;
  background: rgba(243, 242, 242, 0.05);
  border: 1px solid rgba(236, 48, 19, 0.35);
  box-shadow: 0 0 32px rgba(236, 48, 19, 0.12);
}
.note-text {
  width: 100%; resize: vertical; min-height: 140px;
  background: none; border: none; outline: none; padding: 0;
  color: var(--text); font: 400 16px/1.5 var(--font);
  caret-color: var(--accent);
}
.note-text::placeholder { color: var(--faint); }
.note-foot {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--muted);
}
.note-foot svg { flex: none; }

/* ── wide screens: the iPad layout ─────────────────────────── */
@media (min-width: 900px) {
  .app { flex-direction: row; align-items: stretch; }
  .sidebar {
    width: 264px; flex: none; flex-direction: column; align-items: stretch; gap: 24px;
    padding: 26px 20px; border-bottom: none; border-right: 1px solid var(--hairline);
  }
  .sidebar .side-section { display: block; }
  .sidebar .side-spacer { display: block; flex: 1; }
  .sidebar .btn-quiet { margin-left: 0; padding: 10px 0; }
  .content { padding: 30px 32px; gap: 28px; max-width: 1100px; }
  .app-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .app-head h1 { font-size: 32px; }
  .actions { flex: none; }
  .actions button { flex: none; }
  .note-title { font-size: 17px; }
}
