:root {
  color-scheme: light;
  --ink: #102d3b;
  --ink-soft: #315462;
  --paper: #f7f0e4;
  --paper-light: #fffaf1;
  --coral: #dc6f4a;
  --coral-dark: #b84e31;
  --sea: #2d6e7d;
  --line: rgba(16, 45, 59, 0.16);
  --shadow: 0 18px 45px rgba(16, 45, 59, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.9), transparent 30rem),
    repeating-linear-gradient(96deg, rgba(16, 45, 59, 0.018) 0 1px, transparent 1px 8px),
    var(--paper);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

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

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2.7rem, 6vw, 5.8rem);
}

h2 {
  margin-bottom: 0.7rem;
  font-size: clamp(1.55rem, 2.5vw, 2.25rem);
}

.eyebrow {
  margin-bottom: 0.65rem;
  color: var(--coral-dark);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.muted,
.fine-print {
  color: var(--ink-soft);
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 240, 228, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  transform: rotate(-4deg);
  border-radius: 0.25rem;
  color: white;
  background: var(--coral);
  font-family: Georgia, serif;
  font-size: 1.3rem;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.topbar nav a,
.link-button {
  border: 0;
  color: var(--ink);
  background: none;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.topbar nav a:hover,
.link-button:hover {
  color: var(--coral-dark);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(20rem, 0.92fr) minmax(25rem, 1.08fr);
}

.login-panel {
  display: flex;
  max-width: 46rem;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 8vw, 8rem);
}

.login-panel h1 {
  max-width: 10ch;
}

.login-panel .lede {
  max-width: 32rem;
  margin-bottom: 2rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.login-art {
  position: relative;
  display: grid;
  min-height: 100%;
  place-items: center;
  overflow: hidden;
  color: white;
  background: linear-gradient(140deg, rgba(17, 47, 60, 0.2), rgba(17, 47, 60, 0.92)),
    repeating-linear-gradient(105deg, #173e4c 0 24px, #194553 24px 48px);
}

.login-art::before {
  position: absolute;
  width: 64%;
  aspect-ratio: 1;
  transform: rotate(8deg);
  border: 2px solid rgba(255, 255, 255, 0.2);
  content: '';
}

.login-art p {
  position: relative;
  max-width: 12ch;
  font-family: Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 5.6rem);
  line-height: 0.95;
}

.login-art strong {
  color: var(--coral);
}

.signal {
  position: absolute;
  height: 0.85rem;
  background: var(--coral);
}

.signal-one {
  top: 17%;
  right: 9%;
  width: 40%;
  transform: rotate(-4deg);
}

.signal-two {
  bottom: 12%;
  left: 7%;
  width: 27%;
  transform: rotate(3deg);
  background: #e5c691;
}

.stacked-form {
  display: grid;
  gap: 1rem;
}

.stacked-form label,
.instruction-form label,
.inline-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 800;
}

label small {
  color: var(--ink-soft);
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(16, 45, 59, 0.2);
  border-radius: 0.5rem;
  outline: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

input,
select {
  min-height: 3rem;
  padding: 0 0.9rem;
}

textarea {
  min-height: 6.5rem;
  padding: 0.8rem 0.9rem;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--sea);
  box-shadow: 0 0 0 3px rgba(45, 110, 125, 0.16);
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  color: white;
  background: var(--coral);
  box-shadow: 0 9px 20px rgba(184, 78, 49, 0.2);
}

.button.primary:hover {
  background: var(--coral-dark);
}

.button.secondary {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}

.button.secondary:hover {
  color: white;
  background: var(--ink);
}

.button.full {
  width: 100%;
}

.fine-print {
  margin: 1.25rem 0 0;
  font-size: 0.78rem;
}

.form-error,
.notice {
  padding: 0.9rem 1rem;
  border-radius: 0.4rem;
  font-weight: 700;
}

.form-error {
  color: #802f25;
  background: #f7dcd3;
}

.notice {
  margin-bottom: 1.5rem;
  color: #174e3a;
  background: #dcecdf;
}

.crew-page {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  padding: clamp(1.25rem, 4vw, 3.5rem);
  text-align: center;
}

.crew-copy {
  max-width: 58rem;
}

.crew-copy h1 {
  margin-bottom: 0.4rem;
  font-size: clamp(2.3rem, 4.5vw, 4.6rem);
}

.crew-copy p:last-child {
  color: var(--ink-soft);
}

.crew-collage {
  display: block;
  width: min(100%, 110rem);
  max-height: calc(100vh - 15rem);
  margin: 1rem auto;
  object-fit: contain;
  filter: drop-shadow(0 22px 30px rgba(16, 45, 59, 0.14));
}

.crew-button {
  min-width: min(22rem, 80vw);
  font-size: 1.05rem;
}

.page-shell {
  width: min(94rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 5rem) 0 6rem;
}

.page-heading,
.project-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.page-heading h1,
.project-hero h1 {
  margin-bottom: 0.4rem;
}

.page-heading p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.counter {
  padding-bottom: 0.65rem;
  border-bottom: 0.7rem solid var(--coral);
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
  gap: clamp(1.5rem, 4vw, 4rem);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.project-card,
.panel,
.create-panel,
.empty-state {
  border: 1px solid rgba(16, 45, 59, 0.11);
  background: rgba(255, 250, 241, 0.9);
  box-shadow: var(--shadow);
}

.project-card {
  position: relative;
  min-height: 15rem;
  padding: 1.4rem;
  overflow: hidden;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.project-card::after {
  position: absolute;
  right: -3rem;
  bottom: -3rem;
  width: 8rem;
  height: 8rem;
  transform: rotate(20deg);
  background: var(--coral);
  content: '';
  opacity: 0.12;
}

.project-card:hover {
  transform: translateY(-3px) rotate(-0.2deg);
  box-shadow: 0 23px 50px rgba(16, 45, 59, 0.18);
}

.project-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-card h2 {
  margin: 2.8rem 0 0.8rem;
}

.project-card p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-soft);
}

.project-card time {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.phase {
  display: inline-flex;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  color: var(--ink);
  background: #ead8ba;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.phase-trial {
  color: #174e3a;
  background: #dcecdf;
}

.phase-live {
  color: white;
  background: var(--sea);
}

.status-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9a9a94;
}

.status-queued {
  background: #d68b35;
  box-shadow: 0 0 0 5px rgba(214, 139, 53, 0.13);
}

.status-building {
  background: var(--sea);
  box-shadow: 0 0 0 5px rgba(45, 110, 125, 0.13);
}

.status-ready {
  background: #319064;
  box-shadow: 0 0 0 5px rgba(49, 144, 100, 0.13);
}

.status-failed {
  background: #b84335;
  box-shadow: 0 0 0 5px rgba(184, 67, 53, 0.13);
}

.create-panel {
  position: sticky;
  top: 6.5rem;
  padding: 1.7rem;
  transform: rotate(0.35deg);
}

.create-panel > p:not(.eyebrow) {
  color: var(--ink-soft);
}

.empty-state {
  min-height: 22rem;
  padding: clamp(2rem, 6vw, 5rem);
  text-align: center;
}

.empty-state > span {
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 4rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--ink-soft);
  font-weight: 800;
  text-decoration: none;
}

.project-hero {
  padding: 1rem 0 2rem;
  border-bottom: 1px solid var(--line);
}

.project-hero h1 {
  font-size: clamp(3.2rem, 7vw, 7.6rem);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--ink-soft);
  font-weight: 700;
}

.preview-action {
  display: flex;
  max-width: 24rem;
  justify-content: end;
  text-align: right;
}

.project-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.6fr) minmax(19rem, 0.8fr);
  gap: 1.5rem;
}

.main-column,
.side-column {
  display: grid;
  gap: 1.5rem;
}

.panel {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.panel-heading > span {
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.conversation {
  display: grid;
  max-height: 34rem;
  gap: 0.85rem;
  margin: 1rem 0 1.4rem;
  padding: 1rem 0;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.message {
  max-width: 82%;
  padding: 0.9rem 1rem;
  border-radius: 0.7rem 0.7rem 0.7rem 0.15rem;
  background: #e5dfd3;
}

.message-user {
  margin-left: auto;
  border-radius: 0.7rem 0.7rem 0.15rem;
  color: white;
  background: var(--ink);
}

.message header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.72rem;
}

.message time {
  opacity: 0.68;
}

.message p {
  margin: 0.45rem 0 0;
  white-space: pre-wrap;
}

.instruction-form {
  display: grid;
  justify-items: end;
  gap: 1rem;
}

.instruction-form label {
  width: 100%;
}

.compact {
  gap: 0.75rem;
}

.compact input,
.compact select {
  min-height: 2.65rem;
}

.compact textarea {
  min-height: 5rem;
}

.simple-list,
.job-list,
.member-list {
  display: grid;
  gap: 0;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.simple-list li,
.job-list li,
.member-list li {
  display: flex;
  min-height: 3.4rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.simple-list li span,
.job-list time,
.member-list > li > span {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.job-list li {
  justify-content: start;
}

.job-list div,
.member-list div {
  display: grid;
  flex: 1;
}

.job-list small,
.member-list small {
  color: var(--ink-soft);
}

.inline-form {
  display: flex;
  align-items: end;
  gap: 1rem;
}

.inline-form label {
  flex: 1;
}

.file-input input {
  padding: 0.55rem;
}

.trial-panel {
  overflow: hidden;
  border-top: 0.7rem solid var(--coral);
}

.member-form {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 900px) {
  .login-shell,
  .dashboard-grid,
  .project-layout {
    grid-template-columns: 1fr;
  }

  .login-panel {
    max-width: none;
    padding: 3rem 1.5rem;
  }

  .login-art {
    display: none;
  }

  .create-panel {
    position: static;
    grid-row: 1;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-hero,
  .page-heading {
    align-items: start;
  }
}

@media (max-width: 600px) {
  .topbar {
    min-height: 4rem;
  }

  .brand > span:last-child,
  .topbar nav > a {
    display: none;
  }

  .crew-page {
    align-content: center;
  }

  .crew-collage {
    width: 130%;
    max-width: none;
  }

  .page-shell {
    width: min(100% - 1.2rem, 94rem);
    padding-top: 2rem;
  }

  .page-heading,
  .project-hero,
  .panel-heading,
  .inline-form {
    display: grid;
  }

  .project-hero h1 {
    font-size: 3.3rem;
  }

  .preview-action {
    justify-content: start;
    text-align: left;
  }

  .message {
    max-width: 94%;
  }

  .instruction-form .button,
  .inline-form .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
