:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-accent: radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 32%), #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #1d2939;
  --muted: #667085;
  --line: #d0d5dd;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-soft: #ccfbf1;
  --shadow: 0 16px 40px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-accent);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
  display: grid;
  gap: 20px;
}

.shell-narrow {
  width: min(760px, calc(100% - 32px));
}

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

.hero {
  overflow: hidden;
}

.heading {
  margin-bottom: 24px;
}

.heading.compact {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  line-height: 1.15;
}

h3 {
  font-size: 1.1rem;
  line-height: 1.2;
}

.lead,
.section-copy,
.mini-card p,
.template-card p,
.portfolio-card p,
.status-message,
.empty-state p {
  color: var(--muted);
  line-height: 1.65;
}

.lead {
  max-width: 760px;
  margin: 16px 0 0;
  font-size: 1.02rem;
}

.section-copy {
  margin: 10px 0 0;
}

.hero-grid,
.template-grid,
.portfolio-grid {
  display: grid;
  gap: 16px;
}

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

.mini-card,
.template-card,
.portfolio-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
}

.mini-card,
.template-card {
  padding: 20px;
}

.mini-card h2,
.template-card h3 {
  margin-bottom: 10px;
}

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

.template-badge,
.portfolio-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.status-message {
  padding: 18px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fff;
}

.status-message.error {
  border-style: solid;
  color: #b42318;
}

.portfolio-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 16px;
}

.portfolio-card {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.portfolio-preview {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #e4e7ec;
}

.portfolio-header {
  display: grid;
  gap: 8px;
}

.portfolio-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.96rem;
}

.portfolio-meta strong {
  color: var(--text);
}

.portfolio-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease;
}

.portfolio-link:hover,
.portfolio-link:focus-visible,
.primary-link:hover,
.primary-link:focus-visible {
  background: var(--accent-dark);
}

.empty-state {
  text-align: center;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 880px) {
  .hero-grid,
  .template-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell,
  .shell-narrow {
    width: min(100% - 20px, 1120px);
    padding: 20px 0 28px;
  }

  .panel {
    padding: 20px;
    border-radius: 16px;
  }
}
