/* ===========================================================
   MJC IT — Portfolio site
   Dark-first, modern, mobile-first
   =========================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

:root {
  --bg:        rgb(255,255,255);
  --bg-alt:    rgb(245,247,250);
  --bg-elev:   rgb(255,255,255);
  --fg:        rgb(17,24,39);
  --fg-muted:  rgb(90,100,116);
  --border:    rgb(224,228,234);
  --primary:   rgb(31,143,255);
  --primary-2: rgb(59,130,246);
  --accent:    rgb(249,116,21);
  --shadow-md: 0 6px 18px rgba(17,24,39,0.08);
  --shadow-lg: 0 24px 48px rgba(17,24,39,0.12);
  --radius:    14px;
  --radius-lg: 22px;
  --container: 1180px;
}

[data-theme="dark"] {
  --bg:        rgb(11,18,32);
  --bg-alt:    rgb(16,24,40);
  --bg-elev:   rgb(20,29,46);
  --fg:        rgb(236,240,247);
  --fg-muted:  rgb(156,168,186);
  --border:    rgb(38,49,69);
  --primary:   rgb(96,165,250);
  --primary-2: rgb(59,130,246);
  --accent:    rgb(251,146,60);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.35);
  --shadow-lg: 0 24px 48px rgba(0,0,0,0.5);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-wrap: break-word;
  transition: background-color .3s ease, color .3s ease;
  position: relative;
}
h1, h2, h3, p, a { overflow-wrap: anywhere; }

/* ===== PARALLAX BACKDROP ===== */
.parallax-bg {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  will-change: transform;
  transition: transform 0.05s linear;
}
.orb-1 { width: 380px; height: 380px; top: 8%;  left: -8%;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%); }
.orb-2 { width: 300px; height: 300px; top: 38%; right: -10%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%); opacity: 0.45; }
.orb-3 { width: 480px; height: 480px; top: 70%; left: 30%;
  background: radial-gradient(circle, var(--primary-2) 0%, transparent 70%); opacity: 0.35; }
.orb-4 { width: 260px; height: 260px; top: 110%; right: 10%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%); opacity: 0.4; }

/* Lift content above the parallax layer */
.nav, .hero, .section, .footer { position: relative; z-index: 1; }

/* Sticky section heads — sit BEHIND content so cards scroll over them */
.section-head {
  position: sticky;
  top: 78px;
  z-index: 0;
  padding: 18px 16px 26px;
  border-radius: 18px;
  background: transparent;
}
.section-alt .section-head { background: transparent; }

/* Ensure interactive content layers above the sticky heading */
.product,
.arch-wrap,
.arch-grid,
.customers,
.contact-wrap {
  position: relative;
  z-index: 1;
}

/* Disable sticky + heavy parallax on small screens */
@media (max-width: 759px) {
  .section-head { position: static; padding: 0; }
  .orb { filter: blur(50px); opacity: 0.35; }
  .orb-1 { width: 240px; height: 240px; }
  .orb-2 { width: 200px; height: 200px; }
  .orb-3 { width: 280px; height: 280px; }
  .orb-4 { width: 180px; height: 180px; }
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 18px; }
@media (min-width: 600px) { .container { padding: 0 24px; } }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.2rem; font-weight: 700; }
p  { color: var(--fg-muted); }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.accent { color: var(--accent); }

/* ===== NAV ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 12px;
}
@media (min-width: 600px) { .nav-inner { height: 68px; gap: 16px; } }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 800; }
.brand-text { font-size: 1.15rem; letter-spacing: -0.01em; }
.brand-dot { color: var(--accent); }
.nav-links { display: none; gap: 26px; }
.nav-links a { color: var(--fg-muted); font-weight: 500; }
.nav-links a:hover { color: var(--fg); }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); color: var(--fg);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elev);
}
.theme-toggle svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

@media (min-width: 768px) { .nav-links { display: inline-flex; } }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 22px; border-radius: 12px; font-weight: 600;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; box-shadow: var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); color: #fff; }
.btn-ghost {
  background: var(--bg-elev); color: var(--fg);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-alt); color: var(--fg); }

/* ===== HERO ===== */
.hero {
  position: relative; padding: 40px 0 56px;
  background:
    radial-gradient(60% 80% at 80% 0%, color-mix(in srgb, var(--primary) 18%, transparent) 0%, transparent 60%),
    radial-gradient(50% 60% at 0% 100%, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 60%),
    var(--bg);
}
.hero-inner {
  display: grid; grid-template-columns: 1fr; gap: 48px; align-items: center;
}
@media (min-width: 980px) {
  .hero { padding: 96px 0 120px; }
  .hero-inner { grid-template-columns: 1.1fr 1fr; gap: 56px; }
}
.hero-copy h1 { margin-bottom: 18px; }
.lede { font-size: 1.15rem; max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-stats {
  list-style: none; display: grid; grid-template-columns: 1fr;
  gap: 10px; margin-top: 32px; padding: 0;
}
@media (min-width: 520px) {
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 40px; }
}
.hero-stats li {
  display: flex; flex-direction: column;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elev);
}
.hero-stats strong { font-size: 0.95rem; color: var(--fg); }
.hero-stats span { font-size: 0.78rem; color: var(--fg-muted); }

/* Hero visual cluster */
.hero-visual {
  position: relative;
  display: flex; justify-content: center; align-items: center;
  padding: 24px 0;
  min-height: 0;
}
.hero-tablet {
  width: 100%; max-width: 520px;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transform: rotate(-2deg);
}
.hero-phone {
  position: absolute;
  width: 26%; max-width: 150px;
  border-radius: 22px;
  filter: drop-shadow(0 14px 24px rgba(0,0,0,0.35));
}
.hero-phone-1 { left: 4%;  bottom: -4%; transform: rotate(-8deg); }
.hero-phone-2 { right: 4%; top: -2%;    transform: rotate(8deg); }
@media (min-width: 980px) {
  .hero-visual { padding: 0; min-height: 380px; }
  .hero-phone-1 { left: -2%;  bottom: -8%; }
  .hero-phone-2 { right: -2%; top: -6%; }
}

/* ===== SECTIONS ===== */
.section { padding: 56px 0; }
@media (min-width: 760px) { .section { padding: 88px 0; } }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
@media (min-width: 760px) { .section-head { margin-bottom: 56px; } }
.section-head p { margin-top: 14px; font-size: 1.05rem; }

/* ===== PRODUCT BLOCK ===== */
.product {
  display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
}
@media (min-width: 880px) {
  .product { grid-template-columns: 1.1fr 1fr; padding: 40px; gap: 48px; }
}
.product-media img { border-radius: var(--radius); box-shadow: var(--shadow-md); }
.product-body h3 { font-size: 1.6rem; margin-bottom: 18px; }

.check-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.check-list li {
  position: relative; padding-left: 30px; color: var(--fg);
}
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: inset 0 0 0 4px var(--bg-elev);
}

/* Screenshots */
.screens {
  margin-top: 48px;
  display: grid; gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .screens { grid-template-columns: repeat(2, 1fr); }
  .screen-wide { grid-column: span 2; }
}
@media (min-width: 1080px) {
  .screens { grid-template-columns: 1fr 1fr 2fr; }
  .screen-wide { grid-column: auto; }
}
.screen {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-md);
}
.screen img { border-radius: 10px; }
.screen figcaption {
  margin-top: 10px; text-align: center;
  font-size: 0.85rem; color: var(--fg-muted);
}

/* ===== ARCHITECTURE ===== */
.arch-wrap {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
}
@media (min-width: 760px) { .arch-wrap { padding: 24px; } }
.arch-diagram {
  display: block; width: 100%; height: auto;
  color: var(--fg-muted);
}
.arch-lines { color: color-mix(in srgb, var(--primary) 60%, var(--fg-muted)); opacity: 0.7; }

.arch-grid {
  margin-top: 40px;
  display: grid; grid-template-columns: 1fr; gap: 18px;
}
@media (min-width: 760px) { .arch-grid { grid-template-columns: repeat(3, 1fr); } }
.arch-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.arch-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.arch-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 14px;
}
.arch-card h3 { margin-bottom: 6px; }

/* ===== CUSTOMERS ===== */
.origin-note {
  max-width: 720px;
  margin: 0 auto 32px;
  padding: 18px 22px;
  border-left: 3px solid var(--accent);
  background: var(--bg-elev);
  border-radius: var(--radius);
  color: var(--fg-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}
.origin-note strong { color: var(--fg); }

.customers {
  display: grid; grid-template-columns: 1fr; gap: 20px;
}
@media (min-width: 720px) { .customers { grid-template-columns: 1fr 1fr; } }
.customer-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
  color: var(--fg);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
@media (min-width: 600px) { .customer-card { padding: 32px; } }
.customer-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  color: var(--fg);
}
.customer-logo {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 800; letter-spacing: 0.04em;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.customer-logo-img {
  width: auto; min-width: 72px; height: 64px;
  border-radius: 12px;
  background: #fff;
  padding: 8px 14px;
  border: 1px solid var(--border);
}
.customer-logo-img img {
  height: 100%; width: auto; object-fit: contain;
}
.customer-link {
  margin-top: auto; padding-top: 12px;
  font-weight: 600; color: var(--primary);
}

/* ===== CONTACT ===== */
.contact-wrap {
  display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center;
}
@media (min-width: 880px) {
  .contact-wrap { grid-template-columns: 2fr 1fr; gap: 56px; }
}
.contact-actions { display: flex; flex-direction: column; gap: 12px; }
.contact-actions .btn { width: 100%; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  background: var(--bg-alt);
}
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  justify-content: space-between;
}
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--fg-muted); font-size: 0.92rem; }
.footer-links a:hover { color: var(--fg); }
.footer small { color: var(--fg-muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
