:root {
  color-scheme: light;
  --page: #f5f4f1;
  --surface: #fcfcfb;
  --line: #e6e4df;
  --grid: #eeede9;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #7a7974;
  --accent: #184f95;
  --accent-2: #eb6834;
  --accent-soft: #e5edf8;
  --danger: #b3261e;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #121211;
    --surface: #1a1a19;
    --line: #2e2e2b;
    --grid: #262624;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --muted: #93928a;
    --accent: #86b6ef;
    --accent-2: #d95926;
    --accent-soft: #1d2a3b;
    --danger: #f2b8b5;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #121211;
  --surface: #1a1a19;
  --line: #2e2e2b;
  --grid: #262624;
  --text: #ffffff;
  --text-2: #c3c2b7;
  --muted: #93928a;
  --accent: #86b6ef;
  --accent-2: #d95926;
  --accent-soft: #1d2a3b;
  --danger: #f2b8b5;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.shell { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ masthead */
.masthead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.logo { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: var(--surface); }
.kicker { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 650; }
.who { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--text-2); }

.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 20px; background: var(--surface); }
.tabs button { font: inherit; font-size: 14px; padding: 8px 18px; border: 0; cursor: pointer; background: transparent; color: var(--text-2); }
.tabs button[aria-selected="true"] { background: var(--text); color: var(--surface); }

/* --------------------------------------------------------------- cards */
.state { color: var(--text-2); padding: 32px 0; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; min-width: 0;
}
.card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 650; }
.lede { margin: 0 0 16px; color: var(--text-2); font-size: 14px; max-width: 64ch; }
.stack { display: grid; gap: 16px; }
.narrow { max-width: 460px; }
.doors { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.hero {
  padding: 28px 24px; border-radius: var(--radius); margin-bottom: 20px;
  background: linear-gradient(135deg, var(--accent) 0%, #2a78d6 55%, var(--accent-2) 130%);
  color: #fff;
}
.hero h2 { margin: 0 0 6px; font-size: 26px; font-weight: 700; }
.hero p { margin: 0; opacity: .9; max-width: 60ch; }

/* ---------------------------------------------------------------- form */
label.field { display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--page); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.row > .btn { flex: 0 0 auto; }
.btn {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: 8px; padding: 9px 16px;
  background: var(--accent); color: var(--surface); display: inline-flex; gap: 8px; align-items: center; justify-content: center;
}
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--line); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.google { background: var(--surface); color: var(--text); border-color: var(--line); width: 100%; padding: 11px; }
.link { font: inherit; font-size: 13px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
.err { color: var(--danger); font-size: 13px; margin: 0; min-height: 1em; }
.hint { color: var(--muted); font-size: 12px; margin: 0; }
.members { display: grid; gap: 8px; }
.code { font: 600 18px/1 ui-monospace, Consolas, monospace; letter-spacing: .12em; background: var(--accent-soft); color: var(--accent); padding: 6px 10px; border-radius: 6px; }

/* ------------------------------------------------------------- uploads */
.drop {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center;
  color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.progress { height: 6px; background: var(--grid); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.assets { display: grid; gap: 8px; }
.asset {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--page);
}
.asset a { color: var(--text); text-decoration: none; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.asset small { color: var(--muted); }
.badge {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
}
.badge.video { background: #fde8df; color: #a3401a; }
.badge.poster { background: #e6f4ea; color: #1e6b34; }
.badge.website { background: var(--accent-soft); color: var(--accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge.video { background: #3a2118; color: #f3a283; }
  :root:not([data-theme="light"]) .badge.poster { background: #1b3222; color: #8fd3a2; }
}

/* ------------------------------------------------------------- gallery */
.search { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.search input { max-width: 420px; background: var(--surface); }
.search .hint { white-space: nowrap; }
.gallery { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.team {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; text-align: left; font: inherit; color: inherit; padding: 0;
  display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s;
}
.team:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.cover {
  aspect-ratio: 16 / 9; background: var(--grid) center / cover no-repeat;
  display: grid; place-items: center; color: #fff; font-size: 34px; font-weight: 700;
}
.team .body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.team h3 { margin: 0; font-size: 16px; }
.team p { margin: 0; font-size: 13px; color: var(--text-2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

dialog {
  border: 0; border-radius: var(--radius); padding: 0; width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 48px); background: var(--surface); color: var(--text);
}
dialog::backdrop { background: rgba(0,0,0,.55); }
.modal-head { display: flex; align-items: start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-head p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.modal-head .btn { margin-left: auto; }
.modal-body { padding: 20px; display: grid; gap: 20px; }
.work h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.work video, .work img { width: 100%; max-height: 70vh; border-radius: 10px; background: #000; display: block; object-fit: contain; }
.work-tabs { margin: 16px 20px 0; display: flex; width: fit-content; max-width: calc(100% - 40px); overflow-x: auto; }
.work-tabs button { white-space: nowrap; }
.work-tabs .count { margin-left: 6px; font-size: 12px; opacity: .65; }
.work-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 8px; }
.work-head h4 { margin: 0 0 2px; }
.work-head small { display: block; overflow-wrap: anywhere; }
.frame { position: relative; width: 100%; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; display: block; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.frame.site { aspect-ratio: 16 / 10; }
.frame.video { aspect-ratio: 16 / 9; background: #000; }
.frame.doc { height: 75vh; }
.frame.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; max-height: none; border-radius: 0; background: var(--grid); }
.work + .work { padding-top: 20px; border-top: 1px solid var(--line); }
.work .open { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30;
  background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 8px; font-size: 14px;
}

@media (max-width: 560px) {
  h1 { font-size: 20px; }
  .who { margin-left: 0; width: 100%; }
  .hero h2 { font-size: 22px; }
  .asset { grid-template-columns: 1fr auto; }
  .asset .badge { grid-column: 1 / -1; justify-self: start; }
}
