:root {
  --bg: #d1c5a8;
  --bg-soft: #e7deca;
  --panel: #2d1f1a;
  --panel-2: #3a2923;
  --button: #5a433a;
  --button-hover: #6a5147;
  --line: #cdbf9f;
  --card: #f4eddc;
  --card-2: #efe5cf;
  --ink: #2a201a;
  --muted: #6f6255;
  --gold: #d6b068;
  --gold-soft: #f3e7c8;
  --blue: #4b8bb0;
  --white: #fffdf7;
  --success: #2f6c4d;
  --danger: #8d4235;
  --shadow: 0 16px 38px rgba(45, 31, 26, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #d6cab0 0%, #cec2a5 100%);
  font-family: Inter, system-ui, sans-serif;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.eyebrow {
  margin: 0 0 .65rem;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }
.form-message { min-height: 1.25rem; margin: .25rem 0 0; font-size: .92rem; color: var(--danger); }

.primary-button,
.secondary-button,
.text-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .75rem 1rem;
  border-radius: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: .18s ease;
}
.primary-button {
  border: 1px solid rgba(255,255,255,.08);
  color: var(--white);
  background: linear-gradient(180deg, #6c4b3a, #513931);
  box-shadow: 0 10px 22px rgba(61, 42, 32, .18);
}
.primary-button:hover,
.secondary-button:hover,
.nav-button:hover,
.nav-direct:hover,
.logout-button:hover,
.mobile-menu-button:hover {
  transform: translateY(-1px);
}
.secondary-button {
  color: var(--panel);
  background: rgba(255,255,255,.75);
  border: 1px solid var(--line);
}
.inline-button { width: auto; }
.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  padding: .3rem 0;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #c7b898;
  border-radius: 12px;
  background: #fffdf8;
  color: var(--ink);
  padding: .82rem .88rem;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(75, 139, 176, .14);
}
.auth-form label,
.asset-form label {
  display: grid;
  gap: .45rem;
  font-size: .9rem;
  font-weight: 700;
  color: #4b3c33;
}
.check-row {
  display: grid !important;
  grid-template-columns: auto 1fr;
  gap: .7rem !important;
  align-items: start;
}
.check-row input {
  width: 18px;
  height: 18px;
  margin-top: .15rem;
}

/* Auth page */
.auth-page {
  min-height: 100vh;
  padding: 1.75rem 0;
}
.auth-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 1.3rem;
  align-items: stretch;
}
.brand-panel,
.auth-card {
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.brand-panel {
  position: relative;
  padding: 2.1rem;
  min-height: 760px;
  background:
    radial-gradient(circle at 80% 14%, rgba(214,176,104,.15), transparent 24%),
    linear-gradient(180deg, #35251f 0%, #241814 100%);
  color: #f9f0dd;
  overflow: hidden;
}
.brand-panel::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 22px;
  border: 1px solid rgba(243, 231, 200, .12);
  pointer-events: none;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: #f6e8c8;
  text-decoration: none;
  font-weight: 800;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  padding: .7rem .95rem;
  border-radius: 14px;
}
.brand-logo {
  width: min(520px, 100%);
  margin: 2rem auto 1.6rem;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,.18));
}
.brand-copy { max-width: 630px; }
.brand-copy h1 {
  margin: 0 0 .9rem;
  font: 700 clamp(2.25rem, 5vw, 4.45rem)/1.02 "Space Grotesk", sans-serif;
  letter-spacing: -.05em;
  color: #fff8ea;
}
.brand-copy p:last-child {
  color: #e0d0b2;
  font-size: 1.04rem;
  line-height: 1.75;
}
.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1.4rem;
}
.feature-row span,
.tag-row span,
.role-strip span {
  border-radius: 999px;
  border: 1px solid rgba(243,231,200,.18);
  background: rgba(255,255,255,.06);
  color: #f8edd5;
  padding: .48rem .8rem;
  font-size: .82rem;
  font-weight: 800;
}
.auth-card {
  align-self: center;
  padding: 1.6rem;
  background: linear-gradient(180deg, #f7efdf 0%, #efe3c8 100%);
  border: 1px solid rgba(86, 60, 45, .14);
}
.prototype-note {
  border-left: 4px solid var(--gold);
  background: #fbf3de;
  padding: .85rem 1rem;
  border-radius: 11px;
  color: #71531e;
  font-size: .88rem;
  line-height: 1.5;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
  margin: 1.35rem 0 1.2rem;
  padding: .35rem;
  border-radius: 15px;
  background: rgba(45,31,26,.08);
}
.tab-button {
  border: 0;
  border-radius: 12px;
  padding: .82rem;
  background: transparent;
  color: var(--panel);
  font-weight: 800;
}
.tab-button.active {
  background: var(--white);
  box-shadow: 0 6px 15px rgba(0,0,0,.08);
}
.tab-panel h2 {
  margin: 0 0 .25rem;
  font: 700 1.8rem/1.08 "Space Grotesk", sans-serif;
}
.auth-form {
  display: grid;
  gap: .95rem;
  margin-top: 1.25rem;
}
.auth-form .primary-button,
.asset-form .primary-button { width: 100%; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: .9rem 0 .6rem;
  background: linear-gradient(180deg, rgba(209,197,168,.98), rgba(209,197,168,.84));
  backdrop-filter: blur(10px);
}
.header-inner {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  border-radius: 22px;
  background: linear-gradient(180deg, #2f211c 0%, #241814 100%);
  box-shadow: var(--shadow);
}
.mini-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 220px;
  text-decoration: none;
  color: #fff7e5;
}
.mini-brand img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 14px;
  background: #fff7ea;
  padding: .2rem;
}
.mini-brand span { display: grid; }
.mini-brand strong {
  font: 700 1.02rem/1.1 "Space Grotesk", sans-serif;
}
.mini-brand small {
  color: #dec69d;
  font-size: .72rem;
  margin-top: .1rem;
}
.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .3rem;
}
.nav-group { position: relative; }
.nav-button,
.nav-direct {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  background: rgba(120, 92, 79, .42);
  color: #f6ead0;
  padding: .72rem .82rem;
  font-size: .86rem;
  font-weight: 800;
  text-decoration: none;
}
.nav-button:hover,
.nav-button:focus-visible,
.nav-direct:hover { background: rgba(160, 126, 108, .5); color: #fff8eb; }
.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + .45rem);
  left: 0;
  min-width: 238px;
  padding: .5rem;
  border: 1px solid #d8c29a;
  border-radius: 16px;
  background: #f6efde;
  color: var(--ink);
  box-shadow: 0 18px 38px rgba(0,0,0,.22);
}
.dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -.7rem;
  height: .7rem;
}
.dropdown a {
  display: block;
  border-radius: 10px;
  padding: .72rem .78rem;
  text-decoration: none;
  font-size: .86rem;
  font-weight: 700;
}
.dropdown a:hover {
  background: rgba(90, 67, 58, .08);
  color: var(--panel);
}
.wide-dropdown {
  min-width: 470px;
  grid-template-columns: repeat(2, 1fr);
}
.align-right { left: auto; right: 0; }
.nav-group:hover > .dropdown,
.nav-group:focus-within > .dropdown,
.nav-group.open > .dropdown { display: grid; }
.member-tools {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.member-chip {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: .5rem .8rem;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #f6ead0;
  font-size: .8rem;
  font-weight: 800;
}
.logout-button,
.mobile-menu-button {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: #fff9ef;
  padding: .62rem .82rem;
  font-size: .8rem;
  font-weight: 800;
}
.mobile-menu-button {
  display: none;
  margin-left: auto;
}

/* Workspace */
.workspace-page { min-height: 100vh; }
.workspace-hero,
.content-section.surface,
.content-section.plain-card,
.site-footer {
  box-shadow: var(--shadow);
}
.workspace-hero {
  width: min(1280px, calc(100% - 2rem));
  margin: 1.25rem auto 0;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 2rem;
  align-items: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  min-height: 420px;
  border-radius: 24px;
  background: linear-gradient(180deg, #30211c 0%, #231814 100%);
  color: #fff6e7;
  overflow: hidden;
}
.hero-copy h1 {
  margin: 0 0 1rem;
  max-width: 720px;
  font: 700 clamp(2.35rem, 5vw, 4.8rem)/.96 "Space Grotesk", sans-serif;
  letter-spacing: -.05em;
}
.hero-copy > p:not(.eyebrow) {
  max-width: 680px;
  color: #e0d2b6;
  font-size: 1.05rem;
  line-height: 1.72;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.45rem;
}
.hero-actions .secondary-button {
  color: #fff7e8;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
}
.hero-logo {
  width: 100%;
  max-width: 500px;
  margin-left: auto;
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  padding: .5rem;
}

.content-section {
  width: min(1280px, calc(100% - 2rem));
  margin: 2rem auto;
  scroll-margin-top: 110px;
}
.content-section.surface,
.content-section.plain-card {
  padding: clamp(1.35rem, 3vw, 2.2rem);
  border-radius: 22px;
  border: 1px solid rgba(79, 60, 47, .11);
  background: linear-gradient(180deg, #f4eddc 0%, #efe4cd 100%);
}
.content-section.compact {
  max-width: 1080px;
}
.section-heading {
  max-width: 860px;
  margin-bottom: 1.4rem;
}
.section-heading h2 {
  margin: 0 0 .55rem;
  font: 700 clamp(1.9rem, 4vw, 3.1rem)/1.04 "Space Grotesk", sans-serif;
  letter-spacing: -.035em;
  color: var(--panel);
}
.section-heading > p:not(.eyebrow) { color: var(--muted); line-height: 1.68; }
.split-heading {
  max-width: none;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.phase-grid,
.card-grid.three,
.lab-grid,
.checklist-grid {
  display: grid;
  gap: 1rem;
}
.phase-grid { grid-template-columns: repeat(4, 1fr); }
.card-grid.three,
.lab-grid { grid-template-columns: repeat(3, 1fr); }
.checklist-grid { grid-template-columns: repeat(2, 1fr); }

.phase-card,
.project-card,
.lab-card,
.asset-item,
.task-list article,
.empty-state {
  border-radius: 18px;
  border: 1px solid rgba(92, 66, 52, .1);
  background: #fffaf1;
  box-shadow: 0 8px 22px rgba(60, 37, 20, .05);
}
.phase-card {
  position: relative;
  min-height: 255px;
  padding: 1.35rem;
}
.phase-card > span {
  color: #d8bd8d;
  font: 700 2.35rem/1 "Space Grotesk", sans-serif;
}
.phase-card h3 { margin: 1.8rem 0 .6rem; font-size: 1.22rem; }
.phase-card p { color: var(--muted); line-height: 1.56; }
.phase-card a {
  position: absolute;
  bottom: 1.25rem;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}
.project-card { padding: 1.25rem; }
.project-card h3 { margin: .95rem 0 .45rem; font-size: 1.14rem; }
.project-card p { margin: 0 0 1rem; color: var(--muted); line-height: 1.6; }
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .32rem .62rem;
  font-size: .74rem;
  font-weight: 800;
}
.status.idea { background: #efe0bd; color: #7a5a1e; }
.status.review { background: #e1edf6; color: #325f7b; }
.tag-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-row span {
  color: var(--panel);
  background: #f4ead4;
  border: 1px solid #eadabc;
}
.lab-card {
  display: block;
  padding: 1.25rem;
  text-decoration: none;
  transition: .18s ease;
}
.lab-card:hover { transform: translateY(-2px); }
.lab-icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #f2e5c7;
  font-size: 1.28rem;
}
.lab-card h3 { margin: .95rem 0 .45rem; font-size: 1.16rem; }
.lab-card p { margin: 0 0 1rem; color: var(--muted); line-height: 1.58; }
.lab-card b { color: var(--blue); }
.role-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.role-strip span {
  color: var(--panel);
  background: #fffaf1;
  border: 1px solid #e4d6ba;
}
.task-list {
  display: grid;
  gap: 1rem;
}
.task-list article {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.15rem;
}
.task-list h3 { margin: 0 0 .35rem; font-size: 1.06rem; }
.task-list p { margin: 0; color: var(--muted); line-height: 1.56; }
.priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: .42rem .62rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 800;
}
.priority.high { background: #f9ddd6; color: #8d4235; }
.priority.medium { background: #f2e8c9; color: #7b6122; }
.task-list button {
  border: 1px solid #d6c4a0;
  border-radius: 12px;
  background: #fbf5e6;
  color: var(--panel);
  padding: .68rem .85rem;
  font-weight: 800;
}

.asset-layout {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 1.2rem;
}
.asset-form {
  display: grid;
  gap: .9rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(92, 66, 52, .08);
}
.asset-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: .75rem;
}
.asset-toolbar h3 {
  margin: 0;
  font: 700 1.25rem/1.1 "Space Grotesk", sans-serif;
}
.asset-list { display: grid; gap: .85rem; }
.asset-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1.05rem;
}
.asset-item h4 { margin: 0 0 .3rem; font-size: 1.04rem; }
.asset-item small { display: block; color: var(--blue); font-weight: 700; margin-bottom: .5rem; }
.asset-item p { margin: 0; color: var(--muted); line-height: 1.55; }
.asset-item a {
  white-space: nowrap;
  font-weight: 800;
  color: var(--blue);
  text-decoration: none;
}
.empty-state {
  padding: 1rem 1.1rem;
  color: var(--muted);
}
.checklist-grid label {
  display: flex;
  gap: .7rem;
  align-items: start;
  padding: .9rem 1rem;
  border-radius: 16px;
  background: #fffaf1;
  border: 1px solid rgba(92, 66, 52, .08);
  font-weight: 600;
}
.checklist-grid input { width: 18px; height: 18px; margin-top: .15rem; }

.site-footer {
  width: min(1280px, calc(100% - 2rem));
  margin: 2rem auto 2.6rem;
  padding: 1rem 1.2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  border-radius: 22px;
  background: linear-gradient(180deg, #2f211c 0%, #241814 100%);
  color: #f7ebd0;
}
.site-footer img {
  width: 66px;
  height: 66px;
  object-fit: cover;
  border-radius: 14px;
  background: #fff8eb;
  padding: .18rem;
}
.site-footer p { margin: 0; color: #e0d0b2; }
.site-footer a {
  color: #fff7e5;
  text-decoration: none;
  font-weight: 800;
}

/* Mobile nav */
@media (max-width: 1080px) {
  .auth-shell,
  .workspace-hero,
  .asset-layout { grid-template-columns: 1fr; }
  .brand-panel { min-height: auto; }
  .workspace-hero { gap: 1.5rem; }
  .hero-logo { max-width: 420px; margin: 0 auto; }
  .phase-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid.three,
  .lab-grid { grid-template-columns: repeat(2, 1fr); }
  .main-nav {
    display: none;
    position: absolute;
    top: calc(100% + .6rem);
    left: 0;
    right: 0;
    margin: 0 auto;
    width: min(1280px, calc(100% - 2rem));
    padding: .85rem;
    border-radius: 18px;
    background: #f3ebd8;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    gap: .6rem;
  }
  .main-nav.open { display: flex; }
  .nav-group,
  .nav-direct { width: 100%; }
  .nav-button,
  .nav-direct {
    width: 100%;
    justify-content: space-between;
    border-color: rgba(79,60,47,.08);
    background: rgba(79,60,47,.05);
    color: var(--panel);
  }
  .dropdown,
  .wide-dropdown,
  .align-right {
    position: static;
    display: none;
    min-width: 0;
    padding: .3rem 0 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .dropdown::before { display: none; }
  .nav-group.open > .dropdown { display: grid; }
  .dropdown a {
    padding: .68rem .8rem;
    background: rgba(255,255,255,.55);
    margin-top: .35rem;
  }
  .mobile-menu-button { display: inline-flex; }
}

@media (max-width: 720px) {
  .auth-page { padding: .7rem 0; }
  .auth-shell { width: calc(100% - 1rem); }
  .brand-panel,
  .auth-card,
  .workspace-hero,
  .content-section.surface,
  .site-footer,
  .header-inner { border-radius: 18px; }
  .brand-panel { padding: 1.25rem; }
  .auth-card { padding: 1.1rem; }
  .brand-copy h1 { font-size: 2.75rem; }
  .header-inner {
    width: calc(100% - 1rem);
    min-height: 72px;
    padding: .75rem;
  }
  .mini-brand { min-width: 0; }
  .mini-brand span { display: none; }
  .member-chip { display: none; }
  .workspace-hero,
  .content-section,
  .site-footer { width: calc(100% - 1rem); }
  .workspace-hero { margin-top: .4rem; padding: 1.35rem; }
  .hero-copy h1 { font-size: 2.9rem; }
  .content-section { margin: 1rem auto 1.35rem; }
  .phase-grid,
  .card-grid.three,
  .lab-grid,
  .checklist-grid,
  .asset-layout { grid-template-columns: 1fr; }
  .split-heading { flex-direction: column; align-items: start; }
  .task-list article {
    grid-template-columns: auto 1fr;
  }
  .task-list button {
    grid-column: 2;
    justify-self: start;
  }
  .asset-item {
    grid-template-columns: 1fr;
  }
  .site-footer {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}
