:root {
  --bg: #07090d;
  --bg-soft: #0d1119;
  --panel: rgba(17, 22, 32, .82);
  --text: #f7f8fb;
  --muted: #9da7b8;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --accent: #ffc107;
  --danger: #ff5c73;
  --shadow: 0 28px 70px rgba(0, 0, 0, .42);
  --radius: 22px;
  --container: 1580px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); scrollbar-gutter: stable; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background: radial-gradient(circle at 84% -10%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 31%), linear-gradient(180deg, #090b10 0%, #07090d 48%, #05070a 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
body.modal-active { position: fixed; right: 0; left: 0; width: 100%; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
.shell { width: min(calc(100% - 36px), var(--container)); margin: 0 auto; }

.hero { position: relative; padding: 66px 0 34px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 34px; align-items: end; }
.brand-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-logo {
  display: inline-flex; align-items: center; justify-content: center; min-width: 210px; height: 58px; padding: 10px 16px;
  overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent); border-radius: 15px;
  background: rgba(255, 255, 255, .035); box-shadow: 0 16px 38px rgba(0, 0, 0, .28); transition: .22s ease;
}
.brand-logo:hover, .brand-site:hover { transform: translateY(-2px); }
.brand-logo img { display: block; width: auto; max-width: 210px; height: auto; max-height: 38px; object-fit: contain; }
.brand-site {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 10px 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent); border-radius: 13px;
  color: color-mix(in srgb, var(--accent) 42%, white); background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 13px; font-weight: 800; transition: .22s ease;
}
.brand-site svg { width: 16px; height: 16px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 13px; border: 1px solid var(--line-strong);
  border-radius: 999px; color: #dce3ec; background: rgba(255, 255, 255, .04); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 11%, transparent), 0 0 22px color-mix(in srgb, var(--accent) 38%, transparent); }
h1 { max-width: 980px; margin: 20px 0 18px; font-size: clamp(42px, 7vw, 92px); line-height: .94; letter-spacing: -.055em; font-weight: 850; }
.hero-copy { max-width: 780px; margin: 0; color: var(--muted); font-size: clamp(16px, 1.5vw, 21px); line-height: 1.65; }
.hero-side { display: grid; gap: 14px; }
.stat-card { min-height: 140px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(140deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)), rgba(15, 20, 29, .72); backdrop-filter: blur(16px); box-shadow: var(--shadow); }
.stat-number { display: block; font-size: clamp(38px, 5vw, 66px); line-height: 1; font-weight: 900; letter-spacing: -.05em; }
.stat-label { display: block; margin-top: 12px; color: var(--muted); font-size: 14px; }

.toolbar-wrap { position: sticky; top: 0; z-index: 40; padding: 12px 0 18px; border-bottom: 1px solid rgba(255, 255, 255, .045); background: #07090d; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: #10151e; box-shadow: 0 12px 30px rgba(0, 0, 0, .20); }
.search-box { position: relative; min-width: 0; }
.search-box svg { position: absolute; top: 50%; left: 17px; width: 20px; height: 20px; transform: translateY(-50%); color: #98a3b4; pointer-events: none; }
.search-box input { width: 100%; height: 52px; padding: 0 18px 0 50px; border: 1px solid transparent; border-radius: 13px; outline: none; color: var(--text); background: #1a202b; transition: .2s ease; }
.search-box input::placeholder { color: #7f8999; }
.search-box input:focus { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: rgba(255, 255, 255, .075); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent); }
.result-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 122px; height: 52px; padding: 0 18px; border: 1px solid var(--line); border-radius: 13px; color: #d7dde7; background: rgba(255, 255, 255, .04); font-size: 14px; font-weight: 750; white-space: nowrap; }

.portfolio { padding: 8px 0 80px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.site-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 26%), var(--panel); box-shadow: 0 16px 42px rgba(0, 0, 0, .22); contain: layout paint style; content-visibility: auto; contain-intrinsic-size: auto 520px; transition: .24s ease; }
.site-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 24%, transparent); box-shadow: 0 28px 75px rgba(0, 0, 0, .38); }
.preview { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--line); background: linear-gradient(125deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent 34%), #0b0f16; isolation: isolate; }
.preview::after { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025); }
.preview-image { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; display: block; object-fit: cover; object-position: top center; background: #0b0f16; }
.preview-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 9px; padding: 48px 24px 24px; text-align: center; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 38%), linear-gradient(145deg, rgba(255,255,255,.025), transparent); }
.preview-placeholder::after { content: ""; position: absolute; inset: 32px 9% 16px; border: 1px solid rgba(255,255,255,.055); border-radius: 13px; box-shadow: 0 22px 50px rgba(0,0,0,.25); }
.browser-dots { position: absolute; z-index: 1; top: 45px; left: 12%; display: flex; gap: 5px; }
.browser-dots span { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.15); }
.preview-brand { z-index: 1; display: grid; place-items: center; width: 62px; height: 62px; border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 18px; color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, #111620); font-size: 26px; font-weight: 900; }
.preview-placeholder strong, .preview-placeholder small { position: relative; z-index: 1; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-placeholder strong { color: #e7ebf2; font-size: 15px; }
.preview-placeholder small { color: #788395; font-size: 11px; }
.card-content { padding: 18px; }
.card-title-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 16px; }
.favicon-wrap { display: grid; place-items: center; width: 42px; height: 42px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .055); }
.favicon-fallback { color: var(--accent); font-size: 16px; font-weight: 900; }
.domain-wrap { min-width: 0; }
.domain { margin: 0; overflow: hidden; color: #f6f8fb; font-size: 16px; font-weight: 800; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.protocol { display: block; margin-top: 5px; color: #798495; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.site-index { min-width: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; color: #8994a5; background: rgba(255, 255, 255, .035); font-size: 11px; font-weight: 850; text-align: center; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-width: 0; min-height: 45px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; color: #e7ebf2; background: rgba(255, 255, 255, .05); font-size: 13px; font-weight: 800; transition: .22s ease; }
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.btn:hover { transform: translateY(-2px); border-color: var(--line-strong); background: rgba(255, 255, 255, .08); }
.btn-primary { border-color: color-mix(in srgb, var(--accent) 38%, transparent); color: #11150b; background: var(--accent); box-shadow: 0 9px 28px color-mix(in srgb, var(--accent) 14%, transparent); }
.btn-primary:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 82%, white); }
.empty-state { display: none; padding: 72px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; background: rgba(255, 255, 255, .025); }
.empty-state.is-visible { display: block; }
.empty-state strong { display: block; margin-bottom: 9px; color: var(--text); font-size: 22px; }
.footer { padding: 0 0 38px; color: #6f798a; font-size: 12px; text-align: center; }

.modal { position: fixed; inset: 0; z-index: 9999; display: none; overflow: hidden; background: #05070a; }
.modal.is-open { display: block; }
.modal-panel, .modal-frame-wrap { position: relative; width: 100%; height: 100%; overflow: hidden; background: #fff; }
.modal-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 40; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid rgba(255, 92, 115, .40); border-radius: 14px; color: #ffdfe4; background: rgba(36, 25, 33, .94); box-shadow: 0 10px 30px rgba(0, 0, 0, .30); }
.modal-close svg { width: 22px; height: 22px; }
.modal-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.modal-loading { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 84px 24px 24px; color: #aeb7c5; background: #0c1118; font-size: 14px; text-align: center; transition: opacity .25s ease, visibility .25s ease; }
.modal-loading.is-hidden { opacity: 0; visibility: hidden; }

@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 800px) {
  .shell { width: min(calc(100% - 24px), var(--container)); }
  .hero { padding: 42px 0 24px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 112px; padding: 19px; }
  .toolbar-wrap { padding: 6px 0 10px; }
  .toolbar { gap: 8px; padding: 8px; border-radius: 15px; }
  .search-box svg { left: 13px; width: 18px; height: 18px; }
  .search-box input { height: 44px; padding: 0 12px 0 40px; border-radius: 11px; font-size: 13px; }
  .result-chip { min-width: 76px; height: 44px; padding: 0 11px; font-size: 12px; }
  .grid { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 520px) {
  h1 { font-size: clamp(40px, 15vw, 60px); }
  .hero-side { grid-template-columns: 1fr; }
  .brand-strip { align-items: stretch; }
  .brand-logo, .brand-site { width: 100%; }
  .brand-logo { min-width: 0; }
  .toolbar { gap: 6px; padding: 6px; }
  .search-box input { height: 42px; padding-left: 37px; font-size: 12px; }
  .result-chip { min-width: 68px; height: 42px; padding: 0 9px; font-size: 11px; }
  .card-content { padding: 15px; }
  .card-actions { grid-template-columns: 1fr; }
  .modal-close { width: 43px; height: 43px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
