/*
  LESSON 2: STYLING WITH CSS
  CSS rules look like:   selector { property: value; }
  - "body" targets the <body> tag
  - ".btn" (with a dot) targets anything with class="btn"
  - "#about" (with a #) targets the element with id="about"

  THEME: "Bold & dark" — near-black background, electric blue-to-cyan accent,
  Space Grotesk headings + Inter body text.
*/

/* ---------- Variables ----------
   Define colors once here, reuse everywhere with var(--name).
   Want a new color scheme? Change it in one place. Try it! */
:root {
  --bg: #0b0d12;            /* page background: almost black */
  --bg-alt: #10131a;        /* slightly lighter band for alternating sections */
  --surface: #151924;       /* cards */
  --surface-hover: #1a1f2d;
  --text: #f2f4f8;          /* main text: near-white */
  --muted: #9aa3b5;         /* secondary text: soft gray */
  --border: #232a3a;
  --accent: #4f8cff;        /* electric blue */
  --accent-2: #22d3ee;      /* cyan, used for gradients */
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --radius: 14px;
  --max-width: 1120px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
}

/* ---------- Reset & base ----------
   box-sizing: border-box makes width math predictable (padding is included). */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }  /* smooth scrolling when clicking nav links */

/* Stops the sticky header from covering section titles after a nav click */
section[id] { scroll-margin-top: 70px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo { font-family: var(--font-head); letter-spacing: -0.02em; }

a { color: var(--accent-2); }

/* .container centers content and keeps it from getting too wide */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;     /* "auto" left/right margins = centered */
  padding: 0 20px;
}

.center { text-align: center; }

/* ---------- Header ----------
   position: sticky keeps the header stuck to the top while scrolling.
   The semi-transparent background + blur gives a "frosted glass" look. */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(11, 13, 18, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

/* FLEXBOX: lays children out in a row. One of the most useful CSS tools. */
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;  /* logo left, nav right */
  height: 70px;
}

.logo {
  font-weight: 700;
  font-size: 1.3rem;
  text-decoration: none;
  color: var(--text);
}
/* "Web Studio" part of the name: cyan and a bit lighter than "Andrew Gates" */
.logo span { color: var(--accent-2); font-weight: 500; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s;
}
.nav a:hover { color: var(--text); }  /* :hover = when the mouse is over it */

/* The "Get a quote" link styled as a small gradient button */
.nav a.nav-cta {
  background: var(--gradient);
  color: #06111f;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
}
.nav a.nav-cta:hover { filter: brightness(1.1); }

.nav-toggle {
  display: none;  /* hidden on desktop; shown in the phone section below */
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text);
}

/* ---------- Hero ----------
   Two layered backgrounds: a soft blue "glow" (radial-gradient) on top of a
   faint grid pattern made from two thin linear-gradients. No images needed! */
.hero {
  position: relative;
  padding: 140px 0 120px;
  overflow: hidden;
  background:
    radial-gradient(600px 400px at 80% 10%, rgba(79, 140, 255, 0.25), transparent 70%),
    radial-gradient(500px 350px at 10% 90%, rgba(34, 211, 238, 0.12), transparent 70%),
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px) 0 0 / 48px 48px;
}

/* The little "pill" label above the headline */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 28px;
}
.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;                         /* green "open for business" dot */
  box-shadow: 0 0 10px #34d399;
}

.hero h1 {
  /* clamp(min, preferred, max) = text that scales with screen width */
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.05;
  font-weight: 700;
  max-width: 900px;
  margin-bottom: 24px;
}

/* Gradient text trick: paint the gradient as the background, then clip it to the letters */
.highlight {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 600px;
  margin-bottom: 40px;
}

.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;  /* animates the hover change */
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--gradient);
  color: #06111f;
  box-shadow: 0 8px 30px rgba(79, 140, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 12px 40px rgba(79, 140, 255, 0.5); }

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
.btn-outline:hover { border-color: var(--muted); }

.btn-light { background: #fff; color: #06111f; }

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section h2 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 16px;
}
.section p { margin-bottom: 16px; max-width: 720px; color: var(--muted); }
.section-intro { margin-bottom: 40px !important; font-size: 1.1rem; }
.center p { margin-left: auto; margin-right: auto; }

/* ---------- Service cards ----------
   CSS GRID: auto-fit + minmax makes as many columns as fit,
   each at least 280px wide. Fully responsive with zero media queries. */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 140, 255, 0.5);
  background: var(--surface-hover);
}

/* Icon sits in a small tinted square */
.card-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  border-radius: 12px;
  background: rgba(79, 140, 255, 0.12);
  border: 1px solid rgba(79, 140, 255, 0.25);
  margin-bottom: 18px;
}
.card h3 { margin-bottom: 8px; font-size: 1.2rem; }
.card p { margin-bottom: 0; }

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 140, 255, 0.5);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.project-card--placeholder { border-style: dashed; background: transparent; }

/* When you add screenshots, this makes any <img> fill the thumbnail area neatly */
.project-thumb {
  height: 190px;
  display: grid;
  place-items: center;   /* centers the emoji both ways */
  font-size: 3.2rem;
  background:
    radial-gradient(circle at 30% 20%, rgba(79, 140, 255, 0.25), transparent 60%),
    var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
/* The image is pinned to fill the thumbnail box exactly (position: absolute + inset: 0).
   object-fit: cover crops instead of stretching; object-position: top keeps the logo + headline in view. */
.project-thumb { position: relative; }
.project-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.project-body { padding: 24px; }
.project-type {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2) !important;
  margin-bottom: 6px !important;
}
.project-body h3 { margin-bottom: 8px; font-size: 1.3rem; }
.project-body a { font-weight: 600; text-decoration: none; }

/* ---------- Process steps ----------
   "counter" lets CSS number the steps itself, so we can style the numbers. */
.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.steps li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.steps li::before {
  content: "0" counter(step);   /* prints 01, 02, 03 */
  display: block;
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 14px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.steps h3 { margin-bottom: 6px; font-size: 1.2rem; }
.steps p { margin-bottom: 0; }

/* ---------- Contact ---------- */
.contact {
  background:
    radial-gradient(700px 300px at 50% 0%, rgba(79, 140, 255, 0.22), transparent 70%),
    var(--bg-alt);
  border-top: 1px solid var(--border);
}
.contact .btn { margin: 12px 0 28px; }
.contact-note { font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

/* ---------- Phones ----------
   MEDIA QUERY: rules inside only apply when the screen is 760px wide or less. */
@media (max-width: 760px) {
  .nav-toggle { display: block; }

  .nav {
    display: none;              /* hide the menu until the button is tapped */
    position: absolute;
    top: 70px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  .nav a { padding: 14px 20px; }
  .nav a.nav-cta { margin: 8px 20px 14px; text-align: center; }

  /* script.js adds the "open" class when the ☰ button is tapped */
  .nav.open { display: flex; }

  .hero { padding: 90px 0 80px; }
  .section { padding: 70px 0; }
}
