@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&family=Roboto+Slab:wght@400;600;700&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --color-primary:   #3EA37B;
  --color-dark:      #23474E;
  --color-secondary: #54595F;
  --color-text:      #7A7A7A;
  --color-border:    #CECECE;

  --bg:              #ffffff;
  --bg-subtle:       #f7f8f9;
  --bg-card:         #ffffff;
  --text:            #1a1a1a;
  --text-muted:      #7A7A7A;
  --border:          #CECECE;
  --shadow:          0 1px 4px rgba(0,0,0,0.08);
  --shadow-hover:    0 4px 16px rgba(0,0,0,0.12);
  --radius:          12px;
}

@media (prefers-color-scheme: dark) {
  :root { --mode: dark; }
}

[data-theme="dark"] {
  --bg:           #1a2a2e;
  --bg-subtle:    #152228;
  --bg-card:      #23474E;
  --text:         #f0f0f0;
  --text-muted:   #a8c0c4;
  --border:       #3a5a62;
  --shadow:       0 1px 4px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.4);
}

[data-theme="light"] {
  --bg:           #ffffff;
  --bg-subtle:    #f7f8f9;
  --bg-card:      #ffffff;
  --text:         #1a1a1a;
  --text-muted:   #7A7A7A;
  --border:       #CECECE;
  --shadow:       0 1px 4px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 18px; scroll-behavior: smooth; }

body {
  font-family: 'Roboto', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.2s, color 0.2s;
}

h1, h2, h3, h4 {
  font-family: 'Roboto Slab', Georgia, serif;
  line-height: 1.25;
  color: var(--text);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Layout ─────────────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s, background 0.2s;
}

.site-nav.scrolled { box-shadow: var(--shadow-hover); }

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-nav__logo {
  font-family: 'Roboto Slab', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

[data-theme="dark"] .site-nav__logo { color: var(--text); }

.site-nav__logo img { height: 32px; width: auto; }

.site-nav__actions { display: flex; align-items: center; gap: 12px; }

.btn-theme {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}
.btn-theme:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
}

.hero__label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.hero h1 { font-size: 2.2rem; margin-bottom: 12px; }

.hero p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 560px;
}

/* ── Section ─────────────────────────────────────────────── */
.section { padding: 48px 0; }

.section__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ── Tool Cards ──────────────────────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
}

.tool-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.tool-card__platform {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
}

.tool-card__title {
  font-family: 'Roboto Slab', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.tool-card__desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tool-card__arrow {
  margin-top: auto;
  padding-top: 12px;
  font-size: 0.8rem;
  color: var(--color-primary);
  font-weight: 600;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border: none;
  font-family: inherit;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}
.btn--primary:hover { background: var(--color-dark); }

.btn--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn--outline:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn--copy {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 0.72rem;
  border-radius: 6px;
}
.btn--copy:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn--copy.copied { border-color: var(--color-primary); color: var(--color-primary); }

/* ── Form ────────────────────────────────────────────────── */
.url-form {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
}

.url-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.15s;
  outline: none;
}

.url-input:focus { border-color: var(--color-primary); }
.url-input::placeholder { color: var(--text-muted); }

/* ── Result Cards ────────────────────────────────────────── */
.result-section { margin-bottom: 40px; }

.result-section__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.result-section__titlerow .result-section__title { margin-bottom: 0; }

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.result-field {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.result-field:last-child { border-bottom: none; }

.result-field__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  min-width: 120px;
  padding-top: 2px;
}

.result-field__value {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text);
  word-break: break-word;
}

.result-field__actions { flex-shrink: 0; }

/* ── Key Art ─────────────────────────────────────────────── */
.key-art {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

/* ── Reward Table ────────────────────────────────────────── */
.reward-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.reward-table th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  text-align: left;
}

.reward-table th.num { text-align: right; }

.reward-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}

.reward-table td.num { text-align: right; }
.reward-table tbody tr:last-child td { border-bottom: none; }
.reward-table tbody tr:hover td { background: var(--bg-subtle); }

.dim { color: var(--text-muted); }

/* ── States ──────────────────────────────────────────────── */
.state-loading,
.state-error,
.state-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.state-error { color: #e05c5c; }

.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Platform badge ──────────────────────────────────────── */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--color-primary);
  color: #fff;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 64px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}
