:root {
  --ink: #352500;
  --moss: #6b4d00;
  --leaf: #a46f00;
  --lime: #ffe08a;
  --foam: #fffaf0;
  --error: #9b3d26;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  font-family: "Outfit", system-ui, sans-serif;
  background: radial-gradient(1200px 700px at 12% -10%, #fff0a8 0%, transparent 55%),
    radial-gradient(900px 600px at 100% 0%, #eed992 0%, transparent 45%),
    linear-gradient(165deg, #fffdf2 0%, #f9edbd 48%, #faebba 100%);
  background-attachment: fixed;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
.page { min-height: 100vh; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.page::before { content: ""; position: absolute; inset: auto -10% -20% 40%; height: 55vh; background: radial-gradient(closest-side, rgba(244,205,85,.42), transparent 70%); pointer-events: none; animation: drift 12s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-6%,-4%,0) scale(1.08); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.site-header { position: relative; z-index: 2; width: min(920px, calc(100% - 2.5rem)); margin:0 auto; padding: 1rem 0 .5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.header-brand { color: var(--ink); font-family: "Fraunces", Georgia, serif; font-size: 1.55rem; font-weight: 600; letter-spacing: -.03em; text-decoration: none; margin-top: 1rem}
.header-nav { display: flex; gap: .8rem; align-items: center; margin-top: 1rem; }
.header-nav a { color: var(--leaf); font-size: .88rem; text-decoration: none; }
.hero { flex: 1; display: flex; flex-direction: column; justify-content: center; width: min(920px, calc(100% - 2.5rem)); margin: 0 auto; padding: 2rem 0 1.5rem; position: relative; z-index: 1; animation: rise .8s ease both; }
.hero.narrow { max-width: 640px; }
.brand { font-family: "Fraunces", Georgia, serif; font-size: clamp(5rem, 13vw, 7.5rem); font-weight: 600; line-height: .9; letter-spacing: -.04em; color: var(--ink); margin: 0 0 1.25rem; }
.brand.small { font-size: clamp(3.5rem, 9vw, 4.5rem); }
.headline { font-family: "Fraunces", Georgia, serif; font-size: clamp(1.35rem, 3.2vw, 1.85rem); font-weight: 500; line-height: 1.35; margin: 0 0 .75rem; color: var(--moss); }
.lede { margin: 0 0 2.25rem; font-size: 1.05rem; line-height: 1.55; color: color-mix(in srgb, var(--ink) 72%, transparent); }
.mono { font-family: ui-monospace, "Cascadia Code", monospace; font-size: .95em; }
.form-shell { width: min(640px, 100%); display: grid; gap: .9rem; animation: rise .9s .12s ease both; }
.home-actions { max-width: 620px; grid-template-columns: 1fr 1fr; }
.primary-link, .secondary-link { border-radius: .85rem; padding: 1rem 1.25rem; text-decoration: none; font-weight: 600; transition: transform .15s ease, background .2s ease; }
.primary-link { background: var(--ink); color: var(--lime); }
.secondary-link { background: color-mix(in srgb, white 70%, transparent); color: var(--ink); border: 1.5px solid color-mix(in srgb, var(--ink) 16%, transparent); }
.primary-link:hover, .secondary-link:hover { transform: translateY(-1px); }
.primary-link span, .secondary-link span { float: right; }
.feature-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.4rem; }
.feature-grid div { display: grid; gap: .3rem; }
.feature-grid strong { color: var(--leaf); font-size: .9rem; }
.feature-grid span, .hint, .result-meta { color: color-mix(in srgb, var(--ink) 58%, transparent); font-size: .85rem; line-height: 1.45; }
.transfer-header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.back-link { color: var(--leaf); font-size: .9rem; }
.drop-zone { display: grid; gap: .5rem; place-items: center; min-height: 190px; padding: 2rem; border: 1.5px dashed color-mix(in srgb, var(--leaf) 65%, transparent); border-radius: 1rem; background: color-mix(in srgb, white 52%, transparent); cursor: pointer; text-align: center; }
.drop-zone.dragging, .drop-zone:hover { background: color-mix(in srgb, var(--lime) 30%, white); border-color: var(--leaf); }
.drop-zone strong { color: var(--moss); font-size: 1.1rem; }
input[type="file"] { display: none; }
.file-card, .reader-card { display: grid; gap: .8rem; padding: 1rem; border-top: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); }
.file-list { display: grid; gap: .65rem; }
.file-item { display: grid; grid-template-columns: 58px 1fr auto; gap: .7rem; align-items: center; padding: .55rem; border-radius: .7rem; background: color-mix(in srgb, white 58%, transparent); }
.file-thumb { width: 58px; height: 58px; object-fit: cover; border-radius: .5rem; background: #eee5f2; }
.file-thumb-placeholder { display: grid; place-items: center; align-content: center; gap: .1rem; color: var(--leaf); font-size: .62rem; font-weight: 600; }
.file-type-icon { font-size: 1.55rem; line-height: 1; }
.file-extension { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-video .file-thumb-placeholder { color: #4c008a; background: #e0cfff; }
.type-audio .file-thumb-placeholder { color: #6b5b00; background: #fff0a8; }
.type-pdf .file-thumb-placeholder { color: #9b3d26; background: #f4c5a9; }
.type-archive .file-thumb-placeholder { color: #805b00; background: #ead18b; }
.type-document .file-thumb-placeholder { color: #5d6900; background: #e5e9a9; }
.file-item-info { min-width: 0; }
.file-name-editor { display: flex; width: 100%; min-width: 0; height: 2.1rem; overflow: hidden; border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); border-radius: .45rem; background: color-mix(in srgb, white 78%, transparent); }
.file-item-name { width: 100%; min-width: 0; height: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; outline: 0; padding: .35rem .5rem; background: transparent; color: var(--ink); font: inherit; font-size: .9rem; font-weight: 600; }
.file-name-extension { display: grid; flex: 0 0 auto; place-items: center; padding: 0 .55rem 0 .15rem; color: var(--moss); font-size: .82rem; font-weight: 600; }
.file-name-editor:focus-within { outline: 2px solid color-mix(in srgb, var(--leaf) 45%, transparent); outline-offset: 1px; }
.file-item-name:focus { outline: 2px solid color-mix(in srgb, var(--leaf) 45%, transparent); outline-offset: 1px; }
.file-item-meta { margin: .2rem 0 0; color: color-mix(in srgb, var(--ink) 58%, transparent); font-size: .78rem; }
.file-item-actions { display: flex; gap: .35rem; }
.file-item-actions button { padding: .45rem .55rem; font-size: .78rem; }
.file-name { font-weight: 600; word-break: break-all; }
.qr-wrap { display: grid; place-items: center; gap: .5rem; padding: .7rem; border-radius: 1rem; background: white; }
#qrcode { width: min(320px, calc(100vw - 3rem)); aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; }
#qrcode img, #qrcode canvas { display: block; width: 100% !important; height: 100% !important; object-fit: contain; image-rendering: pixelated; }
.qr-status { text-align: center; margin: 0; color: var(--moss); }
.frame-count { font-size: clamp(1.15rem, 4vw, 1.7rem); font-weight: 600; min-height: 2.1rem; }
.progress { height: .75rem; border-radius: 99px; overflow: hidden; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.progress-bar { height: 100%; width: 0; background: var(--leaf); transition: width .15s linear; }
.progress-label { margin: 0; font-size: .9rem; text-align: right; color: var(--moss); }
button, .btn-secondary { font: inherit; border: 0; border-radius: .85rem; padding: .85rem 1.1rem; font-weight: 600; cursor: pointer; }
button.primary { background: var(--ink); color: var(--lime); }
button.secondary, .btn-secondary { background: color-mix(in srgb, white 70%, transparent); color: var(--ink); border: 1.5px solid color-mix(in srgb, var(--ink) 16%, transparent); }
button:disabled { opacity: .45; cursor: not-allowed; }
.banner { margin: 0; padding: .75rem .95rem; border-radius: .75rem; font-size: .95rem; line-height: 1.4; }
.banner.error { background: #f8e4ea; color: var(--error); }
.banner.ok { background: #eee2f7; color: var(--moss); }
.reader-shell { width: min(720px, 100%); }
.reader-shell .reader-card { width: 100%; padding: 0; border-top: 0; }
#camera-frame { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #170d20; border-radius: 1rem; }
.camera-overlay { display: grid; gap: .45rem; }
.preview { display: grid; gap: .7rem; }
.preview img, .preview video, .preview audio, .preview iframe { width: 100%; max-height: 420px; border-radius: .75rem; background: #180d20; }
.received-item { display: grid; gap: .55rem; padding: .8rem; border-radius: .8rem; background: color-mix(in srgb, white 58%, transparent); }
.received-item img, .received-item video, .received-item audio, .received-item iframe { width: 100%; max-height: 320px; border-radius: .6rem; background: #180d20; }
.site-footer { position: relative; z-index: 1; width: min(920px, calc(100% - 2.5rem)); margin: 0 auto; padding: .75rem 0 1rem; font-size: .85rem; color: color-mix(in srgb, var(--ink) 50%, transparent); }
@media (max-width: 640px) {
  .site-header,
  .hero,
  .site-footer {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 2rem;
  }
  .brand { font-size: clamp(4rem, 18vw, 6rem); }
  .home-actions, .feature-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-column: auto; }
  .transfer-header { align-items: flex-start; flex-direction: column; }
  .header-nav { gap: .55rem; }
}