:root {
  color-scheme: light;
  --bg: #f6f6f6;
  --surface: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --accent: #111111;
  --success: #0f7b4a;
  --success-soft: #eefaf4;
  --danger: #c00;
  --danger-soft: #fff0f0;
  --radius-lg: 16px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(780px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 80px;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 48px;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 2px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-nav span {
  color: var(--muted);
  font-size: 0.82rem;
}

.topbar-nav a {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.topbar-nav a:hover {
  color: var(--muted);
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  vertical-align: middle;
  margin-right: 3px;
}

h1 {
  margin: 0 0 12px;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
}

p {
  margin: 0;
}

.hero-copy {
  margin-bottom: 40px;
}

.hero-copy .eyebrow {
  margin-bottom: 8px;
  font-size: 0.78rem;
}

.hero-text {
  max-width: 560px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.pipeline-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 36px;
}

.pipeline-steps span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
}

.app-panel {
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.parser-form label {
  display: block;
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 700;
}

.form-row {
  display: flex;
  gap: 8px;
}

input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface);
  outline: none;
  font-size: 0.92rem;
}

input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: #333;
}

.form-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.result-card {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.result-card--success {
  border-color: #cce7d9;
  background: var(--success-soft);
}

.result-card--error {
  border-color: #f0cccc;
  background: var(--danger-soft);
}

.result-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.result-card--success .result-icon {
  background: var(--success);
}

.result-card--error .result-icon {
  background: var(--danger);
}

.result-content {
  flex: 1;
  min-width: 0;
}

.result-content > p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.link-result {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.link-result span {
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 72px;
}

.link-result a {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #0057b3;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-result a:hover {
  color: #003d7a;
}

.copy-button {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  font-size: 0.78rem;
}

.copy-button:hover {
  border-color: var(--ink);
}

.empty-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--line);
}

.feature-grid article {
  padding: 20px;
  background: var(--surface);
}

.feature-grid strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
  font-weight: 700;
}

.feature-grid p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .page-shell {
    width: calc(100% - 28px);
    padding-top: 20px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 32px;
  }

  .topbar-nav span {
    font-size: 0.78rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .form-row {
    flex-direction: column;
  }

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

  .link-result {
    flex-wrap: wrap;
  }

  .link-result a {
    white-space: normal;
    overflow-wrap: anywhere;
    width: 100%;
  }

  .result-card {
    flex-direction: column;
  }
}
