/* Clean & minimal: lots of white space, black type, one blue accent. Dark mode follows the phone. */
:root {
  --bg: #FFFFFF;
  --text: #0E0E10;
  --muted: #6B6B73;
  --line: #E7E7EA;
  --soft: #F5F5F7;
  --accent: #2F5BFF;
  --accent-ink: #FFFFFF;
  --chat: #E9EEF7;
  --chat-me: #2F5BFF;
  --head: 'Inter Tight', 'Inter', system-ui, -apple-system, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
/* Dark theme: follows the phone unless the visitor picked a theme with the switch (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0B0C;
    --text: #F4F4F5;
    --muted: #9C9CA5;
    --line: #232327;
    --soft: #151517;
    --accent: #7090FF;
    --accent-ink: #0B0B0C;
    --chat: #1C1F27;
    --chat-me: #3D63FF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0B0B0C;
    --text: #F4F4F5;
    --muted: #9C9CA5;
    --line: #232327;
    --soft: #151517;
    --accent: #7090FF;
    --accent-ink: #0B0B0C;
    --chat: #1C1F27;
    --chat-me: #3D63FF;
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1080px, 100%); margin: 0 auto; padding: 0 24px; }
@media (max-width: 480px) { .wrap { padding: 0 16px; } }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.top.scrolled { border-bottom-color: var(--line); }
.top-in { display: flex; align-items: center; gap: 24px; height: 64px; padding-top: env(safe-area-inset-top, 0px); }
.logo { font-family: var(--head); font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -0.01em; }
.links { display: flex; gap: 24px; margin-left: auto; }
.links a { text-decoration: none; color: var(--muted); font-size: 15px; transition: color .2s; }
.links a:hover { color: var(--text); }
.lang { display: flex; gap: 2px; background: var(--soft); border-radius: 999px; padding: 3px; }
.lang button { border: 0; background: transparent; color: var(--muted); font: 600 13px/1 var(--body); padding: 8px 10px; border-radius: 999px; cursor: pointer; min-width: 40px; }
.lang button[aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
@media (max-width: 640px) { .links { display: none; } .lang { margin-left: auto; } }

/* Hero */
.hero { padding-top: clamp(64px, 14vh, 140px); padding-bottom: clamp(56px, 10vh, 110px); }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 15px; margin: 0 0 20px; }
h1, h2, h3 { font-family: var(--head); letter-spacing: -0.025em; margin: 0; }
h1 { font-size: clamp(42px, 8vw, 88px); line-height: 1.02; font-weight: 700; max-width: 12ch; text-wrap: balance; }
.lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 34em; margin: 24px 0 0; }
.cta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 28px; margin-top: 40px; }

.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; padding: 14px 22px; border-radius: 999px; border: 1.5px solid var(--accent); transition: transform .15s, filter .2s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn-line { background: transparent; color: var(--text); border-color: var(--line); }
.btn-line:hover { border-color: var(--text); filter: none; }
.link-arrow { font-weight: 600; text-decoration: none; border-bottom: 1.5px solid var(--line); padding-bottom: 2px; transition: border-color .2s; }
.link-arrow:hover { border-color: var(--text); }

/* Sections */
.section { padding-top: clamp(64px, 10vw, 120px); }
.section-title { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; font-family: var(--body); padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.small-gap { margin-top: clamp(56px, 8vw, 96px); }
.num { font-family: var(--head); font-size: 14px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }

/* Projects */
.project { display: grid; grid-template-columns: 1fr; gap: 32px; padding: 48px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 860px) { .project { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; padding: 72px 0; } }
.project-text { display: flex; flex-direction: column; gap: 10px; max-width: 32em; }
.project h3 { font-size: clamp(30px, 4vw, 44px); font-weight: 700; line-height: 1.1; }
.project-lead { font-size: 20px; font-weight: 500; margin: 0; }
.project-text p { margin: 0; }
.project-text p:not(.project-lead):not(.tags) { color: var(--muted); }
.tags { font-size: 14px; color: var(--text); font-weight: 500; margin-top: 8px !important; }
.project-media { display: flex; justify-content: center; }
.project-media.stack { flex-direction: column; align-items: center; gap: 20px; }

.phone { margin: 0; width: min(280px, 72vw); border-radius: 38px; padding: 8px; background: var(--text); box-shadow: 0 30px 60px -30px rgba(0,0,0,.35); }
.phone img { border-radius: 30px; width: 100%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .phone { background: #2A2A2F; } }
:root[data-theme="dark"] .phone { background: #2A2A2F; }

/* Telegram chat mock */
.chat { width: min(360px, 100%); background: var(--soft); border-radius: 28px; padding: 16px 14px 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; line-height: 1.4; border: 1px solid var(--line); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.chat-head b { display: block; font-size: 15px; }
.chat-head span:not(.avatar) { font-size: 12px; color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; }
.msg { max-width: 86%; padding: 9px 13px; border-radius: 18px; }
.msg.me { align-self: flex-end; background: var(--chat-me); color: #fff; border-bottom-right-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.kb { display: flex; gap: 6px; margin-top: 8px; }
.kb.col { flex-direction: column; }
.kb span { flex: 1; text-align: center; background: var(--chat); border-radius: 10px; padding: 7px 8px; font-size: 13px; font-weight: 500; }

/* iPhone notification mock */
.notif { width: min(340px, 100%); background: color-mix(in srgb, var(--soft) 80%, var(--bg)); border: 1px solid var(--line); border-radius: 22px; padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; line-height: 1.4; box-shadow: 0 12px 30px -16px rgba(0,0,0,.25); }
.notif-app { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); letter-spacing: .03em; margin-bottom: 4px; }
.notif-app i { width: 16px; height: 16px; border-radius: 5px; background: linear-gradient(135deg, #5B7CFF, #B45BFF); }

/* Services & steps */
.services { display: grid; grid-template-columns: 1fr; }
@media (min-width: 760px) { .services { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }
.service { padding: 32px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 760px) { .service { border-bottom: 0; } }
.service h3 { font-size: 24px; font-weight: 600; }
.service p, .steps p { margin: 0; color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }
.steps li { display: flex; gap: 16px; align-items: baseline; padding: 24px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .steps li { border-bottom: 0; flex-direction: column; gap: 8px; } }
.steps p { color: var(--text); font-size: 19px; font-weight: 500; }

/* About & contact */
.big { font-family: var(--head); font-size: clamp(24px, 3.4vw, 36px); line-height: 1.3; font-weight: 500; letter-spacing: -0.015em; margin: 32px 0 0; max-width: 26em; text-wrap: pretty; }
.contact { padding-bottom: 40px; }
.contact h2 { font-size: clamp(36px, 6.4vw, 72px); font-weight: 700; line-height: 1.05; max-width: 14ch; padding-top: 24px; border-top: 1px solid var(--line); text-wrap: balance; }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 48px; padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 14px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }

/* Gentle reveal on scroll (skipped when the phone asks for less motion) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* WhatsApp chat mock */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.demo-note { font-size: 14px; color: var(--muted) !important; border-left: 2px solid var(--accent); padding-left: 10px; margin-top: 6px !important; }
.wa { --wa-bg: #EFEAE2; --wa-in: #FFFFFF; --wa-out: #D9FDD3; --wa-head: #F0F2F5; --wa-time: #667781;
  width: min(360px, 100%); border-radius: 28px; overflow: hidden; border: 1px solid var(--line); font-size: 14.5px; line-height: 1.4; color: #111B21; box-shadow: 0 30px 60px -36px rgba(0,0,0,.35); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa { --wa-bg: #0B141A; --wa-in: #202C33; --wa-out: #005C4B; --wa-head: #202C33; --wa-time: #8696A0; color: #E9EDEF; } }
:root[data-theme="dark"] .wa { --wa-bg: #0B141A; --wa-in: #202C33; --wa-out: #005C4B; --wa-head: #202C33; --wa-time: #8696A0; color: #E9EDEF; }
.wa-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--wa-head); }
.wa-head b { display: block; font-size: 15px; font-weight: 600; }
.wa-head span:not(.wa-ava) { font-size: 12px; color: var(--wa-time); }
.wa-ava { width: 36px; height: 36px; border-radius: 50%; background: #25D366; display: grid; place-items: center; font-size: 18px; }
.wa-body { background: var(--wa-bg); padding: 14px 12px 18px; display: flex; flex-direction: column; gap: 6px; }
.wa-msg { max-width: 84%; padding: 7px 10px 6px; border-radius: 10px; background: var(--wa-in); box-shadow: 0 1px .5px rgba(11,20,26,.13); position: relative; }
.wa-msg.in { align-self: flex-start; border-top-left-radius: 3px; }
.wa-msg.out { align-self: flex-end; background: var(--wa-out); border-top-right-radius: 3px; }
.wa-msg i { font-style: normal; font-size: 11px; color: var(--wa-time); float: right; margin: 6px 0 -3px 10px; }
.wa-voice { display: flex; align-items: center; gap: 8px; min-width: 210px; }
.wa-voice .play { font-size: 14px; color: var(--wa-time); }
.wa-voice .wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 22px; }
.wa-voice .wave b { flex: 1; background: var(--wa-time); border-radius: 2px; opacity: .7; }
.wa-voice .wave b:nth-child(3n+1) { height: 40%; } .wa-voice .wave b:nth-child(3n+2) { height: 85%; } .wa-voice .wave b:nth-child(3n) { height: 60%; }
.wa-voice .dur { font-size: 12px; color: var(--wa-time); }
.wa-voice i { margin: 0; align-self: flex-end; }
.tg-msgs { display: flex; flex-direction: column; gap: 10px; }

/* Light / dark switch */
body { transition: background-color .3s, color .3s; }
.theme { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--soft); color: var(--text); display: grid; place-items: center; cursor: pointer; margin-left: -12px; flex: none; transition: transform .15s; }
.theme:active { transform: scale(.92); }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme .sun { display: none; }
.theme[data-now="dark"] .sun { display: block; }
.theme[data-now="dark"] .moon { display: none; }
@media (prefers-reduced-motion: reduce) { body { transition: none; } }
