/* cloudyload — shared styles
   Light theme by default; .dark on <html> flips to dark.
   Accent: teal #14b8a6. System font stack for performance. */

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-elevated: #ffffff;
  --text: #1a1a1a;
  --text-soft: #555;
  --text-muted: #8a8f98;
  --border: #e5e7eb;
  --border-strong: #d4d7dd;
  --accent: #14b8a6;
  --accent-hover: #0f9d8f;
  --accent-soft: rgba(20, 184, 166, 0.10);
  --accent-contrast: #ffffff;
  --shadow-sm: 0 1px 2px rgba(17, 24, 28, 0.04), 0 1px 3px rgba(17, 24, 28, 0.06);
  --shadow-md: 0 4px 12px rgba(17, 24, 28, 0.06), 0 2px 4px rgba(17, 24, 28, 0.04);
  --shadow-lg: 0 12px 32px rgba(17, 24, 28, 0.08), 0 4px 8px rgba(17, 24, 28, 0.04);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --maxw: 1080px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

html.dark {
  --bg: #0f1115;
  --bg-soft: #16181d;
  --bg-elevated: #16181d;
  --text: #e8e8e8;
  --text-soft: #b4b8bf;
  --text-muted: #7a7f88;
  --border: #262932;
  --border-strong: #333742;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --accent-contrast: #06231f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; }

::selection { background: var(--accent-soft); }

/* Focus visibility for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand svg { display: block; color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  color: var(--text-soft);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav a:hover { background: var(--bg-soft); color: var(--text); }
.nav a[aria-current="page"] { color: var(--accent); }

.theme-toggle {
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle .icon-moon { display: none; }
html.dark .theme-toggle .icon-sun { display: none; }
html.dark .theme-toggle .icon-moon { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 550;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-contrast); }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-soft); border-color: var(--text-muted); }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0 48px;
  text-align: center;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-bg svg { position: absolute; }
.blob-1 { top: -160px; left: 50%; transform: translateX(-58%); opacity: 0.5; }
.blob-2 { top: -60px; right: -120px; opacity: 0.35; }
html.dark .blob-1 { opacity: 0.28; }
html.dark .blob-2 { opacity: 0.22; }

.hero .wrap { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.25rem);
  margin: 0 0 16px;
}
.hero .subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--text-soft);
  max-width: 560px;
  margin: 0 auto;
  font-weight: 400;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
}

/* ---------- Upload card ---------- */
.upload-card {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 40px auto 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 48px 24px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-soft);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone .drop-icon {
  color: var(--accent);
  transition: transform 0.18s ease;
}
.dropzone.dragover .drop-icon { transform: translateY(-3px); }
.dropzone .drop-title { font-weight: 600; font-size: 1.05rem; }
.dropzone .drop-hint { color: var(--text-muted); font-size: 0.9rem; }

/* progress + result states share the card body */
.stage { animation: fade-in 0.3s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hidden { display: none !important; }

.file-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  text-align: left;
}
.file-meta .file-ic {
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius-sm);
}
.file-meta .file-name {
  font-weight: 600;
  word-break: break-all;
  line-height: 1.35;
}
.file-meta .file-size { color: var(--text-muted); font-size: 0.88rem; }

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.progress-label { font-size: 0.88rem; color: var(--text-soft); font-weight: 500; }
.progress-pct { font-size: 0.88rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.progress-track {
  height: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #22d3ee);
  border-radius: 100px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* result */
.result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent);
  font-weight: 600;
}
.result-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: start;
}
@media (max-width: 520px) {
  .result-grid { grid-template-columns: 1fr; }
  .qr-wrap { justify-self: center; }
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 7px;
}
.link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.link-input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
}
.copy-btn { flex: none; }
.copy-btn.copied { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.qr-canvas {
  background: #ffffff;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
  image-rendering: pixelated;
}
.qr-cap { font-size: 0.75rem; color: var(--text-muted); }

.segmented {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}
.segmented button {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-soft);
  background: transparent;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] {
  background: var(--bg-elevated);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.expiry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.expiry-note { font-size: 0.88rem; color: var(--text-soft); }
.expiry-note strong { color: var(--text); }

.result-actions { margin-top: 22px; }

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.privacy-pill svg { color: var(--accent); }

/* ---------- Features ---------- */
.features { padding: 56px 0 24px; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 860px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .features-grid { grid-template-columns: 1fr; } }
.feature {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.feature:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature .f-ic {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 10px;
  margin-bottom: 14px;
}
.feature h3 { font-size: 1rem; margin: 0 0 5px; }
.feature p { margin: 0; color: var(--text-soft); font-size: 0.9rem; }

/* ---------- How section ---------- */
.section { padding: 48px 0; }
.section-head { text-align: center; max-width: 560px; margin: 0 auto 36px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 10px; }
.section-head p { color: var(--text-soft); margin: 0; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
}
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.step .step-num {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 650;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.step h3 { font-size: 1.02rem; margin: 0 0 6px; }
.step p { margin: 0; color: var(--text-soft); font-size: 0.92rem; }

/* ---------- Content pages ---------- */
.page { padding: 56px 0 72px; }
.page h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 8px; }
.page .lead { font-size: 1.1rem; color: var(--text-soft); margin: 0 0 32px; }
.page h2 { font-size: 1.35rem; margin: 38px 0 12px; }
.page h3 { font-size: 1.08rem; margin: 26px 0 8px; }
.page p { color: var(--text-soft); margin: 0 0 16px; }
.page ul, .page ol { color: var(--text-soft); padding-left: 22px; margin: 0 0 16px; }
.page li { margin-bottom: 7px; }
.page strong { color: var(--text); }
.page code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--text);
}
.page .muted { color: var(--text-muted); font-size: 0.9rem; }
.page hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

.signoff { color: var(--text-muted); font-style: italic; margin-top: 28px; }

/* changelog */
.release { padding: 26px 0; border-top: 1px solid var(--border); }
.release:first-of-type { border-top: none; }
.release-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.release-ver {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}
.release-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent);
}
.release-date { color: var(--text-muted); font-size: 0.9rem; }
.release ul { margin: 0; }

/* FAQ */
.faq-item { border-top: 1px solid var(--border); padding: 20px 0; }
.faq-item:first-of-type { border-top: none; }
.faq-q { font-weight: 600; margin: 0 0 6px; color: var(--text); }
.faq-a { margin: 0; color: var(--text-soft); }

/* ---------- 404 ---------- */
.notfound {
  min-height: 64vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
}
.notfound .code {
  font-family: var(--mono);
  font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, var(--accent), #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 8px;
}
.notfound h1 { font-size: 1.5rem; margin: 0 0 10px; }
.notfound p { color: var(--text-soft); margin: 0 0 26px; max-width: 420px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 36px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-left { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.9rem; }
.footer-left .brand-mini { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight: 600; }
.footer-left .brand-mini svg { color: var(--accent); }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { color: var(--text-soft); font-size: 0.9rem; }
.footer-nav a:hover { color: var(--text); }
.footer-tag { width: 100%; color: var(--text-muted); font-size: 0.84rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
