:root {
  color: #171717;
  background: #f6f5f2;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --ink: #171717;
  --muted: #6f6c66;
  --line: #dedbd4;
  --panel: #ffffff;
  --accent: #dd5b3d;
  --accent-hover: #c94d31;
  --soft: #efede8;
  --focus: #8b341f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% -10%, rgba(221, 91, 61, 0.11), transparent 34rem),
    var(--soft);
}

button,
input {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid rgba(222, 219, 212, 0.88);
  background: rgba(246, 245, 242, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark,
.preview-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: white;
  background: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.primary-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
}

.nav-button {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.nav-button.is-active {
  color: white;
  background: var(--ink);
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.account-label {
  max-width: 260px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding-bottom: 80px;
}

.hero {
  padding: clamp(72px, 11vw, 138px) 0 clamp(62px, 9vw, 108px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0 auto;
  font-size: clamp(42px, 7vw, 82px);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero-copy {
  max-width: 630px;
  margin: 28px auto 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
}

.content-section {
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 70px rgba(45, 40, 32, 0.06);
}

.content-section.is-hidden {
  display: none;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.035em;
}

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

.space-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.space-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(40, 34, 28, 0.09);
}

.space-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(221, 91, 61, 0.16), rgba(255, 255, 255, 0.38)),
    repeating-linear-gradient(90deg, #f3f0ea 0, #f3f0ea 20px, #ece8e0 20px, #ece8e0 21px);
}

.space-preview .preview-mark {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  font-size: 20px;
  box-shadow: 0 12px 24px rgba(133, 50, 30, 0.18);
}

.space-card-body {
  padding: 20px;
}

.space-meta {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.space-title {
  margin: 8px 0;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.space-description {
  min-height: 66px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.space-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.button-primary {
  color: white;
  background: var(--accent);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

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

.button-secondary:hover:not(:disabled) {
  background: var(--soft);
}

.button-block {
  width: 100%;
}

.status-message {
  min-height: 22px;
  margin: -12px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 56px 24px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.modal {
  width: min(460px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  box-shadow: 0 30px 100px rgba(20, 18, 15, 0.28);
}

.modal::backdrop {
  background: rgba(30, 27, 23, 0.48);
  backdrop-filter: blur(5px);
}

.modal-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.modal-heading h2 {
  font-size: 30px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: var(--soft);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.45;
}

.modal-copy {
  margin: 14px 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 650;
}

.field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

.field input:focus {
  border-color: #a5a099;
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.08);
}

.domain-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.domain-field:focus-within {
  border-color: #a5a099;
  box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.08);
}

.domain-field input {
  min-width: 0;
  border: 0;
  box-shadow: none;
}

.domain-field input:focus {
  box-shadow: none;
}

.domain-field span {
  padding-right: 12px;
  color: var(--muted);
  font-weight: 500;
}

.optional,
.field-help {
  color: var(--muted);
  font-weight: 450;
}

.field-help {
  margin: 7px 0 0;
  font-size: 12px;
}

.form-error {
  min-height: 20px;
  margin: 14px 0 8px;
  color: #a22f23;
  font-size: 13px;
}

.text-button {
  display: block;
  margin: 16px auto 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (max-width: 840px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
  }

  .space-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .site-header {
    gap: 12px;
    padding: 11px 14px;
  }

  .brand span:last-child,
  .account-label {
    display: none;
  }

  .account-actions .button {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 13px;
  }

  main {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    padding-top: 62px;
  }

  .content-section {
    padding: 20px;
    border-radius: 18px;
  }

  .section-heading {
    align-items: flex-start;
  }

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

  .space-description {
    min-height: 0;
  }
}
