:root {
  --bg: #f4f5f7;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --ink: #101114;
  --muted: #646a73;
  --line: rgba(16, 17, 20, 0.12);
  --blue: #1463ff;
  --blue-dark: #084ac7;
  --green: #0f7b5c;
  --orange: #c96c1f;
  --shadow: 0 28px 90px rgba(26, 31, 44, 0.14);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(231, 236, 244, 0.9)),
    linear-gradient(180deg, #f7f8fb, #e9edf3),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

.email-link {
  color: var(--blue);
  font-weight: 900;
}

.app-shell {
  display: grid;
  grid-template-rows: auto auto auto;
  min-height: 100dvh;
  padding: max(14px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, 100%);
  margin: 0 auto 16px;
}

.brand,
.tab,
.button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 7px 12px 7px 7px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--panel-strong);
  box-shadow: 0 10px 30px rgba(16, 17, 20, 0.08);
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, var(--ink), #3d4659);
}

.view-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  backdrop-filter: blur(24px) saturate(150%);
}

.tab {
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 0.92rem;
  font-weight: 820;
}

.tab.is-active {
  color: #ffffff;
  background: var(--ink);
}

.view-stage {
  position: relative;
  width: min(1180px, 100%);
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  margin: 0 auto;
  overflow-x: hidden;
}

.view {
  position: relative;
  display: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: min(760px, calc(100dvh - 146px));
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px) saturate(160%);
  overflow-x: hidden;
  overflow-y: visible;
}

.view.is-active {
  display: block;
}

.home-layout,
.builder-layout,
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.56fr);
  gap: clamp(18px, 3vw, 34px);
  height: 100%;
  min-height: 0;
  min-width: 0;
  align-items: center;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow,
.card-kicker,
.question-kicker,
.card-label {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 900;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: 4.7rem;
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 3.1rem;
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.28rem;
  line-height: 1.16;
}

.nowrap {
  white-space: nowrap;
}

.hero-copy p:not(.eyebrow),
.view-heading p,
.project-card p,
.process-list span,
.about-layout p,
.contact-card p,
.question-card p {
  color: var(--muted);
  font-size: 1.04rem;
}

.action-row,
.contact-actions,
.intake-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-row {
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 132px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 900;
  transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}

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

.button.primary {
  color: #ffffff;
  background: var(--blue);
}

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

.button.secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.process-card,
.intake-panel,
.contact-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 18px 52px rgba(16, 17, 20, 0.09);
}

.process-card {
  padding: 22px;
  align-self: center;
}

.process-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-list li {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
}

.process-list strong,
.process-list span {
  display: block;
}

.process-list strong {
  margin-bottom: 4px;
}

.view-heading {
  max-width: 820px;
  margin-bottom: 22px;
}

.project-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  overflow: visible;
  padding: 3px 4px;
}

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 188px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.project-card.featured {
  background: linear-gradient(160deg, rgba(20, 99, 255, 0.14), rgba(255, 255, 255, 0.76));
}

.project-card span {
  margin-bottom: auto;
  color: var(--green);
  font-weight: 900;
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  min-height: 38px;
  margin-top: 14px;
  padding: 9px 13px;
  border: 1px solid rgba(20, 99, 255, 0.2);
  border-radius: 999px;
  color: #ffffff;
  background: var(--blue);
  font-size: 0.86rem;
  font-weight: 900;
}

.project-link:hover {
  background: var(--blue-dark);
}

.project-link span {
  margin: 0;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
}

.builder-layout {
  align-items: stretch;
}

.builder-layout.single {
  display: block;
}

.builder-layout.single .intake-panel {
  width: min(720px, 100%);
  min-height: 100%;
  margin: 0 auto;
}

.intake-panel {
  display: grid;
  min-height: 0;
  padding: 22px;
}

.intake-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.intake-top,
.brief-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.step-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--ink);
  font-weight: 900;
}

.progress-track {
  height: 8px;
  margin: 12px 0 18px;
  border-radius: 999px;
  background: rgba(16, 17, 20, 0.1);
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 180ms ease;
}

.question-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.answer-slot {
  display: grid;
  gap: 10px;
  min-height: 0;
  margin-top: 18px;
  overflow-y: auto;
  padding-right: 2px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice,
.chip {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  text-align: left;
  font-weight: 850;
}

.choice {
  min-height: 72px;
  padding: 14px;
}

.chip {
  min-height: 44px;
  padding: 10px 13px;
}

.choice.is-selected,
.chip.is-selected {
  color: #ffffff;
  background: var(--ink);
  border-color: var(--ink);
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font-weight: 850;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  outline: none;
}

.field input {
  min-height: 50px;
  padding: 0 14px;
}

.field textarea {
  min-height: 132px;
  resize: vertical;
  padding: 13px 14px;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(20, 99, 255, 0.56);
  box-shadow: 0 0 0 4px rgba(20, 99, 255, 0.12);
}

.intake-actions {
  justify-content: space-between;
  margin-top: 16px;
}

.about-layout {
  align-items: center;
}

.contact-card {
  padding: 22px;
}

.contact-actions {
  margin-top: 22px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  padding: 12px 16px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.admin-footer {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.admin-footer a {
  color: rgba(16, 17, 20, 0.48);
  font-size: 0.82rem;
  font-weight: 850;
}

.admin-footer a:hover {
  color: var(--ink);
}

.admin-page {
  min-height: 100dvh;
  overflow: auto;
}

.admin-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.admin-card {
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px) saturate(160%);
}

.admin-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 22px;
}

.admin-login input {
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
}

.admin-exit {
  width: fit-content;
  margin-top: 12px;
}

.admin-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.submission-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.submission-card h3 {
  margin-bottom: 6px;
}

.submission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.submission-meta span {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(16, 17, 20, 0.06);
  font-size: 0.82rem;
  font-weight: 850;
}

.submission-card pre {
  margin: 0;
  white-space: pre-wrap;
  font: 0.9rem/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 900px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .view-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .tab {
    flex: 1 0 auto;
  }

  .view-stage {
    min-height: 0;
  }

  .view {
    min-height: 0;
  }

  .home-layout,
  .builder-layout,
  .about-layout {
    grid-template-columns: 1fr;
    height: auto;
    align-items: start;
  }

  h1 {
    max-width: 640px;
    font-size: 3.75rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  .project-strip {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
}

@media (max-width: 520px) {
  .project-strip {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 170px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .view {
    padding: 14px;
    border-radius: 22px;
  }

  h1 {
    font-size: 2.85rem;
    line-height: 0.98;
  }

  h2 {
    font-size: 1.9rem;
  }

  .intake-top {
    align-items: flex-start;
    flex-direction: row;
    gap: 10px;
  }

  .brief-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .intake-panel {
    display: block;
    padding: 16px;
  }

  .answer-slot {
    margin-top: 12px;
    overflow: visible;
  }

  .question-card {
    padding: 14px;
  }

  .button {
    width: 100%;
  }

  .admin-login {
    grid-template-columns: 1fr;
  }

  .intake-actions .button {
    width: calc(50% - 5px);
    min-width: 0;
  }

  .choice {
    min-height: 54px;
    padding: 12px;
  }

  .chip {
    min-height: 42px;
    padding: 9px 11px;
  }
}

@media (max-height: 820px) and (min-width: 901px) {
  .app-shell {
    padding-top: 12px;
    padding-bottom: 14px;
  }

  .topbar {
    margin-bottom: 12px;
  }

  .view {
    min-height: 0;
    padding: 22px 28px;
  }

  h1 {
    font-size: 3.45rem;
    line-height: 0.97;
    margin-bottom: 14px;
  }

  .hero-copy p:not(.eyebrow) {
    max-width: 680px;
    font-size: 0.98rem;
  }

  .action-row {
    margin-top: 18px;
  }

  .process-list {
    gap: 10px;
  }

  .process-list li {
    padding: 13px 14px;
  }
}

@media (max-height: 700px) and (min-width: 901px) {
  h1 {
    font-size: 3.1rem;
  }

  .home-layout {
    align-items: start;
  }

  .process-card {
    align-self: start;
  }
}
