/* frename.com — the app's own look: near-black, soft text, pastel tag chips. */
:root {
  --bg: #1b1c1e;
  --bg2: #232427;
  --line: #34363a;
  --text: #e6e6e3;
  --muted: #a3a5a8;
  --accent: #7ec8f2;
  --btn: #f2d16b;
  --btn-ink: #1b1c1e;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 650; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code, kbd { font-family: var(--mono); font-size: .88em; }
code { background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; padding: .05em .35em; overflow-wrap: anywhere; }
kbd { display: inline-block; background: #2d2f33; border: 1px solid #45474c; border-bottom-width: 2px; border-radius: 4px; padding: 0 .4em; line-height: 1.5; white-space: nowrap; }
.mono { font-family: var(--mono); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.center { text-align: center; }
section { padding: 72px 0; }
section.band { background: var(--bg2); border-block: 1px solid var(--line); }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: rgba(27, 28, 30, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top nav { display: flex; align-items: center; gap: 20px; height: 52px; }
.top a { color: var(--muted); font-size: .95rem; }
.top a[aria-current], .top a:hover { color: var(--text); text-decoration: none; }
.top a.brand { font-family: var(--mono); font-weight: 700; color: var(--text); font-size: 1.05rem; }
.top .grow { flex: 1; }
.top .dl-mini { color: var(--btn-ink); background: var(--btn); border-radius: 6px; padding: 3px 12px; font-weight: 600; }
.top .dl-mini:hover { color: var(--btn-ink); filter: brightness(1.08); }
.top .lang { font-family: var(--mono); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }

/* buttons */
.btn { display: inline-block; background: var(--btn); color: var(--btn-ink); font-weight: 650; border-radius: 8px; padding: 12px 22px; margin: 0 10px 10px 0; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--muted); }

/* hero text */
.app { display: flex; align-items: center; gap: 12px; font-size: 1.6rem; font-weight: 700; margin-bottom: 18px; }
.app img { width: 56px; height: 56px; }
.sub { color: var(--muted); font-size: 1.1rem; }
.fine { color: var(--muted); font-size: .9rem; }
.cta { margin-top: 24px; }

.chip { display: inline-block; color: #16171a; font-size: .85rem; font-weight: 600; border-radius: 4px; padding: 1px 8px; }
.c-green { background: #9be3a0; } .c-yellow { background: #f2d16b; } .c-orange { background: #f0b77a; }
.c-blue { background: #8fc6f5; } .c-pink { background: #f2a7c3; } .c-purple { background: #c9a6f2; }
.c-white { background: #e6e6e3; }


/* features */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 32px; }
.features > div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; }
.features p { color: var(--muted); margin: 0; font-size: .97rem; }
.opt { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; vertical-align: 2px; margin-left: 4px; }

/* screenshots */
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 32px; }
.shots figure { margin: 0; }
.shots img { border: 1px solid var(--line); border-radius: 8px; }
.shots figcaption { color: var(--muted); font-size: .93rem; margin-top: 10px; }

.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
.two p { color: var(--muted); }

/* guide and privacy */
.doc-wrap { max-width: 1180px; margin: 0 auto; padding: 40px 16px 72px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; }
.doc-wrap.single { grid-template-columns: minmax(0, 820px); justify-content: center; }
.toc { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 90px); overflow: auto; font-size: .92rem; }
.toc-h { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; margin-bottom: 8px; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0 0 6px; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--text); }
.doc { min-width: 0; max-width: 820px; }
.doc h1 { font-size: 2.2rem; }
.doc .lead { color: var(--muted); font-size: 1.1rem; }
.doc h2 { margin-top: 2em; padding-top: .4em; border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.doc h3 { margin-top: 1.6em; scroll-margin-top: 70px; }
.doc li { margin-bottom: .45em; }
.doc hr { display: none; }
.doc img { border: 1px solid var(--line); border-radius: 8px; margin: 1em 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: .95rem; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doc th { color: var(--muted); font-weight: 600; }
.doc td:first-child { white-space: nowrap; }
.doc pre { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 12px; overflow-x: auto; }
.doc pre code { border: 0; padding: 0; background: none; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 28px 0 36px; color: var(--muted); font-size: .9rem; }
.foot p { margin: 0 0 4px; }

.notfound { text-align: center; padding: 120px 16px; }

@media (max-width: 900px) {
  .two { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .shots { grid-template-columns: minmax(0, 1fr); }
  .doc-wrap { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
  .doc td:first-child { white-space: normal; }
  section { padding: 52px 0; }
}
@media (max-width: 520px) {
  .top nav { gap: 12px; }
  .top nav a[href="/privacy/"] { display: none; }
  .btn { display: block; text-align: center; margin-right: 0; }
}

/* ---- the landing page as a clip (js/site.js) ---- */
html:not(.js) .js-only { display: none !important; }
.intro { padding: 48px 0 64px; }
.intro-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: center; }
.intro h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); letter-spacing: -.01em; }
.intro .sub { color: var(--muted); font-size: 1.12rem; }
.intro .app { display: flex; align-items: center; gap: 14px; font-size: 1.4rem; font-weight: 700; }
.gate-hint { display: none; text-align: center; color: var(--muted); font-size: 1.1rem; margin-bottom: 18px; }
.skip { display: none; text-align: center; margin-top: 14px; }
.skip button, button.inline { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.skip button { color: var(--muted); font-size: .9rem; }
.skip button:hover, button.inline:hover { text-decoration: underline; }

/* gate: only the folder window and its button until Prepare with AI runs */
.gate .intro-text, .gate .clip, .gate .foot, .gate .player { display: none; }
.gate .intro { min-height: calc(100vh - 53px); display: grid; align-items: center; }
.gate .intro-grid { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.gate .win { width: min(640px, 100%); }
.gate .gate-hint, .gate .skip { display: block; }
.ready .intro-text, .ready .clip { animation: rise .6s both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ready .intro-text, .ready .clip { animation: none; } }

/* the folder window */
.win-frame { background: #1f2023; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.win-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.win-head .mono { color: var(--muted); flex: 1; }
.prep { background: var(--btn); color: var(--btn-ink); border: 0; border-radius: 6px; padding: 7px 14px; font: 650 .95rem var(--sans); cursor: pointer; }
.prep:hover:not(:disabled) { filter: brightness(1.08); }
.prep:disabled { background: #2d2f33; color: var(--muted); cursor: default; }
.gate .prep:not(:disabled) { animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(242, 209, 107, .18); } }
.win-est { margin: 0; padding: 6px 12px; font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.files { list-style: none; margin: 0; padding: 6px 0; }
.files .name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.files .name .mono { color: var(--text); overflow-wrap: anywhere; }
.files .row-tags { display: contents; }
.files .row-tags .chip { font-size: .74rem; padding: 0 6px; animation: pop .35s both; }
.files li.renamed .name .mono { color: #c9cacc; }
.files .dotsep { color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .files .row-tags .chip { animation: none; } }
.files li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; padding: 5px 12px; font-size: .9rem; border-left: 2px solid transparent; }
.files .ai-line { grid-column: 2; color: var(--muted); font-size: .8rem; max-height: 0; overflow: hidden; transition: max-height .3s; }
html:not(.js) .files .ai-line, .files li.done .ai-line { max-height: 3em; }
.ready .files li { cursor: pointer; }
.ready .files li:hover { background: #26282c; border-left-color: var(--accent); }
.badges { display: flex; gap: 4px; }
.b { font: 600 .66rem/1 var(--mono); min-width: 24px; text-align: center; padding: 3px 4px; border-radius: 4px; border: 1px solid var(--line); color: #5c5f64; }
html:not(.js) .b, .b.done { color: #16171a; background: #9be3a0; border-color: #9be3a0; }
.b.running { color: var(--btn-ink); background: var(--btn); border-color: var(--btn); animation: blink .3s infinite alternate; }
@keyframes blink { to { opacity: .55; } }

/* chapters */
.ch { scroll-margin-top: 60px; }
.ch .subs { display: none; }
.ch-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 48px; align-items: center; }
.ch-grid p { color: var(--muted); }
.ch-grid b { color: var(--text); }
.kicker { color: var(--accent); font-size: .82rem; letter-spacing: .04em; margin-bottom: .5em; }
.shot { margin: 0; }
.shot img { border: 1px solid var(--line); border-radius: 8px; max-height: 560px; width: auto; margin: 0 auto; }
.shot figcaption, .gallery figcaption { color: var(--muted); font-size: .9rem; margin-top: 8px; text-align: center; }
.gallery { display: grid; grid-template-columns: 954fr 500fr 500fr; gap: 20px; margin-top: 40px; align-items: start; }
.gallery figure { margin: 0; }
.gallery img { border: 1px solid var(--line); border-radius: 8px; width: 100%; }
.js .shot a[href^="/img/"], .js .gallery a[href^="/img/"] { cursor: zoom-in; }
.lightbox { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible; cursor: zoom-out; }
.lightbox::backdrop { background: rgba(0, 0, 0, .85); }
.lightbox img { display: block; max-width: 96vw; max-height: 96vh; width: auto; height: auto; border-radius: 6px; }
.btn.small { padding: 6px 12px; font-size: .9rem; cursor: pointer; font-family: var(--sans); margin: 4px 6px 4px 0; }
.dl-subs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.try { border: 1px dashed var(--line); border-radius: 10px; padding: 14px 16px; }
.try p { margin: 0; }

/* app-like mocks */
.tagger, .comment-box, .inout-demo { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: .92rem; }
.io-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 10px; }
.io { border: 1px solid var(--line); border-radius: 5px; padding: 3px 10px; font-size: .9rem; }
.sugg { color: var(--muted); font-size: .88rem; }
.apply { background: #2563eb; color: #fff; border: 0; border-radius: 5px; padding: 5px 12px; font: 600 .9rem var(--sans); cursor: pointer; }
.apply:hover { filter: brightness(1.12); }
.inout-demo { margin-top: 14px; }

.rename-to { font-size: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-height: 2em; margin: 0 0 12px; }
.rename-to .dotsep { color: var(--muted); }
.tag-find input, .comment-box textarea { width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font: inherit; }
.tag-find input:focus, .comment-box textarea:focus { outline: 2px solid #3a5378; outline-offset: 0; }
.tag-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag { border: 0; border-radius: 5px; padding: 4px 10px 4px 26px; font: 600 .9rem var(--sans); color: #16171a; cursor: pointer; position: relative; opacity: .8; }
.tag::before { content: ""; position: absolute; left: 8px; top: 50%; width: 11px; height: 11px; margin-top: -7px; border: 1.5px solid rgba(22, 23, 26, .55); border-radius: 3px; background: rgba(255, 255, 255, .35); }
.tag.on, .tag:hover { opacity: 1; }
.tag.on::before { background: #16171a; content: "✓"; color: #fff; font-size: 9px; line-height: 11px; text-align: center; }
.comment-box label { display: block; color: var(--muted); font-size: .8rem; margin-bottom: 6px; }
.comment-box textarea { resize: vertical; min-height: 110px; }
.comment-box .fine { margin: 8px 0 0; }

/* the player bar: the app's timeline and controls */
.ready main { padding-bottom: 124px; }
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: rgba(23, 24, 26, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 4px 16px 4px; }
html:not(.ready) .player { display: none; }
.p-sub { text-align: center; margin: 0 auto 2px; max-width: 900px; min-height: 1.6em; font-size: .98rem; text-shadow: 0 1px 2px #000; }
.p-line { position: relative; height: 40px; cursor: pointer; max-width: 1180px; margin: 0 auto; }
.p-track { position: absolute; left: 0; right: 0; top: 30px; height: 5px; background: #3a3c40; border-radius: 3px; overflow: hidden; }
.p-played { height: 100%; width: 0; background: #2f6fe4; }
.p-inout { position: absolute; top: 29px; height: 3px; background: var(--btn); pointer-events: none; }
.p-inout::before, .p-inout::after { content: ""; position: absolute; top: 0; width: 2px; height: 8px; background: var(--btn); }
.p-inout::before { left: 0; } .p-inout::after { right: 0; }
.p-inout[hidden] { display: none; }
.p-ranges { position: absolute; inset: 0; }
.p-range { position: absolute; top: 22px; height: 7px; border: 0; padding: 0; background: none; cursor: pointer; }
.p-range::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 3px; border-radius: 2px; background: rgba(230, 230, 227, .42); }
.p-range:hover::after { background: rgba(230, 230, 227, .7); }
.p-range.on::after { background: #e6e6e3; }
.p-marks { position: absolute; inset: 0; pointer-events: none; }
.p-mark { position: absolute; top: 20px; width: 12px; height: 18px; margin-left: -6px; border: 0; padding: 0; background: none; cursor: pointer; pointer-events: auto; }
.p-mark::before { content: ""; position: absolute; left: 5px; top: 4px; width: 2px; height: 13px; background: var(--c); }
.p-mark::after { content: ""; position: absolute; left: 3px; top: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.p-mark.range { margin-left: 0; height: 8px; top: 21px; }
.p-mark.range::before { left: 0; right: 0; top: 2px; width: auto; height: 3px; border-radius: 2px; }
.p-mark.range::after { display: none; }
.p-label { position: absolute; top: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1.5px solid var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 18%, #17181a); border-radius: 999px; padding: 0 9px; font: .76rem/17px var(--sans); cursor: pointer; }
.p-label[hidden] { display: none; }
.p-label .ai { margin-right: 4px; font-size: .7rem; }
.p-label .pen { opacity: .7; }
.p-head { position: absolute; top: 25px; width: 2px; height: 14px; margin-left: -1px; background: #fff; border-radius: 1px; pointer-events: none; }
.p-ctl { display: flex; align-items: center; gap: 2px; max-width: 1180px; margin: 0 auto; }
.p-ctl .sep { width: 14px; }
.p-file { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; margin-left: 12px; }
.p-time { color: var(--muted); font-size: .8rem; white-space: nowrap; margin-right: 8px; }
.p-ctl .grow { flex: 1; }
.p-ctl button { display: inline-grid; place-items: center; background: none; border: 0; color: #c9cacc; border-radius: 6px; width: 32px; height: 32px; padding: 0; cursor: pointer; }
.p-ctl button.txt { font: 600 1rem var(--mono); }
.p-ctl button:hover { background: #2d2f33; color: var(--text); }
.p-ctl button.on { background: #23324a; color: #a9c8ff; }
.p-ctl svg, .p-tabs svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.p-tabs svg { width: 14px; height: 14px; vertical-align: -2px; }
#play .i-pause { display: none; }
#play.on .i-pause { display: inline; }
#play.on .i-play { display: none; }

.p-panel { position: absolute; right: 16px; bottom: 100%; margin-bottom: 8px; width: min(420px, calc(100vw - 32px)); max-height: min(56vh, 460px); display: flex; flex-direction: column; background: #1f2023; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.p-panel[hidden] { display: none; }
.p-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.p-tabs button { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 2px 10px; font: .85rem var(--sans); cursor: pointer; }
.p-tabs button[aria-selected="true"] { background: #23324a; border-color: #3a5378; color: var(--text); }
.p-tabs .p-x { margin-left: auto; border: 0; }
.p-list { list-style: none; margin: 0; padding: 6px; overflow: auto; font-size: .9rem; }
.p-list li { border-radius: 6px; }
.s-row { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); gap: 8px; padding: 5px 8px; cursor: pointer; }
.s-row:hover { background: #26282c; }
.s-row.on { background: #23324a; }
.s-row .t, .m-row .t { color: var(--muted); font-size: .78rem; }
.m-row { display: grid; grid-template-columns: 14px auto minmax(0, 1fr) auto auto; gap: 8px; align-items: start; padding: 6px 8px; }
.m-row .dot { border: 0; padding: 0; margin-top: 5px; cursor: pointer; }
.m-row .t { background: none; border: 0; padding: 2px 0 0; cursor: pointer; font-family: var(--mono); }
.m-name { width: 100%; background: transparent; border: 1px solid transparent; border-radius: 4px; color: var(--text); font: inherit; padding: 0 4px; }
.m-name:hover, .m-name:focus { border-color: var(--line); background: var(--bg2); outline: 0; }
.m-comment { display: block; color: var(--muted); font-size: .83rem; padding: 0 4px; }
.m-comment.ai:not(:empty)::before { content: "✨ "; }
.m-ai, .m-del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .9rem; padding: 0 2px; }
.m-ai:hover, .m-del:hover { color: var(--text); }
.p-list .empty { color: var(--muted); padding: 10px; }

@media (max-width: 900px) {
  .intro-grid, .ch-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .gallery { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .gallery figure:first-child { grid-column: 1 / -1; }
  }
@media (max-width: 520px) {
  .p-file, .p-ctl .sep, .p-ctl [data-act="back"], .p-ctl [data-act="fwd"] { display: none; }
  .p-ctl button { width: 28px; }
  .p-sub { font-size: .9rem; }
}
