:root {
  color-scheme: light;
  --background: #f3f1ea;
  --surface: #fffefa;
  --surface-subtle: #eae7dd;
  --text: #14211d;
  --muted: #68716d;
  --line: #cecfc7;
  --accent: #087f64;
  --accent-hover: #066951;
  --accent-soft: #dcefe8;
  --warning: #8a5a12;
  --warning-bg: #f8ecd6;
  --danger: #a13c31;
  --shadow: 0 24px 70px rgba(26, 39, 34, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--background);
  color: var(--text);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #101715;
  --surface: #18211e;
  --surface-subtle: #222e2a;
  --text: #edf5f1;
  --muted: #9ca9a4;
  --line: #34423d;
  --accent: #55c9a8;
  --accent-hover: #71d8b9;
  --accent-soft: #203d34;
  --warning: #efbd6b;
  --warning-bg: #3b3020;
  --danger: #ef8b80;
  --shadow: 0 24px 70px rgba(0, 0, 0, .23);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; }
button, input { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.site-header,
main,
footer {
  margin: 0 auto;
  max-width: 1120px;
  width: calc(100% - 3rem);
}

.site-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 76px;
  justify-content: space-between;
}

.brand-row { align-items: baseline; display: flex; gap: 2rem; }
.brand { align-items: baseline; display: flex; font-weight: 760; gap: .5rem; letter-spacing: -.03em; text-decoration: none; }
.brand-name { text-decoration: none; }
.brand-section { color: var(--muted); font-size: .68rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }
.brand-section a { text-decoration: none; }
.brand-section a:hover { color: var(--text); }
.back-to-tools { color: var(--muted); font-size: .75rem; text-decoration: none; }
.back-to-tools:hover { color: var(--text); }
.header-actions { align-items: center; display: flex; gap: 1rem; }
.privacy-label { align-items: center; color: var(--muted); display: flex; font-size: .73rem; gap: .45rem; }
.status-dot { background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 4px var(--accent-soft); height: 7px; width: 7px; }
.theme-toggle { background: transparent; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; display: grid; height: 36px; place-items: center; width: 36px; }
.theme-toggle:hover { background: var(--surface-subtle); }

main { padding: clamp(4rem, 9vw, 8rem) 0 7rem; }
.hero { max-width: 850px; }
.eyebrow, .panel-kicker { color: var(--accent); font-size: .7rem; font-weight: 760; letter-spacing: .14em; margin: 0; text-transform: uppercase; }
.hero h1 {
  font-family: "Avenir Next", "Century Gothic", Futura, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(3.15rem, 8vw, 6.7rem);
  font-weight: 340;
  letter-spacing: -.065em;
  line-height: .91;
  margin: 1.25rem 0 2rem;
}
.hero h1 em {
  color: var(--accent);
  display: inline-block;
  font-size: min(.7em, 8.5vw);
  font-style: normal;
  white-space: nowrap;
}
.intro { color: var(--muted); font-size: clamp(1rem, 2vw, 1.18rem); line-height: 1.65; margin: 0; max-width: 650px; }

.transfer-shell { margin: clamp(4.5rem, 10vw, 8rem) auto 0; max-width: 820px; }
.step-rail { align-items: center; color: var(--muted); display: flex; font: .68rem ui-monospace, SFMono-Regular, Menlo, monospace; gap: .7rem; margin: 0 0 1rem 1.5rem; width: 150px; }
.step-rail i { background: var(--line); display: block; height: 1px; flex: 1; }
.step-rail .active { color: var(--accent); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: clamp(1.5rem, 5vw, 3.2rem); }
.panel-heading { align-items: flex-start; display: flex; justify-content: space-between; margin-bottom: 2.2rem; }
.panel-heading h2, .error-panel h2 { font-family: "Avenir Next", "Century Gothic", Futura, sans-serif; font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 400; letter-spacing: -.045em; line-height: 1; margin: .65rem 0 0; }
.panel-number { color: var(--muted); font: .75rem ui-monospace, SFMono-Regular, Menlo, monospace; }

.drop-zone { align-items: center; background: var(--background); border: 1px dashed var(--line); border-radius: 14px; cursor: pointer; display: flex; flex-direction: column; min-height: 245px; justify-content: center; padding: 2rem; transition: border-color 150ms, background 150ms, transform 150ms; width: 100%; }
.drop-zone:hover, .drop-zone.dragging { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-2px); }
.drop-zone strong { font-size: 1.1rem; margin: .9rem 0 .35rem; }
.drop-zone > span:last-child { color: var(--muted); font-size: .86rem; }
.drop-icon { border: 1px solid var(--line); border-radius: 50%; color: var(--accent); display: grid; font-size: 1.4rem; height: 52px; place-items: center; width: 52px; }

.relay-option { align-items: flex-start; cursor: pointer; display: flex; gap: .85rem; margin-top: 1.4rem; }
.relay-option input { accent-color: var(--accent); height: 18px; margin: .2rem 0 0; width: 18px; }
.relay-option span { display: grid; gap: .25rem; }
.relay-option strong { font-size: .85rem; }
.relay-option small, .secret-note, .receiver-intro { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.receiver-intro { font-size: .95rem; margin: -1rem 0 1.5rem; max-width: 570px; }

.share-layout { align-items: center; display: grid; gap: 2rem; grid-template-columns: 150px minmax(0, 1fr); }
.qr-code { background: white; border: 1px solid var(--line); border-radius: 12px; display: block; padding: 9px; width: 150px; }
.selected-file { font-weight: 700; margin: 0 0 .8rem; overflow-wrap: anywhere; }
.link-field { display: flex; gap: .5rem; }
.link-field input { background: var(--background); border: 1px solid var(--line); border-radius: 9px; min-width: 0; padding: .75rem .85rem; width: 100%; }
.secret-note { margin: .65rem 0 0; }
.waiting-state { align-items: center; border-top: 1px solid var(--line); display: flex; font-size: .85rem; gap: .65rem; margin-top: 2rem; padding-top: 1.4rem; }
.pulse { animation: pulse 1.6s infinite; background: var(--accent); border-radius: 50%; height: 8px; width: 8px; }

.button { align-items: center; border: 1px solid transparent; border-radius: 9px; cursor: pointer; display: inline-flex; font-size: .86rem; font-weight: 720; justify-content: center; min-height: 46px; padding: .72rem 1.1rem; text-decoration: none; }
.button.primary { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .button.primary { color: #10221c; }
.button.primary:hover { background: var(--accent-hover); }
.button.secondary { background: transparent; border-color: var(--line); }
.button.secondary:hover { background: var(--surface-subtle); }
.button.compact { min-height: 42px; padding: .55rem .85rem; }
#receiver-connect { margin-top: 1.7rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }
.text-button { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: .76rem; margin-top: 1.3rem; padding: 0; text-decoration: underline; text-underline-offset: .25em; }
.text-button:hover { color: var(--text); }

.file-card { align-items: center; background: var(--background); border: 1px solid var(--line); border-radius: 12px; display: flex; gap: 1rem; padding: 1.15rem; }
.file-glyph { background: var(--accent-soft); border-radius: 9px; color: var(--accent); display: grid; flex: 0 0 auto; font-size: 1.3rem; height: 46px; place-items: center; width: 46px; }
.file-card div { display: grid; gap: .28rem; min-width: 0; }
.file-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card span:last-child { color: var(--muted); font-size: .78rem; }
.warning { background: var(--warning-bg); border-radius: 10px; color: var(--warning); font-size: .8rem; line-height: 1.5; margin-top: 1rem; padding: .9rem 1rem; }

.progress-percent { color: var(--accent); font: 1.25rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.progress-file { font-weight: 700; margin: -1rem 0 1.3rem; overflow-wrap: anywhere; }
.progress-track { background: var(--surface-subtle); border-radius: 999px; height: 10px; overflow: hidden; }
.progress-track span { background: var(--accent); border-radius: inherit; display: block; height: 100%; transition: width 180ms ease; width: 0; }
.progress-meta { color: var(--muted); display: grid; font: .72rem ui-monospace, SFMono-Regular, Menlo, monospace; gap: .7rem; grid-template-columns: 1fr auto auto; margin-top: .8rem; }
.transfer-message { color: var(--muted); font-size: .86rem; line-height: 1.55; margin: 1.5rem 0 0; }
#save-download { margin-top: 1.2rem; }
.error-panel p:not(.panel-kicker) { color: var(--muted); line-height: 1.6; margin: 1rem 0 1.5rem; }

.trust-grid { border-top: 1px solid var(--line); display: grid; gap: 0; grid-template-columns: repeat(3, 1fr); margin-top: clamp(5rem, 12vw, 9rem); }
.trust-grid article { border-right: 1px solid var(--line); padding: 2rem; }
.trust-grid article:last-child { border-right: 0; }
.trust-grid span { color: var(--accent); font: .68rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.trust-grid h3 { font-size: .95rem; margin: 1.1rem 0 .55rem; }
.trust-grid p { color: var(--muted); font-size: .8rem; line-height: 1.55; margin: 0; }

footer { align-items: center; border-top: 1px solid var(--line); color: var(--muted); display: flex; font-size: .75rem; justify-content: space-between; padding: 1.5rem 0 2.5rem; }
footer p { margin: 0; }
footer a { text-underline-offset: .2em; }

@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

@media (max-width: 680px) {
  .site-header, main, footer { width: calc(100% - 2rem); }
  .site-header { height: 64px; }
  .privacy-label { display: none; }
  .brand-row { gap: 1rem; }
  .back-to-tools { font-size: .68rem; }
  main { padding-top: 4rem; }
  .hero h1 { font-size: clamp(3rem, 15vw, 5.2rem); }
  .panel { border-radius: 15px; }
  .share-layout { grid-template-columns: 1fr; }
  .qr-code { width: 130px; }
  .link-field { align-items: stretch; flex-direction: column; }
  .progress-meta { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .trust-grid article { border-bottom: 1px solid var(--line); border-right: 0; padding: 1.5rem .25rem; }
  footer { align-items: flex-start; flex-direction: column; gap: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  .drop-zone, .progress-track span { transition: none; }
}
