:root {
  --bg: #f3f0e8;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(24, 24, 24, 0.1);
  --line-strong: rgba(24, 24, 24, 0.18);
  --text: #171717;
  --muted: #6f6a62;
  --accent: #181818;
  --accent-soft: #ece7dd;
  --shadow: 0 24px 80px rgba(24, 24, 24, 0.08);
  --radius: 20px;
  --radius-sm: 14px;
  --sans: "SF Pro Display", "Inter", "Segoe UI", sans-serif;
  --mono: "SF Mono", "ui-monospace", monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

body {
  position: relative;
}

button,
input,
textarea {
  font: inherit;
}

button {
  appearance: none;
  -webkit-appearance: none;
}

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

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

.site-noise,
.app-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 36%),
    radial-gradient(circle at bottom right, rgba(222, 214, 199, 0.8), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
}

.site-main {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.site-main-narrow {
  width: min(560px, calc(100% - 32px));
}

.hero-card,
.feature-card,
.panel,
.sidebar,
.topbar {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hero-card {
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card h1 {
  margin: 0 0 14px;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.hero-copy,
.sidebar-copy,
.feature-card p,
.detail-list,
.user-email {
  color: var(--muted);
}

.hero-copy {
  max-width: 680px;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-actions-stack {
  flex-direction: column;
}

.button,
.ghost-button {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  cursor: pointer;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
}

.button-wide {
  width: 100%;
}

.button-small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.94rem;
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #f7f3ec;
}

.button-secondary,
.ghost-button {
  background: rgba(255, 255, 255, 0.5);
}

.ghost-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.86rem;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

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

.feature-card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.eyebrow,
.meta-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-card {
  margin-top: 12vh;
}

.app-frame {
  position: relative;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  width: min(1440px, calc(100% - 24px));
  min-height: calc(100vh - 24px);
  margin: 12px auto;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar-section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.sidebar-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.workspace-title,
.topbar h2,
.panel h3 {
  margin: 0;
  letter-spacing: -0.03em;
}

.workspace-title {
  font-size: 2rem;
}

.section-heading,
.panel-header,
.topbar,
.sidebar-user,
.preview-meta,
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-list {
  display: grid;
  gap: 10px;
}

.project-card {
  width: 100%;
  text-align: left;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
}

.project-card.is-active {
  border-color: var(--text);
  background: var(--panel-strong);
}

.project-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.project-card p,
.project-card span {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.workspace {
  display: grid;
  gap: 16px;
}

.topbar {
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
}

.topbar h2 {
  font-size: 1.6rem;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 16px;
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  min-width: 0;
}

.panel-editor,
.panel-preview {
  min-height: 420px;
}

.panel-grid,
.panel-details {
  min-height: 280px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  font-family: var(--mono);
}

.editor-surface {
  margin-top: 18px;
  min-height: 320px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #fcfbf8;
  overflow: hidden;
}

.editor-grid {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  background-image:
    linear-gradient(to right, rgba(24, 24, 24, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(24, 24, 24, 0.06) 1px, transparent 1px);
  background-size: 12.5% 12.5%;
}

.editor-grid::before,
.editor-grid::after {
  content: "";
  position: absolute;
  background: rgba(24, 24, 24, 0.18);
}

.editor-grid::before {
  left: 12.5%;
  right: 12.5%;
  bottom: 18%;
  height: 1px;
}

.editor-grid::after {
  top: 10%;
  bottom: 10%;
  left: 50%;
  width: 1px;
}

.editor-node {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--text);
  box-shadow: 0 0 0 4px rgba(24, 24, 24, 0.08);
}

.editor-node-a { left: 24%; top: 78%; }
.editor-node-b { left: 39%; top: 18%; }
.editor-node-c { left: 57%; top: 18%; }
.editor-node-d { left: 72%; top: 78%; }
.editor-node-e { left: 50%; top: 48%; }

.preview-textarea {
  width: 100%;
  min-height: 320px;
  margin-top: 18px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #fcfbf8;
  color: var(--text);
  resize: vertical;
  line-height: 1.4;
  font-size: clamp(1.6rem, 3vw, 3.1rem);
  letter-spacing: 0.01em;
}

.preview-meta,
.editor-toolbar {
  margin-top: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.glyph-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.glyph-button {
  display: grid;
  gap: 4px;
  place-items: center;
  width: 100%;
  min-height: 92px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  cursor: pointer;
}

.glyph-button.is-active {
  border-color: var(--text);
  background: var(--panel-strong);
}

.glyph-char {
  font-size: 1.9rem;
  line-height: 1;
}

.glyph-name {
  color: var(--muted);
  font-size: 0.76rem;
  font-family: var(--mono);
}

.detail-list {
  margin: 18px 0 0;
  padding-left: 18px;
  line-height: 1.7;
}

.user-name {
  margin: 0;
  font-size: 1rem;
}

.user-email {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

@media (max-width: 1080px) {
  .app-frame,
  .workspace-grid,
  .feature-strip {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .workspace {
    order: 1;
  }
}

@media (max-width: 720px) {
  .site-main,
  .site-main-narrow {
    width: min(100% - 20px, 100%);
    padding: 20px 0;
  }

  .hero-card,
  .panel,
  .sidebar,
  .topbar {
    border-radius: 22px;
  }

  .hero-card,
  .sidebar,
  .panel,
  .topbar {
    padding: 18px;
  }

  .topbar,
  .panel-header,
  .sidebar-user,
  .preview-meta,
  .editor-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

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