:root {
  color-scheme: dark;
  --bg: #080a0d;
  --panel: #101319;
  --panel-2: #151920;
  --text: #f4f6f8;
  --muted: #8c949f;
  --line: rgba(255, 255, 255, 0.09);
  --hot: #ff6b35;
  --hot-2: #ff9a3d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 78% 5%, rgba(255, 107, 53, 0.12), transparent 30rem),
    radial-gradient(circle at 10% 80%, rgba(92, 108, 255, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
}

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  z-index: 20;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 460px);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(22, 26, 33, 0.96), rgba(11, 13, 17, 0.96));
  box-shadow: var(--shadow);
}

.mark, .brand-mark {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--hot), var(--hot-2));
  color: #111;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(255, 107, 53, 0.22);
}

.mark {
  width: 54px;
  height: 54px;
  margin-bottom: 34px;
  border-radius: 17px;
  font-size: 1.5rem;
  transform: rotate(-5deg);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--hot-2);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.login-card h1, .headline h1 {
  margin: 0;
  letter-spacing: -0.045em;
  line-height: 1;
}

.login-card h1 { font-size: clamp(2.8rem, 9vw, 4.6rem); }

.login-copy {
  margin: 16px 0 34px;
  color: var(--muted);
  font-size: 1rem;
}

label {
  display: block;
  margin-bottom: 9px;
  color: #c8cdd4;
  font-size: 0.875rem;
  font-weight: 650;
}

.login-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  background: #090b0e;
  color: var(--text);
}

input:focus { border-color: var(--hot); box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.14); }

button {
  border: 0;
  border-radius: 13px;
  cursor: pointer;
}

.login-row button {
  padding: 0 20px;
  background: var(--text);
  color: #090a0c;
  font-weight: 800;
}

.error {
  margin: 14px 0 0;
  color: #ff8a7a;
  font-size: 0.9rem;
}

.portal { min-height: 100vh; }

.topbar {
  height: 82px;
  padding: 0 clamp(22px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 13, 0.78);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.brand strong, .brand small { display: block; }

.brand strong { font-size: 0.92rem; letter-spacing: 0.12em; }

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.top-actions { display: flex; align-items: center; gap: 18px; }

.system-state {
  color: #b9c0c9;
  font-size: 0.82rem;
}

.system-state i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #4ee096;
  box-shadow: 0 0 12px rgba(78, 224, 150, 0.7);
}

.ghost-button {
  padding: 9px 13px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.workspace {
  width: min(1240px, calc(100% - 44px));
  margin: 0 auto;
  padding: clamp(54px, 8vw, 108px) 0 72px;
}

.headline {
  min-height: 230px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 52px;
}

.headline h1 {
  max-width: 720px;
  font-size: clamp(2.8rem, 7vw, 6.3rem);
}

.head-symbol {
  width: clamp(116px, 16vw, 210px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
  background:
    linear-gradient(145deg, rgba(255, 107, 53, 0.18), transparent 55%),
    var(--panel);
  transform: rotate(6deg);
  box-shadow: inset 0 0 40px rgba(255,255,255,0.025);
}

.head-symbol span {
  color: var(--hot-2);
  font-size: clamp(1.3rem, 3vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  transform: rotate(-6deg);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.section-head span { color: var(--muted); font-size: 0.84rem; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.project-card {
  min-height: 238px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(23, 27, 34, 0.94), rgba(13, 16, 21, 0.94));
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  position: relative;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-card.enabled:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: linear-gradient(150deg, rgba(29, 34, 42, 0.98), rgba(14, 17, 22, 0.98));
}

.project-card::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  right: -54px;
  bottom: -60px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.08;
  filter: blur(2px);
}

.project-card.disabled { cursor: default; opacity: 0.72; }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; }

.project-icon {
  font-size: 1.65rem;
  line-height: 1;
}

.badge {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,0.025);
  font-size: 0.72rem;
  font-weight: 700;
}

.project-card.enabled .badge { color: var(--accent); }

.project-card h3 {
  margin: auto 0 9px;
  font-size: 1.42rem;
  letter-spacing: -0.02em;
}

.project-card p {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.open-label {
  margin-top: 18px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.panel-error {
  padding: 14px;
  border: 1px solid rgba(255, 100, 80, 0.28);
  border-radius: 12px;
  background: rgba(255, 100, 80, 0.08);
}

footer {
  width: min(1240px, calc(100% - 44px));
  margin: 0 auto;
  padding: 24px 0 42px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 860px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .head-symbol { display: none; }
}

@media (max-width: 580px) {
  .topbar { height: 72px; padding: 0 18px; }
  .system-state { display: none; }
  .workspace { width: min(100% - 28px, 1240px); padding-top: 50px; }
  .headline { min-height: 170px; padding-bottom: 38px; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card { min-height: 204px; }
  .login-card { padding: 30px 24px; }
  .login-row { grid-template-columns: 1fr; }
  .login-row button { min-height: 48px; }
  footer { width: min(100% - 28px, 1240px); flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .project-card { transition: none; }
}


/* StoneHead command center */
button, input, textarea { font: inherit; }

.headline {
  min-height: 150px;
  padding-bottom: 34px;
}

.headline h1 {
  max-width: 900px;
  font-size: clamp(2.5rem, 6vw, 5.4rem);
}

.command-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
  gap: clamp(28px, 5vw, 72px);
  margin-bottom: 58px;
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid rgba(255, 122, 69, 0.3);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 107, 53, 0.1), transparent 42%),
    rgba(16, 19, 25, 0.92);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.command-copy h2,
.tasks-section h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  letter-spacing: -0.035em;
}

.command-copy > p:last-child {
  max-width: 360px;
  margin: 15px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

#command-form label {
  margin-bottom: 10px;
}

#command-input {
  width: 100%;
  min-height: 126px;
  resize: vertical;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  background: #090b0e;
  color: var(--text);
  line-height: 1.55;
}

#command-input:focus {
  border-color: var(--hot);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.14);
}

.command-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
}

.privacy-options {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.privacy-options legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.privacy-options label {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.privacy-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.privacy-options span {
  display: inline-flex;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.84rem;
}

.privacy-options input:checked + span {
  border-color: rgba(255, 122, 69, 0.55);
  background: rgba(255, 107, 53, 0.13);
  color: var(--text);
}

.primary-button {
  min-height: 44px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--hot), var(--hot-2));
  color: #111;
  font-weight: 850;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.command-hint {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.tasks-section {
  margin-bottom: 64px;
}

.tasks-section .section-head {
  align-items: flex-end;
}

.tasks-section .section-head .eyebrow {
  margin-bottom: 8px;
}

.task-list {
  display: grid;
  gap: 11px;
}

.task-card,
.task-empty {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(16, 19, 25, 0.78);
}

.task-card {
  padding: 18px 20px;
  border-left: 3px solid var(--hot);
}

.task-card.status-done { border-left-color: #4ee096; }
.task-card.status-failed { border-left-color: #ff6f61; }
.task-card.status-running { border-left-color: #6ea8fe; }
.task-card.status-review { border-left-color: #f7c760; }

.task-head,
.task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.task-project,
.task-status {
  font-size: 0.78rem;
  font-weight: 800;
}

.task-project {
  color: var(--hot-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.task-status {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #cdd2d9;
}

.task-card h3 {
  margin: 13px 0 8px;
  font-size: 1rem;
  line-height: 1.45;
}

.task-route {
  margin: 0;
  color: #aeb5be;
  font-size: 0.86rem;
}

.task-meta {
  justify-content: flex-start;
  margin-top: 13px;
  color: #777f8a;
  font-size: 0.77rem;
}

.task-empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .command-panel {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .command-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  .tasks-section .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }
}
