/* ==========================================================================
   Massey Tech Co LLC — Design System
   Vanilla CSS. No build step. Mobile-first.
   ========================================================================== */

:root {
  /* Palette */
  --bg:            #0b1220;   /* deep navy */
  --bg-alt:        #0e1626;   /* section alt */
  --surface:       #131d31;   /* cards */
  --surface-2:     #18243b;   /* hover / raised */
  --border:        #223048;
  --border-soft:   #1b2740;

  --text:          #eaf1fb;
  --text-muted:    #9db0cc;
  --text-dim:      #6f83a3;

  --accent:        #38bdf8;   /* sky blue */
  --accent-strong: #0ea5e9;
  --accent-ink:    #04121f;   /* text on accent */
  --accent-glow:   rgba(56, 189, 248, 0.22);

  --success:       #34d399;
  --danger:        #f87171;

  /* Type */
  --font-head: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --maxw: 1140px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.65);
  --shadow-accent: 0 20px 50px -22px var(--accent-glow);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: var(--accent); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: var(--accent-strong); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0 0 .5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; color: var(--text-muted); }

ul { color: var(--text-muted); }

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

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 22px;
}

.section { padding: clamp(56px, 9vw, 110px) 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border-soft); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  font-weight: 600;
}

.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { font-size: 1.08rem; }

.lead { font-size: 1.18rem; color: var(--text-muted); max-width: 640px; }

.text-center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .98rem;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--accent-ink);
  box-shadow: var(--shadow-accent);
}
.btn--primary:hover { color: var(--accent-ink); transform: translateY(-2px); box-shadow: 0 24px 55px -20px var(--accent-glow); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { color: var(--text); border-color: var(--accent); background: var(--surface); }

.btn--block { width: 100%; justify-content: center; }
.btn--lg { padding: 16px 32px; font-size: 1.05rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 18, 32, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--border-soft);
  background: rgba(11, 18, 32, 0.9);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.16rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--text); }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__name b { color: var(--accent); font-weight: 700; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  color: var(--text-muted);
  font-size: .96rem;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: 8px;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav__links a:hover { color: var(--text); background: var(--surface); }
.nav__links a[aria-current="page"] { color: var(--accent); }

.nav__cta { margin-left: 6px; }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 0 11px;
}
.nav__toggle span {
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(70px, 12vw, 140px) 0 clamp(60px, 9vw, 110px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% 30% auto -10%;
  height: 620px;
  background: radial-gradient(60% 60% at 50% 40%, var(--accent-glow), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(80% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(80% 60% at 50% 30%, #000 30%, transparent 75%);
  opacity: .5;
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.hero__inner { max-width: 780px; }
.hero h1 { margin-bottom: 20px; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), #a5f3fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub { font-size: 1.22rem; color: var(--text-muted); max-width: 620px; margin-bottom: 32px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }

.badge-row { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .9rem; color: var(--text-dim); font-weight: 500;
}
.badge svg { width: 17px; height: 17px; color: var(--accent); flex: none; }

/* ---------- Cards / Grid ---------- */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
  position: relative;
  height: 100%;
}
.card--link:hover {
  transform: translateY(-4px);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.card__icon {
  width: 50px; height: 50px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(56,189,248,.16), rgba(56,189,248,.04));
  border: 1px solid var(--border);
  color: var(--accent);
  margin-bottom: 18px;
}
.card__icon svg { width: 26px; height: 26px; }
.card h3 { margin-bottom: 8px; }
.card p { margin-bottom: 0; font-size: .98rem; }
.card__more {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px; font-weight: 600; font-size: .92rem;
  font-family: var(--font-head);
}
.card__more svg { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.card--link:hover .card__more svg { transform: translateX(3px); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat {
  text-align: center;
  padding: 26px 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.stat__num {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}
.stat__label { font-size: .9rem; color: var(--text-dim); }

/* ---------- Service detail blocks ---------- */
.svc {
  scroll-margin-top: 96px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: clamp(40px, 6vw, 72px) 0;
  border-bottom: 1px solid var(--border-soft);
}
.svc:last-child { border-bottom: 0; }
.svc:nth-child(even) .svc__media { order: -1; }
.svc__badge {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--accent);
  background: rgba(56,189,248,.08);
  border: 1px solid var(--border);
  padding: 7px 14px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 600; font-size: .85rem;
  margin-bottom: 18px;
}
.svc__badge svg { width: 18px; height: 18px; }
.svc h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.feature-list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-muted); }
.feature-list svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 3px; }

.svc__media {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  min-height: 240px;
  display: grid;
  align-content: center;
  gap: 14px;
}
.svc__media .code-line {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--border), transparent);
}
.svc__media .code-line.accent { background: linear-gradient(90deg, var(--accent), transparent); opacity: .55; }

/* ---------- Process steps ---------- */
.steps { counter-reset: step; display: grid; gap: 20px; }
.step {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start;
  padding: 24px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
}
.step__n {
  counter-increment: step;
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  font-family: var(--font-head); font-weight: 700; font-size: 1.15rem;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}
.step__n::before { content: counter(step, decimal-leading-zero); }
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; font-size: .97rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.value-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.value-list li {
  padding: 20px 22px; background: var(--surface);
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.value-list strong { color: var(--text); font-family: var(--font-head); display: block; margin-bottom: 4px; }
.value-list span { color: var(--text-muted); font-size: .96rem; }

.founder-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  position: sticky; top: 96px;
}
.founder-card__avatar {
  width: 96px; height: 96px; margin: 0 auto 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 2rem;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}
.founder-card h3 { margin-bottom: 2px; }
.founder-card .role { color: var(--accent); font-size: .92rem; font-family: var(--font-head); margin-bottom: 16px; }

/* ---------- Portfolio placeholder ---------- */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.work-card {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px;
  min-height: 220px;
  display: flex; flex-direction: column; justify-content: flex-end;
  position: relative;
  overflow: hidden;
}
.work-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(70% 60% at 30% 20%, rgba(56,189,248,.08), transparent 70%);
}
.work-card .tag {
  position: relative;
  align-self: flex-start;
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; margin-bottom: auto; font-family: var(--font-head);
}
.work-card h3 { position: relative; color: var(--text-muted); margin-bottom: 4px; }
.work-card p { position: relative; margin: 0; font-size: .92rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }

.contact-info { display: grid; gap: 16px; }
.info-item {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 20px; background: var(--surface);
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.info-item__icon {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center; border-radius: 11px;
  background: rgba(56,189,248,.1); border: 1px solid var(--border); color: var(--accent);
}
.info-item__icon svg { width: 22px; height: 22px; }
.info-item .label { font-size: .8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 3px; }
.info-item .value { color: var(--text); font-weight: 500; }
.info-item a.value:hover { color: var(--accent); }

/* ---------- Forms ---------- */
.form {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 30px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: .9rem; font-weight: 500;
  color: var(--text); margin-bottom: 7px; font-family: var(--font-head);
}
.field label .req { color: var(--accent); }
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field textarea { resize: vertical; min-height: 130px; }
.field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239db0cc' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }

.form__note { font-size: .85rem; color: var(--text-dim); margin: 4px 0 0; }

.form-status {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: .95rem;
}
.form-status.is-success { display: block; background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.4); color: var(--success); }
.form-status.is-error { display: block; background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.4); color: var(--danger); }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(40px, 6vw, 64px);
  text-align: center;
  overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; inset: auto 20% -60% 20%; height: 300px;
  background: radial-gradient(50% 60% at 50% 50%, var(--accent-glow), transparent 70%);
}
.cta-band > * { position: relative; }
.cta-band h2 { margin-bottom: 12px; }
.cta-band p { max-width: 520px; margin: 0 auto 28px; font-size: 1.1rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border-soft);
  padding: 56px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand p { max-width: 340px; font-size: .95rem; margin-top: 14px; }
.footer-col h4 {
  font-size: .82rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-dim); margin-bottom: 16px; font-family: var(--font-head);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--text-muted); font-size: .95rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px solid var(--border-soft);
  font-size: .87rem; color: var(--text-dim);
}
.footer-bottom a { color: var(--text-dim); }

/* ---------- 404 ---------- */
.error-page {
  min-height: 70vh; display: grid; place-items: center; text-align: center;
}
.error-page .code {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(5rem, 18vw, 10rem); line-height: 1;
  background: linear-gradient(120deg, var(--accent), #a5f3fc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 8px; font-weight: 600; z-index: 100;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; color: var(--accent-ink); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .founder-card { position: static; max-width: 420px; }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .nav__links {
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: rgba(11,18,32,.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 16px 22px 24px;
    transform: translateY(-140%);
    transition: transform .3s var(--ease);
    box-shadow: var(--shadow);
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }
  .nav__links.is-open { transform: none; }
  .nav__links a { padding: 13px 14px; font-size: 1.05rem; border-radius: 10px; }
  .nav__links a:hover { background: var(--surface); }
  .nav__cta { margin: 8px 0 0; }
  .nav__cta .btn { width: 100%; justify-content: center; }
  .nav__toggle { display: flex; }

  .svc { grid-template-columns: 1fr; gap: 28px; }
  .svc:nth-child(even) .svc__media { order: 0; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero__actions .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
