/* AvSoftworks — dark, sparse, product-first */

:root {
  --bg: #050505;
  --bg-elevated: #0c0c0c;
  --bg-card: #0f0f0f;
  --border: #1c1c1c;
  --border-hover: #2e2e2e;
  --fg: #f2f2f2;
  --fg-2: #a8a8a8;
  --fg-3: #6b6b6b;
  --fg-4: #3d3d3d;
  --white: #ffffff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 64px;
  --max: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color-scheme: dark;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
  min-height: 100vh;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

strong {
  font-weight: 600;
  color: var(--fg);
}

/* faint grain — keeps flat black from feeling sterile without looking "AI glossy" */
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* ─── NAV ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  max-width: 1280px;
  margin: 0 auto;
  background: rgba(5, 5, 5, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease);
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-mark {
  width: 36px;
  height: auto;
  opacity: 0.95;
}

.nav-word {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
}

.nav-links a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg-2);
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-links a:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
}

.nav-cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 560;
  color: var(--bg);
  background: var(--fg);
  padding: 8px 14px;
  border-radius: 999px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav-cta:hover {
  opacity: 0.9;
}

.nav-cta-arrow {
  font-size: 12px;
  opacity: 0.7;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  place-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.2s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.75px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  position: sticky;
  top: var(--nav-h);
  z-index: 39;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px 20px;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu:not([hidden]) {
  display: flex;
}

.mobile-menu a {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-2);
  padding: 12px 10px;
  border-radius: 8px;
}

.mobile-menu a:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
}

/* ─── HERO ─── */
.hero {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 72px 28px 96px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  min-height: calc(100vh - var(--nav-h) - 40px);
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, black 20%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2.6rem, 5.5vw, 4rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}

.hero-muted {
  color: var(--fg-3);
  font-weight: 500;
}

.hero-lead {
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--fg-2);
  max-width: 42ch;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 560;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--white);
  color: #0a0a0a;
}

.btn-primary:hover {
  background: #e8e8e8;
}

.btn-ghost {
  border: 1px solid var(--border-hover);
  color: var(--fg);
  background: transparent;
}

.btn-ghost:hover {
  border-color: #4a4a4a;
  background: rgba(255, 255, 255, 0.03);
}

.hero-logo-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo {
  width: min(100%, 420px);
  height: auto;
  filter: drop-shadow(0 0 60px rgba(255, 255, 255, 0.06));
  opacity: 0.92;
}

/* ─── SECTIONS ─── */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 88px 28px;
}

.section-head {
  margin-bottom: 40px;
  max-width: 520px;
}

.section h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.section-sub {
  color: var(--fg-2);
  font-size: 15.5px;
  line-height: 1.6;
}

/* ─── PROJECTS ─── */
.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.project {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.project:hover {
  border-color: var(--border-hover);
  background: #111111;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.project-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0a0a0a;
  display: grid;
  place-items: center;
  color: var(--fg);
}

.project-icon img {
  width: 28px;
  height: auto;
  object-fit: contain;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.badge-live {
  color: #b8f0c8;
  border-color: rgba(120, 200, 140, 0.25);
  background: rgba(80, 160, 100, 0.08);
}

.badge-dev {
  color: #d4c4a0;
  border-color: rgba(200, 170, 100, 0.22);
  background: rgba(160, 130, 60, 0.08);
}

.project h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.project-tag {
  font-size: 13px;
  color: var(--fg-3);
  margin-bottom: 14px;
}

.project-desc {
  font-size: 14.5px;
  color: var(--fg-2);
  line-height: 1.6;
  flex: 1;
}

.project-foot {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 550;
  color: var(--fg);
  transition: gap 0.2s var(--ease);
}

.link-arrow:hover {
  gap: 10px;
}

.link-arrow span {
  color: var(--fg-3);
}

.muted {
  font-size: 13.5px;
  color: var(--fg-3);
}

/* ─── ABOUT ─── */
.section-about {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-width: none;
  padding-left: max(28px, calc((100% - var(--max)) / 2 + 28px));
  padding-right: max(28px, calc((100% - var(--max)) / 2 + 28px));
  background: var(--bg-elevated);
}

.about-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: start;
}

.about-copy p {
  color: var(--fg-2);
  font-size: 15.5px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.about-list {
  list-style: none;
  margin-top: 28px;
  border-top: 1px solid var(--border);
}

.about-list li {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}

.about-k {
  color: var(--fg-3);
  font-weight: 500;
}

.about-v {
  color: var(--fg-2);
}

/* ─── CONTACT ─── */
.contact-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.03), transparent 40%),
    var(--bg-card);
}

.contact-sub {
  margin-top: 8px;
  max-width: 36ch;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0a0a0a;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.contact-card:hover {
  border-color: var(--border-hover);
  background: #111;
}

.contact-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.contact-value {
  font-size: 15px;
  font-weight: 550;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  word-break: break-all;
}

/* ─── FOOTER ─── */
.footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--fg-3);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-left img {
  opacity: 0.7;
}

.footer-right {
  display: flex;
  gap: 20px;
}

.footer-right a {
  color: var(--fg-3);
  transition: color 0.15s ease;
}

.footer-right a:hover {
  color: var(--fg);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 48px;
    padding-bottom: 64px;
    gap: 36px;
  }

  .hero-logo-wrap {
    order: -1;
  }

  .hero-logo {
    width: min(70%, 280px);
    margin: 0 auto;
    opacity: 0.8;
  }

  .projects {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .contact-panel {
    grid-template-columns: 1fr;
    padding: 28px;
  }
}

@media (max-width: 720px) {
  .nav-links,
  .nav-cta {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav {
    padding: 0 18px;
  }

  .hero,
  .section {
    padding-left: 18px;
    padding-right: 18px;
  }

  .section-about {
    padding-left: 18px;
    padding-right: 18px;
  }

  .about-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 18px;
  }
}

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
