/*
 * ============================================================================
 * RETORT LABS — Global Stylesheet
 * ============================================================================
 *
 * Design System: GitHub-inspired dark UI
 * Font: DM Sans (Google Fonts) for body, monospace stack for labels/accents
 * Color Palette: Dark backgrounds with light text, blue accent, green CTA
 *
 * This stylesheet is shared across all 6 pages:
 *   - index.html       (no-scroll homepage)
 *   - websites.html     (service page: Website & Digital Presence)
 *   - databases.html    (service page: Databases & Consolidation)
 *   - platforms.html    (service page: Platforms & Business Tools)
 *   - automation.html   (service page: AI & Automation)
 *   - contact.html      (no-scroll contact form)
 *
 * ============================================================================
 */


/* ==========================================================================
   RESET
   --------------------------------------------------------------------------
   Strip default margins/padding and use border-box sizing globally.
   This ensures consistent rendering across all browsers.
   ========================================================================== */

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


/* ==========================================================================
   DESIGN TOKENS (CSS Custom Properties)
   --------------------------------------------------------------------------
   All colors, fonts, and spacing values are defined here as variables.
   To update the look of the entire site, change values here — they'll
   cascade everywhere. Inspired by GitHub's dark theme (Dimmed).
   ========================================================================== */

:root {
  /* Backgrounds — darkest to lightest */
  --bg-primary:    #0D1117;   /* Main page background */
  --bg-secondary:  #161B22;   /* Cards, nav, secondary surfaces */
  --bg-card:       #1C2128;   /* Unused currently — available for deeper card nesting */
  --bg-card-hover: #21262D;   /* Card hover state */

  /* Text — brightest to dimmest */
  --text-primary:   #E6EDF3;  /* Headings, primary body text */
  --text-secondary: #8B949E;  /* Paragraphs, descriptions */
  --text-muted:     #484F58;  /* Labels, subtle UI elements */

  /* Accent — GitHub blue for interactive elements */
  --accent:       #58A6FF;    /* Links, labels, focus rings */
  --accent-hover: #79B8FF;    /* Hover state for accent elements */

  /* Borders */
  --border:       #30363D;    /* Default border color */
  --border-hover: #484F58;    /* Hover state for borders */

  /* Font stacks */
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;  /* Smoother text on macOS/Chrome */
}


/* ==========================================================================
   NAVIGATION BAR
   --------------------------------------------------------------------------
   Fixed to the top of every page. Uses a translucent blurred background
   so content scrolls behind it on service pages. Contains:
     - Left: Logo mark (SVG triangle) + "RETORT LABS" wordmark
     - Right: "Get in touch" CTA button
   ========================================================================== */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;                           /* Always on top of page content */
  padding: 1rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(13, 17, 23, 0.8);      /* Semi-transparent bg-primary */
  backdrop-filter: blur(16px);             /* Frosted glass effect */
  border-bottom: 1px solid var(--border);
}

/* Logo + wordmark container — links back to homepage */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

/* SVG logo mark — the alchemical triangle with horizontal line */
.nav-mark svg {
  width: 28px;
  height: 28px;
}

/* "RETORT LABS" text next to the logo */
.nav-name {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* "Get in touch" button in the nav — subtle bordered style */
.nav-cta {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-cta:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-secondary);
}


/* ==========================================================================
   HOMEPAGE — HERO SECTION
   --------------------------------------------------------------------------
   The homepage is a single no-scroll viewport. The entire page is a flex
   column: the hero fills the available space, the footer sits at the bottom.

   Layout (index.html):
     body > .home-layout (flex column, 100vh)
       > .hero (flex: 1, centered content)
       > footer (pinned to bottom)
   ========================================================================== */

/* Wrapper that locks the homepage to exactly one viewport height.
   100dvh = "dynamic viewport height" — accounts for mobile browser
   chrome (address bar, toolbar) so content isn't clipped on iOS Safari.
   Falls back to 100vh for older browsers. */
.home-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;         /* Modern override — respects mobile browser chrome */
  overflow: hidden;        /* Prevents any scroll on the homepage */
}

/* Hero content area — fills remaining space between nav and footer */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

/* Main headline */
.hero h1 {
  font-family: var(--sans);
  font-size: clamp(2rem, 4.5vw, 3.4rem);  /* Fluid scaling: min 2rem, max 3.4rem */
  font-weight: 500;
  line-height: 1.3;
  max-width: 750px;
  letter-spacing: -0.5px;
  margin-bottom: 1.2rem;
}

/* Tagline in monospace — "// where complexity becomes clarity" */
.hero-tagline {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 3.5rem;
}

/* Row of pipe-separated service links */
.hero-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Individual service link */
.hero-links a {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.hero-links a:hover {
  color: var(--accent);
}

/* Pipe separator between links — purely decorative */
.hero-links .pipe {
  color: var(--text-muted);
  font-size: 0.9rem;
  user-select: none;     /* Can't be selected/copied */
}


/* ==========================================================================
   SERVICE PAGE — HEADER
   --------------------------------------------------------------------------
   Used on all 4 service pages (websites, databases, platforms, automation).
   Contains:
     - Page label: "01 / Website & Digital Presence" (monospace, accent color)
     - Headline: Main value proposition
     - Subtext: Supporting description
   ========================================================================== */

.page-header {
  padding: 10rem 2rem 4rem;  /* 10rem top to clear fixed nav */
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

/* Monospace page number/label — e.g. "01 / WEBSITE & DIGITAL PRESENCE" */
.page-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: block;
}

/* Page headline */
.page-header h1 {
  font-family: var(--sans);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.3px;
  margin-bottom: 1.5rem;
}

/* Page description text */
.page-header p {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 620px;
  margin: 0 auto;
}


/* ==========================================================================
   PROCESS SECTION — "HOW WE WORK" GRID
   --------------------------------------------------------------------------
   A 3-column grid of numbered process cards. Uses a 1px gap with the border
   color as the grid background to create the divider lines between cards
   (same technique GitHub uses for their feature grids).

   Each card has:
     - Process number (monospace, accent color)
     - Title
     - Description
   ========================================================================== */

.process {
  padding: 4rem 2rem 6rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* Section label — "// HOW WE WORK" */
.section-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 3rem;
}

/* Grid container — the border-color background shows through the 1px gaps
   between cards, creating the divider lines */
.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;                          /* 1px gaps = visible divider lines */
  background: var(--border);         /* Gap color = divider color */
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;                  /* Clips cards to rounded corners */
}

/* Individual process card */
.process-card {
  background: var(--bg-secondary);
  padding: 2.5rem 2rem;
  transition: background 0.2s;
}

.process-card:hover {
  background: var(--bg-card-hover);
}

/* Step number — "01", "02", etc. */
.process-number {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 1rem;
  display: block;
}

/* Card title */
.process-card h3 {
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

/* Card description */
.process-card p {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
}


/* ==========================================================================
   AUTOMATION GRID — "WHAT WE AUTOMATE"
   --------------------------------------------------------------------------
   Used only on automation.html. Same grid technique as the process grid
   but with slightly different padding. Contains 15 automation type cards
   in a 5x3 layout.
   ========================================================================== */

.automations {
  padding: 4rem 2rem 6rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* Same 1px-gap grid technique as process cards */
.automations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

/* Automation type card — slightly more compact than process cards */
.auto-card {
  background: var(--bg-secondary);
  padding: 2rem 1.8rem;
  transition: background 0.2s;
}

.auto-card:hover {
  background: var(--bg-card-hover);
}

/* Automation name */
.auto-card h4 {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Automation description */
.auto-card p {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
}


/* ==========================================================================
   BOTTOM STATEMENT
   --------------------------------------------------------------------------
   A centered one-liner that appears between the process grid and the CTA
   on each service page. Uses <em> tags for emphasis (rendered as normal
   weight white text against the lighter secondary text).
   ========================================================================== */

.bottom-statement {
  padding: 4rem 2rem;
  text-align: center;
}

.bottom-statement p {
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Emphasized portion — stands out as white text (not italic) */
.bottom-statement p em {
  color: var(--text-primary);
  font-style: normal;
  font-weight: 400;
}


/* ==========================================================================
   CTA SECTION — "GET IN TOUCH" BUTTON
   --------------------------------------------------------------------------
   Appears at the bottom of each service page, above the footer.
   Bordered button that highlights to accent blue on hover.
   ========================================================================== */

.cta-section {
  padding: 3rem 2rem 6rem;
  text-align: center;
}

.cta-button {
  display: inline-block;
  padding: 0.85rem 2rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-primary);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
}

.cta-button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(88, 166, 255, 0.08);   /* Subtle blue tint on hover */
}


/* ==========================================================================
   CONTACT PAGE
   --------------------------------------------------------------------------
   A no-scroll, vertically centered layout containing:
     - Headline: "Tell us what's not working"
     - Subtext: One-line description
     - Form: Name, email, message, submit button

   The form submits to our Node.js backend, which sends email via SMTP.

   Layout (contact.html):
     body > .contact-layout (flex, 100vh, centered)
       > .contact-page (max-width container)
         > h1, p, form
   ========================================================================== */

/* Full-viewport flex column that centers the form and pins footer.
   Same structure as .home-layout — flex column, form area fills
   remaining space, footer sits at the bottom.
   Same dvh fallback pattern as homepage for mobile Safari. */
.contact-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Inner wrapper that centers the form vertically in available space */
.contact-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Inner container — constrains form width */
.contact-page {
  width: 100%;
  max-width: 580px;
  padding: 2rem;
}

/* Contact page headline */
.contact-page h1 {
  font-family: var(--sans);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.3px;
  margin-bottom: 0.75rem;
  text-align: center;
}

/* Contact page description below headline */
.contact-subtext {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 3rem;
  line-height: 1.7;
}

/* Form layout — vertical stack of fields */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Side-by-side row for name + email fields */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* Individual form field wrapper (label + input/textarea) */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Field labels — monospace, uppercase, subtle */
.form-group label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Text inputs and textarea — dark background, subtle border */
.form-group input,
.form-group textarea {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s;
}

/* Focus state — accent blue border */
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

/* Textarea specific — resizable vertically with a minimum height */
.form-group textarea {
  resize: vertical;
  min-height: 130px;
}

/* Submit button — GitHub green, stands out as the primary action */
.form-submit {
  display: inline-block;
  padding: 0.85rem 2rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: #ffffff;
  background: #238636;          /* GitHub green */
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  align-self: flex-start;       /* Left-aligned, not full-width */
}

.form-submit:hover {
  background: #2ea043;          /* Lighter green on hover */
}


/* ==========================================================================
   FOOTER
   --------------------------------------------------------------------------
   Appears at the bottom of every page. Contains:
     - Left: Copyright + location
     - Right: Social links (Facebook, LinkedIn, Email)

   On the homepage, the footer is pinned inside the .home-layout flex
   container. On service pages, it flows naturally after the content.
   ========================================================================== */

footer {
  padding: 2rem 2.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Copyright text — monospace, small */
.footer-left {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Social links container */
.footer-right {
  display: flex;
  gap: 1.5rem;
}

/* Individual social link */
.footer-right a {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-right a:hover {
  color: var(--text-secondary);
}


/* ==========================================================================
   RESPONSIVE — MOBILE BREAKPOINT (768px and below)
   --------------------------------------------------------------------------
   Key changes at mobile:
     - Nav padding tightens
     - Hero headline shrinks, links stack vertically (pipes hidden)
     - Process/automation grids collapse to single column
     - Form fields stack vertically
     - Footer centers and stacks
   ========================================================================== */

@media (max-width: 768px) {
  nav {
    padding: 1rem 1.25rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  /* Stack service links vertically on mobile */
  .hero-links {
    flex-direction: column;
    gap: 0.8rem;
  }

  /* Hide pipe separators on mobile — not needed when stacked */
  .hero-links .pipe {
    display: none;
  }

  /* Reduce top padding (smaller nav clearance on mobile) */
  .page-header {
    padding: 8rem 1.5rem 3rem;
  }

  .process {
    padding: 3rem 1.5rem 4rem;
  }

  /* Single column grid on mobile */
  .process-grid {
    grid-template-columns: 1fr;
  }

  .automations {
    padding: 3rem 1.5rem 4rem;
  }

  /* Single column grid on mobile */
  .automations-grid {
    grid-template-columns: 1fr;
  }

  /* Stack name/email fields on mobile */
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Center and stack footer */
  footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 2rem 1.5rem;
  }
}
