/* Hainsey Systems — base styles */
:root {
  --bg: #0c0f14;
  --bg-elevated: #141a24;
  --surface: #1a2230;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf4;
  --text-muted: #8b96ab;
  --accent: #3dd4c0;
  --accent-dim: rgba(61, 212, 192, 0.15);
  --accent-glow: rgba(61, 212, 192, 0.35);
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Outfit", var(--font-sans);
  --radius: 12px;
  --radius-lg: 20px;
  --max: 1120px;
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Background mesh */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(61, 212, 192, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(100, 120, 255, 0.06), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(61, 212, 192, 0.05), transparent),
    var(--bg);
  pointer-events: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(12, 15, 20, 0.85);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #5a8ff0);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--bg);
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-main a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

.nav-main a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.nav-main a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-dim);
}

/* Dropdown */
.nav-item {
  position: relative;
}

.nav-item > button {
  font: inherit;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s, background 0.15s;
}

.nav-item > button:hover,
.nav-item:focus-within > button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item > button .chevron {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.7;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.35rem;
  min-width: 200px;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

.dropdown a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.dropdown a strong {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.dropdown a span {
  font-size: 0.8125rem;
  opacity: 0.85;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

/* Layout */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Hero */
.hero {
  padding: 4.5rem 0 5rem;
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 4rem;
  }
}

.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.35rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
}

.hero-lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin: 0 0 1.75rem;
  max-width: 36ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #4ae8d4);
  color: #062420;
  box-shadow: 0 8px 28px var(--accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 12px 36px var(--accent-glow);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hero-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #5a8ff0);
}

.hero-card h2 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.stat {
  text-align: center;
  padding: 1rem 0.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat span {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Sections */
section {
  padding: 4rem 0;
}

section h2.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.section-intro {
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 0 2.5rem;
}

.benefits-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .benefits-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.benefit-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.benefit-card:hover {
  border-color: rgba(61, 212, 192, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.benefit-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-dim);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.benefit-card h3,
.benefit-card h4 {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.benefit-card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* Project sections */
.projects-band {
  background: linear-gradient(180deg, transparent, rgba(20, 26, 36, 0.5) 15%, rgba(20, 26, 36, 0.5) 85%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.portfolio-preview {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.portfolio-preview__intro .eyebrow {
  margin-bottom: 0.85rem;
}

.portfolio-preview__intro .section-intro {
  max-width: 62ch;
  margin-bottom: 2.25rem;
}

/* Home: two-lane “bento” panels (always expanded—no accordion) */
.home-focus-panels {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 960px) {
  .home-focus-panels {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 1.75rem;
  }
}

.home-focus-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 1.75rem 1.5rem 1.65rem 1.65rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 28px 56px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-focus-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 32px 64px rgba(0, 0, 0, 0.42);
}

.home-focus-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(61, 212, 192, 0.45) 100%);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  pointer-events: none;
}

.home-focus-panel--web::before {
  background: linear-gradient(180deg, #8eb4ff 0%, rgba(90, 143, 240, 0.5) 100%);
}

.home-focus-panel__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.home-focus-panel__title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
  color: var(--text);
}

.home-focus-panel__lede {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 52ch;
}

.home-focus-panel__grid .benefit-card {
  background: rgba(12, 15, 20, 0.45);
  border-color: rgba(255, 255, 255, 0.06);
}

/* Side-by-side panels are half-width; cap inner grid at two columns */
@media (min-width: 960px) {
  .home-focus-panel__grid.benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.home-focus-panel__cta {
  margin-top: auto;
  padding-top: 0.35rem;
}

.home-focus-panel__cta .btn {
  width: 100%;
  text-align: center;
}

@media (min-width: 480px) {
  .home-focus-panel__cta .btn {
    width: auto;
  }
}

/* Projects hub (split mobile / web) */
.projects-hub {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

@media (min-width: 720px) {
  .projects-hub {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

.projects-hub-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.65rem 1.4rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.projects-hub-card:hover {
  border-color: rgba(61, 212, 192, 0.28);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  text-decoration: none;
}

.projects-hub-card h2 {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

.projects-hub-card p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
  flex: 1;
}

.projects-hub-cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

.projects-hub-card:hover .projects-hub-cta {
  text-decoration: underline;
}

.project-category {
  scroll-margin-top: calc(var(--header-h) + 24px);
  margin-bottom: 3.5rem;
}

.project-category:last-child {
  margin-bottom: 0;
}

.app-group {
  margin-bottom: 2.5rem;
}

.app-group:last-child {
  margin-bottom: 0;
}

.app-group-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.app-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.app-links a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.app-links a:hover {
  text-decoration: underline;
}

.store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin-top: 0.85rem;
}

/* Apple “Download on the App Store” badge (asset in /images per Apple marketing guidelines) */
a.app-store-badge {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
  border-radius: 6px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

a.app-store-badge:hover {
  text-decoration: none;
  transform: scale(1.02);
  opacity: 0.92;
}

a.app-store-badge img {
  display: block;
  width: 120px;
  height: auto;
}

@media (max-width: 480px) {
  a.app-store-badge img {
    width: 110px;
  }
}

.developer-store-note {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.developer-store-note a {
  color: var(--accent);
  font-weight: 500;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.category-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
}

.category-badge.web {
  background: rgba(90, 143, 240, 0.2);
  color: #8eb4ff;
}

.project-category h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
}

.project-list {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .project-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s;
}

.project-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.project-card h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.project-card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.project-card > p:first-of-type {
  flex: 1;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.site-footer p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Projects page */
.page-hero {
  padding: 3rem 0 2rem;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
}

.page-hero p {
  margin: 0;
  color: var(--text-muted);
  max-width: 52ch;
}

/* About page */
.about-page .about-section {
  padding-bottom: 1rem;
  max-width: 65ch;
}

.about-page .about-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
  color: var(--text);
}

.about-page .about-section h3 {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 1.75rem 0 0.65rem;
  color: var(--text);
}

.about-page .about-section p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.about-page .about-section p strong {
  color: var(--text);
}

.about-page .about-section ul {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.about-page .about-section li + li {
  margin-top: 0.5rem;
}

.about-linkedin {
  margin-top: 1rem;
  margin-bottom: 3rem;
  max-width: 65ch;
  padding: 1.35rem 1.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.about-linkedin p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.subnav a {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.subnav a:hover {
  color: var(--text);
  border-color: rgba(61, 212, 192, 0.35);
  text-decoration: none;
}

/* Mobile nav — compact panel under header, aligned with hamburger (right) */
@media (max-width: 768px) {
  .site-header {
    z-index: 200;
  }

  .menu-toggle {
    display: flex;
    position: relative;
    z-index: 202;
  }

  .nav-main {
    position: fixed;
    top: calc(var(--header-h) + 10px + env(safe-area-inset-top, 0px));
    right: max(1rem, env(safe-area-inset-right, 0px));
    left: auto;
    bottom: auto;
    width: min(17.75rem, calc(100vw - 2rem));
    max-height: min(calc(100vh - var(--header-h) - 1.25rem), 75vh);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    flex-direction: column;
    align-items: stretch;
    padding: 0.45rem;
    gap: 0.1rem;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.04) inset,
      0 24px 56px rgba(0, 0, 0, 0.55);

    transform-origin: top right;
    transform: translateY(-10px) scale(0.97);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.2s ease,
      transform 0.2s ease,
      visibility 0.2s;

    z-index: 201;
  }

  body.nav-open .nav-main {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-main a,
  .nav-item > button {
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    font-size: 0.9375rem;
  }

  .nav-item > button .chevron {
    margin-left: auto;
  }

  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-width: 0;
    margin: 0.15rem 0 0.35rem;
    padding: 0.35rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(12, 15, 20, 0.55);
    box-shadow: none;
    display: none;
  }

  .nav-item.open .dropdown {
    display: block;
  }

  .dropdown a {
    padding: 0.55rem 0.65rem;
  }

  .stat-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .nav-main {
    transition-duration: 0.01ms;
  }
}
