/* ====================================================
   Toolnesia - Stylesheet
   Palette: Cloud Dancer + Charcoal + Teal Blue
   ==================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Core palette */
  --bg: #F8F9FA;              /* Cloud Dancer */
  --surface: #FFFFFF;
  --surface-soft: #F8F9FA;
  --border: #E5EBED;
  --border-soft: #F0F2F4;

  /* Text */
  --text: #2C3338;            /* Charcoal */
  --text-soft: #5A6268;
  --text-mute: #8A9298;

  /* Accent — Teal Blue */
  --accent: #008B9C;
  --accent-hover: #006D7A;
  --accent-soft: #E0F2F4;
  --accent-softer: #F0F8F9;

  /* Semantic */
  --success-bg: #E8F5EC;
  --success-text: #2D9D63;
  --warn-bg: #FFF4E5;
  --warn-text: #C46B1F;
  --info-bg: #E8F4F6;
  --info-text: #006D7A;
  --error-bg: #FAE9E7;
  --error-text: #9C2E22;
  --gray-bg: #F0F2F4;
  --gray-text: #6C757D;

  --shadow-sm: 0 1px 3px rgba(44, 51, 56, 0.04);
  --shadow-md: 0 4px 14px rgba(44, 51, 56, 0.08);
  --shadow-lg: 0 12px 28px rgba(44, 51, 56, 0.10);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ============ Header ============ */
.site-header {
  background: var(--text);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  color: white;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.logo-mark {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
}
.site-nav {
  display: flex;
  gap: 22px;
}
.site-nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover { color: white; }

/* ============ Hero ============ */
.hero {
  background: linear-gradient(180deg, var(--bg) 0%, var(--accent-soft) 100%);
  padding: 64px 0 80px;
}
.hero-inner { text-align: center; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 7px 16px;
  border-radius: 99px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 22px;
  border: 0.5px solid #C8E5EA;
  box-shadow: var(--shadow-sm);
}
.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--success-text);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.hero-title {
  font-size: 48px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
  color: var(--text);
}
.accent { color: var(--accent); }
.hero-sub {
  font-size: 16px;
  color: var(--text-soft);
  max-width: 520px;
  margin: 0 auto 30px;
  line-height: 1.6;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding-top: 32px;
  border-top: 0.5px solid rgba(44, 51, 56, 0.08);
  max-width: 480px;
  margin: 0 auto;
}
.stat-number {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.stat-label {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 2px;
}

/* ============ Buttons ============ */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
  font-family: inherit;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-primary:disabled { background: var(--text-mute); cursor: not-allowed; opacity: 0.6; }
.btn-primary.full { width: 100%; }

.btn-secondary {
  display: inline-block;
  background: white;
  color: var(--text);
  border: 0.5px solid #D1D9DD;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}
.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--text-mute);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  margin-top: 12px;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============ Section ============ */
.section { padding: 60px 0; }
.section-tools { background: var(--bg); }
.section-howto { background: white; border-top: 0.5px solid var(--border); }
.section-usecases { background: var(--bg); }
.section-about { background: white; border-top: 0.5px solid var(--border); }

.section-header { text-align: center; margin-bottom: 36px; }
.section-eyebrow {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.section-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* ============ Tools Grid ============ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.tool-card {
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
  position: relative;
}
.tool-card:not(.disabled):hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.tool-card.disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.tool-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.tool-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.tool-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-live { background: var(--success-bg); color: var(--success-text); }
.badge-soon { background: var(--gray-bg); color: var(--gray-text); }
.tool-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.tool-desc {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
  flex-grow: 1;
  margin-bottom: 12px;
}
.tool-meta {
  font-size: 11px;
  color: var(--text-mute);
  font-weight: 500;
}

/* ============ Steps ============ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}
.step-item { text-align: center; }
.step-number {
  width: 40px;
  height: 40px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin: 0 auto 14px;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.step-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.step-desc {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.55;
}

/* ============ Use Cases ============ */
.usecase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.usecase-item {
  background: white;
  padding: 18px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all 0.15s;
}
.usecase-item:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.usecase-emoji {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}
.usecase-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 3px;
  color: var(--text);
}
.usecase-desc {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}

/* ============ Features (Why) ============ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}
.feature-item { text-align: center; }
.feature-emoji {
  font-size: 32px;
  margin-bottom: 12px;
  line-height: 1;
}
.feature-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.feature-desc {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.55;
}

/* ============ Footer ============ */
.site-footer {
  background: var(--text);
  color: white;
  padding: 32px 0;
  text-align: center;
}
.footer-copy {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}
.footer-tagline {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* ============ TOOL PAGE STYLES (used in /qr/, /meta/, etc) ============ */

.tool-page-header {
  text-align: center;
  padding: 48px 0 32px;
}
.tool-page-header h1 {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--text);
}
.tool-page-header p {
  color: var(--text-soft);
  font-size: 16px;
}

.card {
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 720px) { .grid { grid-template-columns: 1fr; } }

/* Dropzone */
.dropzone {
  background: var(--accent-softer);
  border: 1.5px dashed #C8E5EA;
  border-radius: var(--radius);
  padding: 36px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  margin-bottom: 14px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone svg { color: var(--accent); margin: 0 auto 10px; display: block; }
.dz-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; color: var(--text); }
.dz-sub { font-size: 12px; color: var(--text-mute); }
#preview-img {
  max-width: 100%;
  max-height: 160px;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto 10px;
}
#preview-name { font-size: 13px; font-weight: 500; word-break: break-all; color: var(--text); }
#btn-clear { margin-top: 8px; font-size: 11px; padding: 5px 12px; }

.info-text {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-mute);
  text-align: center;
}

/* Result Box */
.result-box {
  background: var(--accent-softer);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}
.result-empty { text-align: center; color: var(--text-mute); }
.result-empty svg { margin: 0 auto 10px; display: block; }
.result-empty p { font-size: 13px; }

#qrcode {
  background: white;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  border: 0.5px solid var(--border);
}
#qrcode img, #qrcode canvas { display: block; }

.result-url {
  font-size: 13px;
  font-family: ui-monospace, "SF Mono", monospace;
  color: var(--accent);
  word-break: break-all;
  margin-bottom: 4px;
  text-align: center;
}
.result-info {
  font-size: 11px;
  color: var(--text-mute);
  text-align: center;
  margin-bottom: 14px;
}
.action-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Content sections within tool pages */
.content-section { padding: 32px 0; }
.content-section h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.content-section ol { padding-left: 22px; }
.content-section li { margin-bottom: 8px; color: var(--text-soft); }
.content-section details {
  border-bottom: 0.5px solid var(--border);
  padding: 14px 0;
}
.content-section summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
}
.content-section details p {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 14px;
}

/* View page */
.view-page { background: var(--bg); }
.image-viewer {
  margin: 32px 0 16px;
  text-align: center;
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.image-viewer img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius);
  display: block;
  margin: 0 auto;
}
.meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-mute);
  margin-bottom: 24px;
  padding: 0 4px;
  flex-wrap: wrap;
}
.meta-link {
  color: var(--accent);
  text-decoration: none;
  margin-left: auto;
  font-weight: 500;
}
.meta-link:hover { text-decoration: underline; }

.cta-strip {
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  margin-bottom: 32px;
}
.cta-strip p {
  margin-bottom: 14px;
  color: var(--text-soft);
}

.error-card {
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 56px 24px;
  text-align: center;
  margin: 40px auto;
  max-width: 480px;
  box-shadow: var(--shadow-sm);
}
.error-card svg { color: var(--text-mute); margin: 0 auto 16px; display: block; }
.error-card h2 { margin-bottom: 8px; font-size: 20px; color: var(--text); }
.error-card p { color: var(--text-soft); margin-bottom: 22px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  z-index: 100;
  animation: toastIn 0.2s ease-out;
  box-shadow: var(--shadow-lg);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ============ Mobile ============ */
@media (max-width: 640px) {
  .hero { padding: 48px 0 64px; }
  .hero-title { font-size: 36px; }
  .hero-sub { font-size: 15px; }
  .section-title { font-size: 24px; }
  .section { padding: 48px 0; }
  .hero-stats { gap: 24px; }
  .stat-number { font-size: 22px; }
  .site-nav { display: none; }
}