/*
  ============================================================
  NEXLINE TECHNOLOGIES — Stylesheet
  File: styles.css

  MODULE 2: Styling with CSS

  WHAT IS CSS?
  If HTML is the layout's OBJECTS, CSS is the INSPECTOR —
  fill color, font, size, padding, borders, position.
  Instead of clicking each object, you write RULES that
  apply to every matching object at once (like a FileMaker
  THEME, but you write it yourself).

  HOW A CSS RULE IS BUILT:

      .card {                    <- SELECTOR: which things to style
        background: white;       <- PROPERTY: VALUE;
        padding: 24px;           <- every line ends with a semicolon
      }

  SELECTOR CHEAT SHEET:
      h1           -> every <h1> tag
      .card        -> anything with class="card"   (dot = class)
      #contact     -> the one thing with id="contact" (# = id)
      .card h3     -> any <h3> that's INSIDE a .card
      a:hover      -> a link while the mouse is over it

  "CASCADING" = later rules and more specific rules win,
  so the order of this file matters a little.

  This file is organized top to bottom:
    1. Design tokens (colors, fonts) — the "theme settings"
    2. Base styles (the whole page)
    3. Layout helpers (container, sections)
    4. Components (header, buttons, cards, footer)
    5. Mobile adjustments
  ============================================================
*/


/* ============================================================
   1. DESIGN TOKENS (CSS variables)

   :root = the very top of the page. Variables defined here
   can be used anywhere with var(--name).

   FileMaker analogy: these are like GLOBAL VARIABLES ($$navy)
   or a custom theme's color swatches. Change a color HERE and
   it updates everywhere it's used. That's the whole point —
   never type #101D2F in 20 places.
   ============================================================ */
:root {
  /* --- Brand colors --- */
  --navy:       #101D2F;   /* Midnight Navy: primary (headings, dark sections) */
  --teal:       #087F8C;   /* Deep Teal: accent (buttons, highlights) */
  --teal-dark:  #066973;   /* Slightly darker teal for button hover */
  --off-white:  #F8FAFC;   /* Page background */
  --slate:      #475569;   /* Secondary/body text */
  --white:      #FFFFFF;   /* Cards and clean sections */
  --border:     #E2E8F0;   /* Very light gray for card outlines */

  /* --- Fonts ---
     If the first font can't load, the browser tries the next one
     in the list. "sans-serif" = "any clean font you have." */
  --font-heading: "Manrope", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;

  /* --- Shape & spacing --- */
  --radius:    12px;       /* Subtle rounded corners */
  --max-width: 1120px;     /* Widest the content gets on big screens */
}


/* ============================================================
   2. BASE STYLES — rules for the whole page
   ============================================================ */

/* The * selector means "EVERYTHING."
   box-sizing: border-box makes width math sane: when you say a
   box is 300px wide, the padding and border fit INSIDE that
   300px instead of being added on top. (FileMaker objects
   already work this way — the web didn't by default.) */
* {
  box-sizing: border-box;
}

/* Smooth scrolling when you click a menu link like #services,
   instead of an instant jump. */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;                      /* Browsers add a default 8px margin — remove it */
  background: var(--off-white);   /* Page background color */
  color: var(--slate);            /* Default text color */
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;               /* Space between lines: 1.7 x the font size. Easier to read. */
}

/* Headings: all of them at once (commas = "this rule applies to all of these") */
h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--navy);
  line-height: 1.2;               /* Headings look better with tighter lines */
  margin: 0 0 16px;               /* margin: top right&left bottom -> only space BELOW */
}

/* clamp(MIN, PREFERRED, MAX) = responsive font size.
   It grows with the screen width (vw = % of the window width)
   but never gets smaller than MIN or bigger than MAX. */
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem);  font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; font-weight: 700; }

/* "rem" = a multiple of the base font size. 1rem ≈ 16px.
   So 2.5rem ≈ 40px. Using rem keeps everything proportional. */

p {
  margin: 0 0 16px;
}

/* Links: teal, no underline until you hover */
a {
  color: var(--teal);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}


/* ============================================================
   3. LAYOUT HELPERS
   ============================================================ */

/* The centered content box.
   max-width = never wider than 1120px.
   margin: 0 auto = "0 top/bottom, AUTOMATIC left/right" ->
   the browser splits the leftover space evenly = centered.
   padding: 0 24px = breathing room on the sides on phones. */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* A thinner container for text-heavy sections.
   Long lines of text are tiring to read — ~70 characters is ideal. */
.container.narrow {
  max-width: 760px;
}

/* Center-aligned text (used in the contact section) */
.center {
  text-align: center;
}

/* Every main section gets generous space above and below.
   padding = space INSIDE the box (like FileMaker's inspector
   padding). margin = space OUTSIDE the box. */
.section {
  padding: 96px 0;
}

/* Section color variations */
.section-white {
  background: var(--white);
  /* A thin line above and below so it reads as its own band */
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-dark {
  background: var(--navy);
  color: #CBD5E1;                 /* Light gray text on navy */
}
/* Headings inside a dark section turn white.
   ".section-dark h2" = any h2 INSIDE .section-dark */
.section-dark h2,
.section-dark h3 {
  color: var(--white);
}

.small {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-top: 24px;
}


/* ============================================================
   4. COMPONENTS
   ============================================================ */

/* ---------- HEADER ---------- */

/* position: sticky + top: 0 = the header sticks to the top of
   the window as you scroll. (Like a FileMaker header part that
   stays put in Browse mode.) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;                    /* z-index = stacking order. Higher = on top. Like "Bring to Front." */
  background: rgba(255, 255, 255, 0.9);   /* White at 90% opacity */
  backdrop-filter: blur(8px);     /* Blurs what scrolls behind it — the "frosted glass" look */
  border-bottom: 1px solid var(--border);
}

/* FLEXBOX — the most useful layout tool in CSS.
   display: flex lines up the children (logo + nav) in a ROW.
   justify-content: space-between -> push them to opposite ends.
   align-items: center -> center them vertically.
   FileMaker analogy: like selecting objects and using
   Arrange > Align + Distribute, but automatic and responsive. */
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

/* ---------- LOGO ----------
   Distinct from the textile company's logo (black text with
   a blue "X"): ours is a navy wordmark with a small teal
   bar mark and "TECHNOLOGIES" spaced out underneath. */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;                      /* gap = space between flex children */
  text-decoration: none !important;   /* No underline on hover for the logo */
}

/* The little teal shape left of the name. It's an empty <span>
   that we give a size and color — pure CSS, no image file. */
.logo-mark {
  width: 10px;
  height: 32px;
  border-radius: 3px;
  background: var(--teal);
}

/* Stacks "NEXLINE" over "TECHNOLOGIES" (flex-direction: column
   = top-to-bottom instead of left-to-right). */
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--navy);
  letter-spacing: 0.04em;
}

.logo-sub {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.62rem;
  color: var(--slate);
  letter-spacing: 0.32em;         /* Wide letter spacing = premium feel */
  margin-top: 4px;
}

/* ---------- NAVIGATION ---------- */
.nav-links {
  display: flex;                  /* Menu items in a row */
  align-items: center;
  gap: 32px;
  list-style: none;               /* Hide the bullet points */
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--navy);
  font-weight: 500;
  font-size: 0.95rem;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-block;          /* Lets a link have padding like a box */
  background: var(--teal);
  color: var(--white);
  font-weight: 600;
  padding: 14px 28px;             /* 14px top/bottom, 28px left/right */
  border-radius: 8px;
  /* transition = animate changes smoothly instead of instantly.
     When the hover color/position changes, it takes 0.2 seconds.
     This is our "subtle animation" — nothing excessive. */
  transition: background 0.2s ease, transform 0.2s ease;
}

/* What the button looks like while the mouse is over it */
.btn:hover {
  background: var(--teal-dark);
  text-decoration: none;
  transform: translateY(-2px);    /* Lifts up 2px — a tiny "press me" cue */
}

/* Smaller version for the header. Because it's listed AFTER
   .btn, these values override the bigger padding. (Cascading!) */
.btn-small {
  padding: 8px 18px;
}
/* The nav rule above made nav links navy — make the button text white again. */
.nav-links .btn {
  color: var(--white);
}

/* ---------- HERO ---------- */
.hero {
  background: var(--navy);
  color: #CBD5E1;
  padding: 120px 0 128px;
}

.hero h1 {
  color: var(--white);
  max-width: 14ch;                /* "ch" = width of one character. Keeps the headline to ~2 lines. */
}

/* The small label above the headline */
.eyebrow {
  color: #5FC4CE;                 /* Lighter teal so it's readable on navy */
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;      /* Displays in ALL CAPS without retyping the text */
  margin-bottom: 20px;
}

/* The paragraph under the headline */
.lead {
  font-size: 1.2rem;
  max-width: 600px;
  margin-bottom: 36px;
}

/* ---------- SERVICE CARDS ----------
   CSS GRID — the other big layout tool. Where flexbox lines
   things up in ONE row, grid makes ROWS AND COLUMNS (like a
   FileMaker portal or a spreadsheet).

   repeat(auto-fit, minmax(240px, 1fr)) means:
   "Fit as many columns as you can, each at least 240px wide,
   and share the leftover space equally (1fr = 1 fraction)."
   Result: 4 columns on a wide screen, 2 on a tablet, 1 on a
   phone — with NO extra code. */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  /* A very soft shadow. Format: x-offset y-offset blur color */
  box-shadow: 0 1px 3px rgba(16, 29, 47, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Hover: the card lifts slightly, the shadow grows, the border turns teal */
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(16, 29, 47, 0.10);
  border-color: var(--teal);
}

/* A short teal line above each card's title.
   ::before creates a "fake" element at the start of the h3
   without adding anything to the HTML. Purely decorative. */
.card h3::before {
  content: "";
  display: block;
  width: 32px;
  height: 3px;
  background: var(--teal);
  border-radius: 2px;
  margin-bottom: 16px;
}

.card p {
  font-size: 0.97rem;
  margin: 0;
}

/* The "Technology Built Around Your Business" subheading */
#why h3 {
  color: var(--teal);
  font-size: 1.15rem;
  margin-bottom: 24px;
}

/* ---------- CONTACT FORM (Module 4) ----------
   The form sits on the navy contact section, so it gets a white
   card behind it to keep the fields easy to read. */
.contact-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 32px;
  text-align: left;               /* The section is centered — the form shouldn't be */
}

/* Two fields side by side (Name + Email, Phone + Service) */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;                 /* Puts the label on its own line above the field */
  color: var(--navy);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.optional {
  color: var(--slate);
  font-weight: 400;
}

/* All three field types share one look */
.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;                  /* Use the page font (form fields don't by default) */
  color: var(--navy);
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* :focus = the field you're currently typing in. A teal outline
   shows which one is active. */
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 127, 140, 0.15);
}

.field textarea {
  resize: vertical;               /* Can drag taller, not wider */
}

/* Single-line fields and the dropdown get the same fixed height
   so they line up side by side (dropdowns size themselves differently). */
.field input,
.field select {
  height: 50px;
}

/* <button> tags have their own default look — reset it to match .btn */
.contact-form .btn {
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  width: 100%;
}

/* Used for the spam-trap checkbox */
.hidden {
  display: none;
}

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--navy);
  color: #94A3B8;
  font-size: 0.875rem;
  padding: 28px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.site-footer p {
  margin: 0;
}


/* ============================================================
   5. MOBILE ADJUSTMENTS (MEDIA QUERY)

   @media (max-width: 720px) { ... } means:
   "Only apply these rules when the window is 720px wide or less."

   FileMaker analogy: like having a separate iPhone layout,
   except it's the SAME page — it just restyles itself
   automatically based on screen size.
   ============================================================ */
@media (max-width: 720px) {

  /* Less vertical space between sections on small screens */
  .section { padding: 64px 0; }
  .hero    { padding: 72px 0 80px; }

  /* Hide the text links in the header and keep only the Contact
     button. (A proper tap-to-open "hamburger" menu needs a little
     JavaScript — we'll add that in a later module.) */
  .nav-links li:not(:last-child) {
    display: none;
  }

  /* Form fields stack one per row on phones */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .contact-form {
    padding: 24px;
  }
}
