:root {
  --navy: #16384f;
  --navy-2: #1f4a66;
  --amber: #f5a91c;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #1d2329;
  --muted: #667180;
  --line: #e3e7ec;
  --chip: #eef1f5;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 12px;
  --primary: #16384f;
  --primary-hover: #1f4a66;
  --on-primary: #ffffff;
  --accent-text: #b26b00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1419;
    --surface: #171e25;
    --ink: #e9edf1;
    --muted: #9aa6b2;
    --line: #26313b;
    --chip: #222c36;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --primary: #f5a91c;
    --primary-hover: #ffbc3d;
    --on-primary: #1d2329;
    --accent-text: #f5a91c;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1419; --surface: #171e25; --ink: #e9edf1; --muted: #9aa6b2; --line: #26313b; --chip: #222c36;
  --primary: #f5a91c; --primary-hover: #ffbc3d; --on-primary: #1d2329; --accent-text: #f5a91c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Poppins", system-ui, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.2; font-weight: 600; }

/* ---------- buttons, tags ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary); color: var(--on-primary); font-weight: 500; font-size: 14px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--primary);
  transition: background .2s, transform .2s;
}
.btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--chip); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { background: var(--chip); color: var(--ink); font-size: 12.5px; padding: 4px 10px; border-radius: 999px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--navy); color: var(--amber); font-weight: 700; font-size: 14px;
}
.topbar nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.topbar nav a:not(.btn):hover { color: var(--amber); }

/* ---------- index ---------- */
.banner {
  height: 200px;
  background:
    radial-gradient(circle at 85% 20%, rgba(245,169,28,.35), transparent 40%),
    linear-gradient(120deg, #0e2a3c, var(--navy) 55%, #24597a);
}
.layout {
  max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: 300px 1fr; gap: 32px;
  padding: 0 clamp(16px, 4vw, 40px) 64px;
}
.profile {
  margin-top: -90px; align-self: start; position: sticky; top: 80px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
  padding: 28px 24px; text-align: center;
}
.avatar { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 14px; border: 4px solid var(--amber); object-fit: cover; }
.profile h1 { font-size: 24px; }
.role { color: var(--muted); margin-top: 4px; }
.loc { display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--muted); font-size: 13px; margin-top: 6px; }
.loc svg { width: 14px; height: 14px; fill: var(--amber); }
.profile-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 18px 0; }
.stats { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); padding: 14px 0; margin-bottom: 18px; }
.stats dt { font-size: 11.5px; color: var(--muted); }
.stats dd { font-size: 20px; font-weight: 600; }
.profile h2 { font-size: 14px; text-align: left; margin: 16px 0 8px; }
.bio { text-align: left; color: var(--muted); font-size: 13.5px; }
.profile .tags { justify-content: flex-start; }

main { padding-top: 24px; min-width: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.filters button {
  font: inherit; font-size: 14px; cursor: pointer;
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
}
.filters button.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.card[hidden] { display: none; }
.thumb { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--chip); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .thumb img { transform: scale(1.04); }
.card-body { padding: 10px 2px 0; }
.card-body h3 { font-size: 15.5px; }
.card-body p { font-size: 13.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.card-body span { display: block; font-size: 12px; color: var(--accent-text); font-weight: 500; margin-top: 4px; }

/* ---------- project ---------- */
.project { max-width: 1240px; margin: 0 auto; padding: 48px clamp(16px, 4vw, 40px) 24px; }
.p-head { max-width: 1000px; margin: 0 auto 40px; }
.owner { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.owner:hover { color: var(--accent-text); }
.owner img { width: 40px; height: 40px; border-radius: 50%; }
.p-head h1 { font-size: clamp(30px, 5vw, 48px); font-weight: 700; color: var(--ink); }
.p-sub { font-size: 18px; color: var(--muted); margin-top: 6px; }
.p-meta { color: var(--accent-text); font-weight: 500; font-size: 14px; margin-top: 8px; }
.p-intro { display: grid; grid-template-columns: 1fr 280px; gap: 40px; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.p-desc p + p { margin-top: 12px; }
.p-side h2 { font-size: 14px; margin-bottom: 10px; }
.p-side .btn { margin-top: 20px; }

.p-blocks { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.p-blocks .full { grid-column: span 6; }
.p-blocks .half { grid-column: span 3; }
.p-blocks .third { grid-column: span 2; }
.b-img img { width: 100%; border-radius: var(--radius); background: var(--surface); }
.b-browser { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.b-browser .bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: var(--chip); }
.b-browser .bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.b-browser .bar i:nth-child(2) { background: #febc2e; }
.b-browser .bar i:nth-child(3) { background: #28c840; }
.b-browser .bar span { margin-left: 10px; font-size: 12.5px; color: var(--muted); background: var(--surface); padding: 2px 14px; border-radius: 999px; flex: 1; max-width: 360px; }
.b-browser img { width: 100%; }
.b-phones { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; padding: 36px 20px; background: var(--surface); border-radius: var(--radius); }
.b-phones img { width: min(240px, 42vw); border-radius: 30px; border: 8px solid #111; box-shadow: var(--shadow); }
.b-phones.single img { width: min(300px, 70vw); }
.b-phones.bare { background: transparent; padding: 0; }
.b-phones.bare img { border: 0; border-radius: 0; box-shadow: none; width: min(220px, 42vw); }
.b-list { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.b-list h2 { font-size: 18px; margin-bottom: 12px; }
.b-list ul { padding-left: 18px; color: var(--muted); }
.b-list li { margin-bottom: 6px; }
.b-list li::marker { color: var(--amber); }

.p-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 48px; }
.p-nav a { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; font-weight: 600; transition: border-color .2s; }
.p-nav a:last-child { text-align: right; }
.p-nav a:hover { border-color: var(--amber); }
.p-nav small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.more { max-width: 1240px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 64px; }
.more h2 { font-size: 20px; margin-bottom: 18px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 24px clamp(16px, 4vw, 40px); text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .profile { position: static; margin-top: -80px; }
  .p-intro { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 640px) {
  .banner { height: 140px; }
  .topbar nav a:not(.btn) { display: none; }
  .brand span:last-child { font-size: 14px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .card-body p { display: none; }
  .p-blocks { gap: 12px; }
  .p-blocks .half, .p-blocks .third { grid-column: span 6; }
  .b-phones { gap: 14px; padding: 20px 10px; }
  .b-phones img { width: calc(50% - 7px); border-width: 5px; border-radius: 20px; }
  .p-nav { grid-template-columns: 1fr; }
  .p-nav a:last-child { text-align: left; }
}
@media (max-width: 380px) { .grid { grid-template-columns: 1fr; } }
