/* =====================================================================
   УебСтудио — портфолио
   Палитрата се сменя от променливите отдолу.
   ===================================================================== */

:root {
  --ink: #0d0f12;
  --paper: #fbfaf8;
  --paper-2: #f2f0ec;
  --line: rgba(13, 15, 18, 0.12);
  --muted: #6a6f77;
  --accent: #1f4dff;
  --accent-ink: #ffffff;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wrap: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Manrope", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; }
p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; padding: 0.7rem 1.1rem; border-radius: 8px; background: var(--ink); color: var(--paper); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.eyebrow { margin-bottom: 0.9rem; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.95rem 1.7rem; border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-family: inherit; font-size: 15px; font-weight: 700; text-decoration: none;
  cursor: pointer;
  transition: transform 260ms var(--ease), background-color 260ms var(--ease), color 260ms var(--ease);
}
.btn:hover { transform: translateY(-2px); background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: none; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--sm { padding: 0.6rem 1.2rem; font-size: 13.5px; }
.btn--full { width: 100%; }

/* ------------------------------------------------------------ nav */

.nav { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid transparent; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(14px); transition: border-color 300ms var(--ease); }
.nav--stuck { border-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: 2rem; height: 74px; }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand__dot { width: 12px; height: 12px; border-radius: 4px; background: var(--accent); transition: transform 400ms var(--ease); }
.brand:hover .brand__dot { transform: rotate(45deg) scale(1.15); }
.brand__name { font-size: 17px; font-weight: 500; letter-spacing: -0.02em; }
.brand__name strong { font-weight: 800; }

.nav__links { display: flex; gap: 1.9rem; margin-left: auto; }
.nav__links a { position: relative; color: var(--muted); font-size: 14.5px; font-weight: 600; text-decoration: none; transition: color 220ms var(--ease); }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -5px; width: 0; height: 2px; background: var(--accent); transition: width 280ms var(--ease); }
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }

.nav__burger { display: none; flex-direction: column; gap: 5px; padding: 0.6rem; border: 1px solid var(--line); border-radius: 10px; background: none; cursor: pointer; }
.nav__burger span { display: block; width: 18px; height: 2px; background: var(--ink); transition: transform 260ms var(--ease); }
.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* Атрибутът hidden трябва да надделява — иначе менюто стои отворено. */
.nav__mobile[hidden] { display: none; }
.nav__mobile {
  display: grid; gap: 0.15rem;
  padding: 0.4rem 1.25rem 1.1rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
  animation: drop 260ms var(--ease);
}
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
.nav__mobile a {
  padding: 0.95rem 0.2rem; border-bottom: 1px solid var(--line);
  font-size: 16px; font-weight: 600; text-decoration: none;
}
.nav__mobile a:last-of-type { border-bottom: 0; }
.nav__mobile .btn { margin-top: 0.9rem; padding: 0.95rem 1.4rem; border-bottom: 0; }

/* ------------------------------------------------------------ hero */

.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5.5rem); overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(2rem, 6vw, 4.5rem); }
.hero h1 { font-size: clamp(2.3rem, 5vw, 4rem); }
.lead { max-width: 46ch; margin: 1.3rem 0 2.2rem; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.15rem); }
.hero__cta { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.hero__facts { display: flex; gap: 2.4rem; flex-wrap: wrap; margin: 3rem 0 0; padding: 1.6rem 0 0; border-top: 1px solid var(--line); list-style: none; }
.hero__facts li { display: grid; gap: 0.15rem; }
.hero__facts strong { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; }
.hero__facts span { color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------------ browser mockup */

.mock { position: relative; }
.mock__window {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: #fff; box-shadow: 0 40px 80px -50px rgba(13, 15, 18, 0.45);
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.mock__bar { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.mock__bar i { width: 9px; height: 9px; border-radius: 50%; background: #d6d3cd; }
.mock__url { margin-left: 10px; padding: 3px 12px; border-radius: 999px; background: #fff; color: var(--muted); font-size: 10.5px; }

.mock__body { padding: 18px; }
.mock__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.mock__logo { width: 46px; height: 12px; border-radius: 4px; background: var(--ink); }
.mock__links { display: flex; gap: 8px; }
.mock__links b { width: 26px; height: 7px; border-radius: 3px; background: #dedbd5; }

.mock__hero { display: grid; gap: 9px; margin-bottom: 24px; }
.mock__h1 { width: 78%; height: 17px; border-radius: 5px; background: var(--ink); }
.mock__h1--short { width: 52%; background: var(--accent); }
.mock__p { width: 88%; height: 8px; border-radius: 4px; background: #e2dfd9; }
.mock__p--short { width: 62%; }
.mock__btn { width: 92px; height: 26px; margin-top: 6px; border-radius: 999px; background: var(--accent); }

.mock__cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.mock__cards div { height: 54px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); }

.mock__phone { position: absolute; right: -14px; bottom: -26px; width: 116px; padding: 8px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 24px 48px -28px rgba(13, 15, 18, 0.5); animation: float 7s ease-in-out infinite 0.9s; }
.mock__phone-screen { display: grid; gap: 7px; padding: 14px 10px; border-radius: 13px; background: var(--paper-2); }
.mock__phone .mock__h1 { height: 12px; }
.mock__phone .mock__btn { width: 60px; height: 20px; }

/* ------------------------------------------------------------ sections */

.section { padding: clamp(3.5rem, 9vw, 7rem) 0; }
.section--tint { background: var(--paper-2); }
.section__head { max-width: 640px; margin-bottom: clamp(2.2rem, 5vw, 3.4rem); }
.section__head h2 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); }
.section__intro { margin-top: 1.1rem; color: var(--muted); font-size: 1.02rem; }

/* ------------------------------------------------------------ project cards */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: clamp(1.2rem, 2.5vw, 1.9rem); }

.card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: transform 420ms var(--ease), box-shadow 420ms var(--ease); }
.card:hover { transform: translateY(-6px); box-shadow: 0 34px 60px -40px rgba(13, 15, 18, 0.45); }

/* Ако няма снимка, остава градиентът — сайтът не изглежда счупен. */
.card__media { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; background: linear-gradient(140deg, #e8ebf3, #d4d9e6); }
.card__media[data-shade="1"] { background: linear-gradient(140deg, #dfe7f5, #c3d0e8); }
.card__media[data-shade="2"] { background: linear-gradient(140deg, #f5e6dd, #e5c9b6); }
.card__media[data-shade="3"] { background: linear-gradient(140deg, #f0e4f2, #d9c4e2); }
.card__media[data-shade="4"] { background: linear-gradient(140deg, #e0f0ea, #bfdccf); }
.card__media[data-shade="5"] { background: linear-gradient(140deg, #e7ecf6, #ccd6e9); }
.card__media[data-shade="6"] { background: linear-gradient(140deg, #e2f1f6, #c2dfe9); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease); }
.card:hover .card__media img { transform: scale(1.05); }

.card__body { display: flex; flex: 1; flex-direction: column; gap: 0.65rem; padding: 1.5rem 1.5rem 1.6rem; }
.card__tag { align-self: flex-start; padding: 0.25rem 0.7rem; border-radius: 999px; background: var(--paper-2); color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.card h3 { font-size: 1.32rem; }
.card__text { flex: 1; color: var(--muted); font-size: 14.5px; }
.card__link { display: inline-flex; align-items: center; gap: 0.4rem; align-self: flex-start; margin-top: 0.4rem; color: var(--ink); font-size: 14.5px; font-weight: 700; text-decoration: none; }
.card__link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform 300ms var(--ease); }
.card__link:hover { color: var(--accent); }
.card__link:hover svg { transform: translate(2px, -2px); }

/* ------------------------------------------------------------ about */

.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.8rem, 5vw, 4rem); align-items: start; }
.about h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); }
.about__text { display: grid; gap: 1.1rem; color: var(--muted); font-size: 1.02rem; }
.about__text p:first-child { color: var(--ink); font-size: 1.18rem; font-weight: 600; }

/* ------------------------------------------------------------ steps */

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.4rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step { position: relative; display: grid; gap: 0.55rem; align-content: start; padding: 1.9rem 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: transform 380ms var(--ease), border-color 380ms var(--ease); }
.step:hover { transform: translateY(-4px); border-color: var(--ink); }
.step__num { font-size: 12px; font-weight: 800; color: var(--accent); letter-spacing: 0.1em; }
.step h3 { font-size: 1.1rem; }
.step p { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------ contact */

.contact { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.contact__side { display: grid; gap: 0.8rem; }
.contact__row { display: flex; align-items: center; gap: 0.9rem; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-decoration: none; transition: transform 300ms var(--ease), border-color 300ms var(--ease); }
.contact__row:hover { transform: translateX(3px); border-color: var(--ink); }
.contact__ico { display: grid; flex: none; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--paper-2); }
.contact__ico svg { width: 19px; height: 19px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linejoin: round; }
.contact__row em { display: block; color: var(--muted); font-size: 11.5px; font-style: normal; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.contact__row strong { font-size: 1.02rem; }
.contact__note { margin-top: 0.4rem; color: var(--muted); font-size: 13.5px; }

.form { display: grid; gap: 1rem; padding: clamp(1.4rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.form__row { display: grid; gap: 0.4rem; }
.form__row label { font-size: 13px; font-weight: 700; }
.form input, .form textarea { padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); color: var(--ink); font-family: inherit; font-size: 15px; transition: border-color 220ms var(--ease), background-color 220ms var(--ease); }
.form input::placeholder, .form textarea::placeholder { color: #a4a8ae; }
.form input:focus, .form textarea:focus { border-color: var(--accent); background: #fff; outline: none; }
.form textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form [aria-invalid="true"] { border-color: #c0392b; }
.form__status { margin: 0; min-height: 1.2em; font-size: 13.5px; font-weight: 600; }
.form__status[data-tone="ok"] { color: #1a7f4b; }
.form__status[data-tone="bad"] { color: #c0392b; }

/* ------------------------------------------------------------ footer */

.footer { padding: clamp(2.6rem, 6vw, 4rem) 0 1.6rem; border-top: 1px solid var(--line); }
.footer__inner { display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 2rem; }
.footer__brand p { max-width: 30ch; margin-top: 0.9rem; color: var(--muted); font-size: 14px; }
.footer__col { display: grid; gap: 0.5rem; align-content: start; }
.footer__col h4 { margin-bottom: 0.3rem; font-size: 12.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.footer__col a { color: var(--muted); font-size: 14.5px; text-decoration: none; transition: color 200ms var(--ease); }
.footer__col a:hover { color: var(--accent); }
.footer__base { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer__base a { text-decoration: none; }
.footer__base a:hover { color: var(--accent); }

/* ------------------------------------------------------------ reveal */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 940px) {
  .hero__grid, .about, .contact, .footer__inner { grid-template-columns: 1fr; }
  .mock { margin-top: 1rem; }
  .mock__phone { right: 0; bottom: -18px; width: 96px; }
}

@media (max-width: 760px) {
  .nav__links, .nav .btn--sm { display: none; }
  .nav__burger { display: flex; margin-left: auto; }
  .hero__facts { gap: 1.6rem; }
  .hero__facts strong { font-size: 1.35rem; }
}

@media (min-width: 761px) {
  .nav__mobile { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
