/* ---------- Theme ---------- */
:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e1e4e9;
  --text: #1c2027;
  --muted: #646c78;
  --accent: #3f6ea3;
  --accent-soft: #e5edf6;
  --on-accent: #ffffff;
  --ok: #3e8e6a;
  --warn: #a87a2e;
  --phone: #1b1e24;
  --shadow: 0 1px 2px rgba(20, 24, 32, .05), 0 6px 20px rgba(20, 24, 32, .05);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151a; --surface: #1a1e25; --surface-2: #222731; --border: #2a303b;
    --text: #e2e5ea; --muted: #9199a6; --accent: #86a9d2; --accent-soft: #232d3b; --on-accent: #10151c;
    --ok: #74b896; --warn: #d2ad6a; --phone: #0b0d10; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151a; --surface: #1a1e25; --surface-2: #222731; --border: #2a303b;
  --text: #e2e5ea; --muted: #9199a6; --accent: #86a9d2; --accent-soft: #232d3b; --on-accent: #10151c;
  --ok: #74b896; --warn: #d2ad6a; --phone: #0b0d10; --shadow: none; color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 "Inter", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.link { font-size: 14px; font-weight: 500; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-title { font-size: 14px; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 13px; padding: 4px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid var(--border);
  font: 600 14px/1 inherit; font-family: inherit; color: var(--text); background: var(--surface); cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }

.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px; padding: 22px 14px;
  background: var(--surface); border-right: 1px solid var(--border);
}
.main { flex: 1; min-width: 0; padding: 0 28px 28px; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); padding: 0 8px 18px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.brand small { display: block; color: var(--muted); font-size: 12px; }

.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }

.side-label { margin: 18px 12px 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.side-apps { list-style: none; margin: 0; padding: 0; }
.side-apps button { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 10px; font-size: 14px; cursor: pointer; }
.side-apps button:hover, .side-apps button.active { background: var(--surface-2); }
.side-apps img, .side-apps .tile { width: 26px; height: 26px; border-radius: 7px; }

.side-cta { margin-top: auto; padding: 16px; border-radius: 14px; background: var(--surface-2); text-align: center; font-size: 13px; color: var(--muted); }
.side-cta strong { color: var(--text); font-size: 14px; }
.side-cta p { margin-bottom: 12px; }
.side-social { display: flex; justify-content: center; gap: 16px; padding-top: 14px; }
.side-social a { color: var(--muted); }
.side-social a:hover { color: var(--text); }

.topbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 18px 0; }
.menu-btn { display: none; margin-right: auto; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
#themeBtn .moon { display: none; }
:root[data-theme="dark"] #themeBtn .sun { display: none; }
:root[data-theme="dark"] #themeBtn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #themeBtn .sun { display: none; }
  :root:not([data-theme="light"]) #themeBtn .moon { display: block; }
}

/* ---------- Workstation (home) ---------- */
.workstation { display: grid; grid-template-columns: minmax(0, 1.15fr) auto minmax(0, 1fr); gap: 24px; align-items: start; scroll-margin-top: 20px; }
.col-left, .col-right { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.intro { display: flex; gap: 20px; align-items: center; }
.avatar {
  position: relative; width: 96px; height: 96px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border);
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar .dot { position: absolute; right: 6px; bottom: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--ok); border: 3px solid var(--surface); }
.intro h1 { font-size: 28px; }
.intro .muted { margin: 0; }
.role { color: var(--accent); font-weight: 500; margin: 2px 0 10px; }
.lead { color: var(--muted); margin: 0; }

.featured { display: flex; gap: 18px; align-items: center; }
.featured img { width: 76px; height: 76px; border-radius: 18px; }
.featured .label { font-size: 12px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.featured h3 { font-size: 19px; margin-bottom: 4px; }
.featured p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: -4px; }
.section-head h2 { font-size: 19px; }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.app-tile {
  all: unset; box-sizing: border-box; cursor: pointer; text-align: center; padding: 14px 8px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; line-height: 1.3;
}
.app-tile:hover { background: var(--surface-2); }
.app-tile.active { border-color: var(--accent); }
.app-tile img, .app-tile .tile { width: 52px; height: 52px; border-radius: 13px; margin: 0 auto 8px; }
.app-tile small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

.tile { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 18px; }

/* Phone emulator */
.col-phone { position: sticky; top: 16px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.phone {
  position: relative; width: 300px; padding: 34px 10px; border-radius: 40px;
  background: var(--phone); border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
}
.phone-notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 64px; height: 7px; border-radius: 9px; background: #2a2e36; }
.phone-screen { position: relative; width: 100%; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; background: #0f1114; }
/* landscape screenshots: phone turns sideways and takes a wider spot */
.landscape .col-phone { position: static; width: 100%; }
.landscape .phone { width: min(620px, 100%); padding: 10px 34px; }
.landscape .phone-screen { aspect-ratio: 16 / 9; }
.landscape .phone-notch { top: 50%; left: 14px; transform: translateY(-50%); width: 7px; height: 64px; }
.slides { display: flex; height: 100%; transition: transform .45s ease; touch-action: pan-y; }
.slides img { width: 100%; height: 100%; flex: none; object-fit: contain; background: #0f1114; user-select: none; -webkit-user-drag: none; }
.slide-empty { width: 100%; height: 100%; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #c9ced6; text-align: center; padding: 24px; }
.slide-empty img, .slide-empty .tile { width: 88px; height: 88px; border-radius: 22px; object-fit: cover; font-size: 30px; }
.slide-empty p { color: #8e96a3; font-size: 13px; margin: 0; }
.slide-btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; border: 0; background: rgba(0, 0, 0, .45); color: #fff; cursor: pointer; opacity: 0; transition: opacity .2s;
}
.slide-btn.prev { left: 8px; } .slide-btn.next { right: 8px; }
.phone:hover .slide-btn { opacity: 1; }
.slide-btn[hidden] { display: none; }
.dots { display: flex; gap: 6px; min-height: 8px; }
.dots button { width: 8px; height: 8px; padding: 0; border-radius: 99px; border: 0; background: var(--border); cursor: pointer; transition: width .2s; }
.dots button.active { width: 22px; background: var(--accent); }

/* Details panel */
.details-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.details-head img, .details-head .tile { width: 72px; height: 72px; border-radius: 18px; flex: none; font-size: 26px; }
.details-head h3 { font-size: 20px; }
.details-head p { color: var(--muted); margin: 2px 0 0; font-size: 14px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.badge.play { color: var(--ok); }
.badge.soon, .badge.upcoming { color: var(--warn); }
.details .desc { color: var(--muted); margin: 12px 0 14px; }
.features { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.features li { display: flex; gap: 10px; align-items: flex-start; }
.features svg { width: 18px; height: 18px; color: var(--ok); margin-top: 2px; }
.actions { display: grid; gap: 10px; }
.meta { font-size: 12px; color: var(--muted); margin-top: 14px; word-break: break-all; }

/* ---------- Sections ---------- */
.section { margin-top: 56px; scroll-margin-top: 20px; }
.section > h2 + .muted { margin-top: 4px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.tabs button { padding: 8px 16px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 500 14px inherit; font-family: inherit; cursor: pointer; }
.tabs button.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.p-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.p-card:hover { background: var(--surface-2); }
.p-card img, .p-card .tile { width: 56px; height: 56px; border-radius: 14px; flex: none; }
.p-card h3 { font-size: 15px; margin-bottom: 2px; }
.p-card p { font-size: 13px; color: var(--muted); margin: 0 0 6px; }

.about { display: flex; gap: 28px; align-items: flex-start; }
.avatar-lg { width: 140px; height: 140px; border-radius: 28px; font-size: 42px; }
.avatar-lg img { border-radius: 28px; }
.about h2 { margin-bottom: 12px; }
.about p { color: var(--muted); }
.about .chips { margin-top: 16px; }

.amaze { margin-top: 18px; display: flex; gap: 24px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.amaze h3 a { color: var(--text); }
.amaze p { margin: 4px 0 0; }
.tool-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tool-list a { display: inline-block; font-size: 13px; padding: 6px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.tool-list a:hover { border-color: var(--accent); }

.timeline { list-style: none; margin: 22px 0 0; padding: 0 0 0 22px; border-left: 2px solid var(--border); display: grid; gap: 22px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -29px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); }
.timeline h3 { font-size: 16px; }
.timeline h3 a { color: var(--text); }
.timeline .tag { color: var(--accent); font-size: 13px; font-weight: 500; margin: 2px 0 6px; }
.timeline ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }

.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.contact h2 { margin-bottom: 6px; }
.contact-links { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.contact-links a { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: 14px; }
.contact-links span { color: var(--muted); font-size: 13px; }
.form { display: grid; gap: 12px; align-content: start; }
.form input, .form textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; resize: vertical;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.form .hp { position: absolute; left: -9999px; }
.form-note { font-size: 14px; color: var(--muted); margin: 0; min-height: 1.4em; }

.footer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

/* Buttons in a row, client apps */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sub-head { margin-top: 40px; margin-bottom: 18px; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.client { display: flex; flex-direction: column; }
.client .details-head img, .client .details-head .tile { width: 56px; height: 56px; border-radius: 14px; }
.client .details-head h3 { font-size: 17px; }
.client > .muted { font-size: 14px; }
.client .features { margin-bottom: 16px; }
.client .btn-row { margin-top: auto; }
.timeline .muted { margin: 2px 0 0; font-size: 14px; }
.job-apps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.job-app { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; color: var(--text); font-family: inherit; cursor: pointer; }
.job-app:hover { border-color: var(--accent); }
.job-app img { width: 22px; height: 22px; border-radius: 6px; }
.meta a { color: var(--accent); }
.cf-turnstile { min-height: 0; }

/* ---------- Responsive ---------- */
@media (min-width: 1281px) {
  .workstation.landscape { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .workstation.landscape .col-left { grid-row: 1 / span 2; }
}
@media (max-width: 1280px) {
  .workstation { grid-template-columns: auto minmax(0, 1fr); }
  .col-left { grid-column: 1 / -1; }
  .col-phone { position: static; }
  .workstation.landscape .col-phone { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; z-index: 20; left: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .menu-btn { display: grid; }
  .main { padding: 0 16px 24px; }
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .workstation { grid-template-columns: 1fr; }
  .phone { width: min(280px, 78vw); }
  .intro, .about { flex-direction: column; align-items: flex-start; }
  .intro h1 { font-size: 24px; }
  .avatar-lg { width: 96px; height: 96px; font-size: 30px; }
  .slide-btn { opacity: 1; }
}
