/* ===========================
   Reset & Tokens
   Inspired by: Linear, Vercel, shadcn/ui
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette — zinc + violet (shadcn/Linear style) */
  --bg:         #ffffff;
  --surface:    #ffffff;
  --surface-2:  #fafafa;
  --border:     #e4e4e7;
  --border-2:   #d4d4d8;

  --text-1:     #09090b;
  --text-2:     #52525b;
  --text-3:     #a1a1aa;

  --accent:     #7c3aed;
  --accent-lt:  #ede9fe;
  --accent-mid: #ddd6fe;

  --green:      #16a34a;
  --green-lt:   #dcfce7;
  --yellow:     #ca8a04;
  --yellow-lt:  #fef9c3;
  --red:        #dc2626;
  --red-lt:     #fee2e2;

  --radius:     8px;
  --radius-sm:  6px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02','cv03','cv04','cv11';
}

/* ===========================
   Nav
=========================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-1);
}

.brand-mark {
  width: 24px; height: 24px;
  background: var(--text-1);
  border-radius: 6px;
  display: block;
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: '';
  position: absolute;
  top: 30%; left: 20%;
  width: 60%; height: 60%;
  background: white;
  border-radius: 3px;
  opacity: 0.25;
}

.brand-accent { color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 0.5rem; }

.nav-badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.btn-copy-all {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-copy-all:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text-1);
}

/* ===========================
   Hero
=========================== */
.hero {
  padding: 108px 1.5rem 48px;
  max-width: 860px;
  margin: 0 auto;
  position: relative;
}

.hero-bg {
  position: fixed; top: 0; left: 0; right: 0; height: 50vh;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, #ede9fe 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}

.hero-content { position: relative; z-index: 1; }

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-lt);
  border: 1px solid var(--accent-mid);
  padding: 3px 10px;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
  letter-spacing: 0.01em;
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: 0.85rem;
  color: var(--text-1);
}

.gradient-text {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 45%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-2);
  max-width: 440px;
  margin-bottom: 1.75rem;
  line-height: 1.65;
  font-weight: 400;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: fit-content;
}

.stat-item { display: flex; flex-direction: column; gap: 1px; }
.stat-num {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.03em;
}
.stat-label {
  font-size: 0.67rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
}
.stat-divider { width: 1px; height: 30px; background: var(--border); }

.progress-bar-wrap {
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  margin-top: 2rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.35s cubic-bezier(.4,0,.2,1);
}

/* ===========================
   Form Layout
=========================== */
.form-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
  position: relative; z-index: 1;
}

.form-grid { display: flex; flex-direction: column; gap: 2px; }

/* ===========================
   Section Card
=========================== */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-section:focus-within {
  border-color: var(--border-2);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.06);
}

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.section-num {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  margin-top: 3px;
  letter-spacing: 0.02em;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-1);
  margin-bottom: 2px;
}

.section-sub {
  font-size: 0.78rem;
  color: var(--text-3);
  line-height: 1.4;
}

/* ===========================
   Fields
=========================== */
.fields { display: flex; flex-direction: column; gap: 1rem; }

.field-row { display: flex; flex-direction: column; gap: 0.4rem; }
.field-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }

.field-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

.field-input, .field-textarea {
  font-family: var(--font);
  font-size: 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-1);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
  line-height: 1.5;
}
.field-input::placeholder, .field-textarea::placeholder {
  color: var(--text-3);
  font-weight: 400;
}
.field-input:focus, .field-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}
.field-input.sm { padding: 0.4rem 0.65rem; font-size: 0.825rem; }

.field-hint {
  font-size: 0.72rem;
  color: var(--text-3);
  line-height: 1.4;
}

/* ===========================
   Chips
=========================== */
.chip-group { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip-group.inline { display: inline-flex; }

.chip {
  font-family: var(--font);
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  user-select: none;
}
.chip.sm { font-size: 0.72rem; padding: 2px 9px; }
.chip:hover { background: var(--surface-2); border-color: var(--border-2); color: var(--text-1); }

.chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chip.chip--red.selected   { background: var(--red);    border-color: var(--red);    color: #fff; }
.chip.chip--yellow.selected { background: var(--yellow); border-color: var(--yellow); color: #fff; }
.chip.chip--green.selected  { background: var(--green);  border-color: var(--green);  color: #fff; }

/* ===========================
   Tag Input
=========================== */
.tag-input-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: flex-start;
  min-height: 44px;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: text;
}
.tag-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

.tags { display: contents; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-lt);
  border: 1px solid var(--accent-mid);
  padding: 2px 8px 2px 10px;
  border-radius: 9999px;
  white-space: nowrap;
}

.tag-remove {
  background: none; border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  opacity: 0.5;
  padding: 0;
  display: flex; align-items: center;
  transition: opacity 0.1s;
}
.tag-remove:hover { opacity: 1; }

.tag-input {
  font-family: var(--font);
  font-size: 0.85rem;
  background: none; border: none;
  color: var(--text-1);
  outline: none;
  flex: 1;
  min-width: 180px;
  padding: 2px 4px;
}
.tag-input::placeholder { color: var(--text-3); }

/* ===========================
   Service Table
=========================== */
.service-table { display: flex; flex-direction: column; gap: 0.4rem; }

.service-header {
  display: grid;
  grid-template-columns: 1fr 1fr 110px 28px;
  gap: 0.6rem;
  padding: 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.service-row {
  display: grid;
  grid-template-columns: 1fr 1fr 110px 28px;
  gap: 0.6rem;
  align-items: center;
}

.row-remove {
  background: none; border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 4px; border-radius: var(--radius-sm);
  transition: color 0.12s, background 0.12s;
  display: flex; align-items: center; justify-content: center;
}
.row-remove:hover { color: var(--red); background: var(--red-lt); }

.add-row-btn {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-3);
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 7px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: all 0.15s;
}
.add-row-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-lt); }

/* ===========================
   Claude Role
=========================== */
.claude-role-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.role-segment { display: flex; align-items: center; gap: 0.65rem; }

.role-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  white-space: nowrap;
  width: 74px;
  font-weight: 500;
}

.role-input { flex: 1; }

/* ===========================
   Submit
=========================== */
.submit-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding-top: 2.5rem;
}

.submit-hint { font-size: 0.78rem; color: var(--text-3); text-align: center; }

.btn-submit {
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--text-1);
  border: 1px solid var(--text-1);
  padding: 0.65rem 1.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: opacity 0.15s, transform 0.12s;
  letter-spacing: -0.01em;
}
.btn-submit:hover { opacity: 0.82; }
.btn-submit:active { transform: scale(0.985); }
.btn-submit.sm { font-size: 0.825rem; padding: 0.5rem 1.25rem; }

.btn-icon { font-size: 0.9rem; }

/* ===========================
   Toast
=========================== */
.toast {
  position: fixed;
  bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--text-1);
  color: #fff;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 999;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===========================
   Modal
=========================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(9,9,11,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  width: 100%;
  max-width: 660px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: translateY(8px) scale(0.99);
  transition: transform 0.2s;
  box-shadow: 0 20px 60px rgba(9,9,11,0.15), 0 4px 12px rgba(9,9,11,0.08);
}
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 0.875rem; font-weight: 600; letter-spacing: -0.01em; }

.modal-close {
  background: none; border: none;
  color: var(--text-3); font-size: 0.9rem;
  cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
}
.modal-close:hover { background: var(--surface-2); color: var(--text-1); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.75;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-2);
}

.modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* ===========================
   Responsive
=========================== */
@media (max-width: 640px) {
  .hero { padding-top: 84px; }
  .hero-title { font-size: 1.85rem; }
  .field-row.two-col { grid-template-columns: 1fr; }
  .service-header { display: none; }
  .service-row { grid-template-columns: 1fr 1fr 28px; }
  .service-row .chip-group.inline { display: none; }
  .hero-stats { gap: 0.85rem; }
}
