/* Val Drenov portfolio - shared design system
   Theme: locked dark. Accent: desaturated green, one accent for the whole site.
   Shape system: cards 20px, pills for buttons/chips. */

@font-face {
  font-family: "Outfit";
  src: url("../assets/fonts/outfit-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/jbmono-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #0e120f;
  --bg-soft: #131814;
  --panel: #161d18;
  --panel-2: #1a221c;
  --line: #253028;
  --line-soft: #1d2620;
  --ink: #eef2ed;
  --muted: #a9b6ac;
  --faint: #75847a;
  --accent: #5fc492;
  --accent-deep: #2e8f63;
  --accent-ink: #08130d;
  --r-card: 20px;
  --sans: "Outfit", -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; fill: currentColor; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 18, 15, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  height: 66px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-name {
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
.nav-name .dot-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
  overflow: hidden;
}
.nav-name .dot-mark.has-photo { background: var(--bg-soft); }
.nav-name .dot-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.usecases { margin-top: 64px; }
.usecases h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.usecases .sub { margin-top: 8px; font-size: 15.5px; }
.uc-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px;
  font-size: 13px; font-weight: 700;
  color: var(--accent); text-decoration: none;
}
.uc-link .icon { font-size: 13px; }
.uc-link:hover { text-decoration: underline; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a {
  font-size: 14.5px; font-weight: 500; color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.nav-cta {
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav-links a.nav-cta:hover { border-color: var(--accent-deep); background: var(--bg-soft); }
@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 26px; border-radius: 999px;
  font-size: 15.5px; font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:hover { background: #74d2a4; }
.btn-line { border: 1px solid var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--accent-deep); background: var(--bg-soft); }
.btn-sm { padding: 10px 18px; font-size: 14px; }

/* ---------- hero ---------- */
.hero {
  padding: 64px 0 40px;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
  align-items: center;
  min-height: min(760px, calc(100dvh - 66px));
}
.hero h1 {
  font-size: clamp(38px, 5.2vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.04;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
  line-height: 1.1;
  padding-bottom: 4px;
}
.hero .lede {
  font-size: 18px; color: var(--muted);
  max-width: 44ch;
  margin-top: 22px;
}
.hero .cta-row { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-phone-side { display: flex; justify-content: center; }

@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 48px; }
  .hero-phone-side { display: none; }
}

/* ---------- phone frame ---------- */
.phone {
  position: relative;
  width: min(360px, 88vw);
  aspect-ratio: 390 / 800;
  border-radius: 52px;
  border: 11px solid #171c18;
  background: #000;
  box-shadow:
    inset 0 0 0 2px #2a322c,
    var(--shadow-card);
  overflow: hidden;
  flex: none;
}
.phone iframe {
  width: 100%; height: 100%;
  border: 0;
  background: #f4f6f4;
}
.phone .island {
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 104px; height: 27px; border-radius: 999px;
  background: #060806;
  z-index: 5;
}
.phone-float { animation: phone-float 7s ease-in-out infinite; }
@keyframes phone-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@media (prefers-reduced-motion: reduce) {
  .phone-float { animation: none; }
}

/* ---------- section scaffolding ---------- */
.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.section h2 {
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.section .sub {
  color: var(--muted); font-size: 17px;
  max-width: 58ch;
  margin-top: 14px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

/* ---------- flagship project card ---------- */
.flagship {
  margin-top: 44px;
  background: linear-gradient(160deg, #14241b, #101a14 55%, #0f1611);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 24px;
}
.flagship-copy { padding: 48px 20px 48px 48px; display: flex; flex-direction: column; }
.flagship-copy .app-badge {
  width: 52px; height: 52px; border-radius: 15px;
  background: #17734b;
  color: #fff; font-weight: 800; font-size: 19px;
  display: grid; place-items: center;
  box-shadow: 0 10px 26px rgba(23, 115, 75, 0.4);
}
.flagship-copy h3 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 20px; }
.flagship-copy .tag { color: var(--accent); font-weight: 600; font-size: 15px; margin-top: 4px; }
.flagship-copy p { color: var(--muted); margin-top: 14px; max-width: 46ch; }
.feature-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.feature-chips span {
  font-size: 12.5px; font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px;
}
.flagship-copy .cta-row { display: flex; gap: 12px; margin-top: auto; padding-top: 30px; flex-wrap: wrap; }
.flagship-phone {
  display: flex; align-items: flex-end; justify-content: center;
  padding: 52px 40px 0;
}
.flagship-phone .phone {
  width: min(300px, 70vw);
  border-radius: 44px 44px 0 0;
  border-bottom: 0;
  aspect-ratio: 390 / 660;
  box-shadow: inset 0 0 0 2px #2a322c, 0 -18px 50px rgba(0, 0, 0, 0.35);
}
@media (max-width: 900px) {
  .flagship { grid-template-columns: 1fr; }
  .flagship-copy { padding: 34px 26px 8px; }
  .flagship-phone { padding: 26px 26px 0; }
}

.more-note {
  margin-top: 18px;
  color: var(--faint); font-size: 14.5px;
  display: flex; align-items: center; gap: 9px;
}

/* ---------- about ---------- */
.about-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px;
  margin-top: 8px;
  align-items: center;
}
.about-photo {
  position: relative;
  margin: 0;
  max-width: 400px;
  justify-self: center;
}
.about-photo img {
  width: 100%; height: auto;
  border-radius: 26px;
  display: block;
}
.about-photo::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 26px;
  box-shadow:
    inset 0 0 0 1px rgba(95, 196, 146, 0.14),
    inset 0 -90px 110px -50px var(--bg);
  pointer-events: none;
}
.about-photo::before {
  content: "";
  position: absolute;
  inset: -8% -12% auto auto;
  width: 70%; height: 55%;
  background: radial-gradient(closest-side, rgba(95, 196, 146, 0.16), transparent);
  filter: blur(30px);
  z-index: -1;
  pointer-events: none;
}
.creds { margin-top: 56px; }
.creds h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.creds .sub { margin-top: 8px; font-size: 15.5px; }
.creds-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-top: 22px;
}
@media (max-width: 900px) { .creds-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .creds-grid { grid-template-columns: 1fr; } }
.cred {
  display: block;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.cred:hover { border-color: var(--accent-deep); transform: translateY(-2px); }
.cred .thumb {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f4f2ec;
}
.cred .thumb img {
  position: absolute; inset: 12px;
  width: calc(100% - 24px); height: calc(100% - 24px);
  object-fit: contain;
}
.cred-info { display: block; padding: 12px 15px 14px; }
.cred-info .t { display: block; font-weight: 600; font-size: 14.5px; color: var(--ink); }
.cred-info .s {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); margin-top: 3px;
}
.cred-info .s .icon { color: var(--accent); font-size: 12px; }

.skill-list.skills-row {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 44px;
}
.skill-list.skills-row .skill { flex: 1 1 340px; }
.about-grid .lede-lg { font-size: 21px; line-height: 1.5; color: var(--ink); font-weight: 400; }
.about-grid .lede-lg strong { color: var(--accent); font-weight: 600; }
.about-grid .body { color: var(--muted); margin-top: 18px; font-size: 16px; }
.skill-list { display: grid; gap: 14px; }
.skill-list .skill {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  padding: 16px 18px;
}
.skill .icon { flex: none; font-size: 21px; color: var(--accent); margin-top: 2px; }
.skill .t { font-weight: 600; font-size: 15.5px; }
.skill .s { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 34px; }
  .about-photo { max-width: 340px; }
  .about-photo::before { inset: -6% 0 auto auto; width: 60%; }
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 44px 0 52px;
  margin-top: 40px;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
}
.footer .sig { font-weight: 700; font-size: 16px; }
.footer .sig span { color: var(--faint); font-weight: 400; font-size: 14px; margin-left: 10px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a {
  color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color 0.15s ease;
}
.footer-links a:hover { color: var(--ink); }

/* ---------- case study layout ---------- */
.case-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 64px;
  padding: 56px 0 80px;
  align-items: start;
}
.case-demo-col {
  position: sticky; top: 96px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.case-demo-col .hint { color: var(--faint); font-size: 13.5px; text-align: center; max-width: 32ch; }
@media (max-width: 940px) {
  .case-layout { grid-template-columns: 1fr; }
  .case-demo-col { display: none; }
}

.case-head .back {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 600;
  margin-bottom: 28px;
  transition: color 0.15s ease;
}
.case-head .back:hover { color: var(--ink); }
.case-head h1 {
  font-size: clamp(36px, 4.6vw, 56px);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.05;
}
.case-head .lede { font-size: 19px; color: var(--muted); margin-top: 18px; max-width: 52ch; }
.case-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.case-meta span {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
}

.case-body { margin-top: 56px; }
.case-body h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 52px 0 14px; }
.case-body p { color: var(--muted); font-size: 16.5px; max-width: 62ch; margin-top: 12px; }
.case-body p strong { color: var(--ink); font-weight: 600; }

/* demo deep-link buttons */
.demo-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.demo-controls button {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink);
  padding: 11px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.demo-controls button:hover { border-color: var(--accent-deep); }
.demo-controls button:active { transform: scale(0.97); }
.demo-controls button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.demo-controls button .icon { color: var(--accent); font-size: 16px; }
.demo-controls button.primary .icon { color: var(--accent-ink); }

/* decision blocks */
.decision {
  border-left: 2px solid var(--accent-deep);
  padding: 4px 0 4px 22px;
  margin-top: 30px;
}
.decision h3 { font-size: 18.5px; font-weight: 700; letter-spacing: -0.01em; }
.decision p { margin-top: 8px; font-size: 15.5px; }

/* skills-under-the-hood grid */
.hood-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.hood-grid .cell {
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  padding: 18px;
}
.hood-grid .cell .icon { font-size: 22px; color: var(--accent); }
.hood-grid .cell .t { font-weight: 600; font-size: 15px; margin-top: 10px; }
.hood-grid .cell .s { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
@media (max-width: 640px) {
  .hood-grid { grid-template-columns: 1fr; }
}

/* mobile demo bar (case study, small screens) */
.demo-bar {
  display: none;
  position: fixed; left: 14px; right: 14px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  z-index: 60;
}
.demo-bar a {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 15.5px;
  padding: 16px; border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
@media (max-width: 940px) {
  .demo-bar { display: block; }
  .case-cta-desktop { display: none; }
}

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
