/* =====================================================================
   CHRIS SCRACE EDITORIAL SERVICES — MAIN STYLESHEET
   =====================================================================
   This file is organised into numbered sections. If you want to change
   something, use Ctrl+F (or Cmd+F) to jump to the relevant number:

     1. Fonts             — the Inter typeface files
     2. Design tokens      — colours, spacing, sizes, all in one place
     3. Reset & base       — sensible defaults for every page
     4. Accessibility      — skip link, focus outlines, screen-reader text
     5. Layout              — the centred container every section sits in
     6. Header & navigation — the two-tier blue bar at the top
     7. Footer
     8. Buttons
     9. Page sections       — headings, reassurance lists, hero content
    10. Cards                — used for services grid, credential strip
    11. CIEP badge           — sized to their published spec
    12. Forms                — for the contact page, once it's wired up
    13. Responsive            — adjustments for narrow (phone) screens

   Every page on the site links to this one file, so a change made here
   applies everywhere at once.
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. FONTS
   Inter is hosted locally (the .woff2 files in the /fonts folder)
   rather than pulled from Google Fonts. This is both faster for
   visitors and avoids sending their IP address to Google on every
   page load, which matters for a UK/EU audience under GDPR.
   Three weights are loaded: 400 (regular, for body text), 700 (bold,
   for headings/buttons/nav) and 900 (black, for your name only).
   --------------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap; /* show fallback text instantly, swap in Inter once it loads */
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}


/* ---------------------------------------------------------------------
   2. DESIGN TOKENS
   Every colour and a few key measurements are defined once here as
   "custom properties" (the --name: value; lines). The rest of this
   file refers to them as var(--name) instead of repeating the raw
   value everywhere. Change a colour here and it updates site-wide.
   --------------------------------------------------------------------- */
:root {
  /* Brand colours — built from your existing blue, #0070C0, kept exact */
  --ink:       #11212C; /* body text — near-black with a blue tint */
  --deep:      #0A4C7B; /* headings, buttons, hover states */
  --brand:     #0070C0; /* your established blue — banners, primary accents */
  --mid:       #2982C2; /* decorative use only — large text/borders, not small text */
  --pale:      #EBF3F9; /* light background tint */
  --surface:   #F9FAFB; /* off-white page background, easier on the eye than pure white */
  --white:     #FFFFFF;
  --ink-muted: #5B6B7A; /* secondary/caption text */
  --border:    #DCE3E9; /* subtle dividing lines */

  /* Spacing scale — used for padding/margins so spacing stays consistent */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  /* Shared measurements */
  --container-width: 1100px;
  --radius: 10px;
  --radius-lg: 16px;
}

/* If a visitor's device is set to reduce motion, turn off transitions.
   Some people find movement on screen disorientating or nauseating. */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}


/* ---------------------------------------------------------------------
   3. RESET & BASE
   A handful of small fixes that most browsers need — without these,
   things like box sizing and image scaling behave unexpectedly.
   --------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box; /* padding/borders no longer add to an element's set width */
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
h1, h2, h3, h4 {
  margin: 0 0 var(--space-sm);
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance; /* avoids one lonely word wrapping onto its own line */
}
p {
  margin: 0 0 var(--space-md);
  max-width: 68ch; /* keeps paragraphs a comfortable width to read */
}
a {
  color: var(--brand);
}
a:not([class]) {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
ul, ol {
  padding-left: 1.3em;
}
li {
  margin-bottom: 0.5em;
}


/* ---------------------------------------------------------------------
   4. ACCESSIBILITY
   --------------------------------------------------------------------- */

/* Hides text visually while keeping it available to screen readers —
   used for labels that sighted users don't need to see (e.g. a button
   that's just an icon still needs a real text label underneath). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The "skip to main content" link. It's the first thing on every page
   but stays invisible until a keyboard user tabs onto it — that lets
   them jump straight past the header/nav instead of tabbing through
   every link on every single page visit. */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-sm);
  background: var(--deep);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius);
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: var(--space-sm);
}

/* A visible outline whenever something is focused via keyboard.
   Never remove this without replacing it — invisible focus is one of
   the most common accessibility failures on the web. */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}


/* ---------------------------------------------------------------------
   5. LAYOUT
   .wrap centres content in the middle of the browser window with a
   maximum width, so text doesn't stretch uncomfortably wide on large
   monitors. Every section's content sits inside one of these.
   --------------------------------------------------------------------- */
.wrap {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}


/* ---------------------------------------------------------------------
   6. HEADER & NAVIGATION
   Two stacked bars: a brand-blue bar with your name, and a darker
   blue bar underneath with the navigation links. Keeping them
   different shades stops the nav text from blending into your name.
   --------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* --- Name bar --- */
.name-bar {
  background: var(--brand);
  padding: var(--space-sm) 0;
}
.wordmark {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  color: var(--white);
}
.wordmark .chris {
  font-size: 2.1rem;
  font-weight: 900;
  color: var(--white);
  margin-right: 0.32em;
  letter-spacing: -0.01em;
}

/* The "selected text" mark: your surname with a highlighted
   background and a text-cursor icon, echoing the fact that editing
   text is literally what you do. Only the letters are highlighted —
   the caret icon is deliberately excluded from the highlight box. */
.selected-word {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  font-size: 2.1rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.01em;
}
.selected-word .hl-wrap {
  position: relative;
  display: inline-block;
}
.selected-word .hl {
  position: absolute;
  inset: -0.05em -0.14em;
  background: var(--white);
  opacity: 0.24;
  border-radius: 3px;
  z-index: 0;
}
.selected-word .txt {
  position: relative;
  z-index: 1;
}
.selected-word .caret {
  position: absolute;
  top: 50%;
  left: calc(100% + 0.14em);
  transform: translate(-50%, -50%);
  width: 0.27em;
  height: 0.72em;
  z-index: 2;
}
.selected-word .caret svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* --- Nav bar --- */
.nav-bar {
  background: var(--deep);
}
.nav-bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-toggle {
  display: none; /* only shown on narrow screens — see section 13 */
  background: none;
  border: none;
  color: var(--white);
  padding: var(--space-sm);
  /* The padding above exists to give the button a comfortably large tap
     target (good for touch accessibility), but that same padding pushes
     the visible icon inward, off-alignment from the page content edge.
     This pulls the whole button back by exactly that padding so the
     icon lines up with everything else, without shrinking the tap area. */
  margin-left: calc(-1 * var(--space-sm));
  cursor: pointer;
}
.nav-toggle-icon {
  display: block;
  width: 22px;
  height: 16px;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
}
.nav-primary,
.nav-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-menu a {
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  opacity: 0.94;
}
.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
.nav-contact {
  background: rgba(255, 255, 255, 0.16);
  padding: 8px 16px;
  border-radius: 999px;
}


/* ---------------------------------------------------------------------
   7. FOOTER
   --------------------------------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: var(--pale);
  margin-top: var(--space-xl);
}
.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap; /* the two groups below sit side by side whenever there's room, and only drop
                       to a second line — never sooner — once the row genuinely can't fit both */
  gap: var(--space-lg) var(--space-md);
  /* This element carries both the .wrap class (horizontal padding + centring)
     and .footer-inner (vertical padding). Because both set the shorthand
     "padding" property on the same element, this rule fully replaces
     .wrap's — it must repeat the horizontal value or the footer loses its
     side padding entirely on any screen narrower than the site's max width. */
  padding: var(--space-lg) var(--space-md);
}
.footer-inner a {
  color: var(--pale);
}

/* Groups the CIEP badge with the copyright/privacy line as a single
   visual unit — badge on top, text directly beneath — so the two read
   as one block rather than the badge floating on its own. */
.footer-primary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.footer-brand p {
  margin: 0 0 0.4em;
  font-size: 0.85rem;
  max-width: none;
}

/* The mini "sitemap" column — repeats the main navigation so a visitor
   who has scrolled all the way down still has a way back in, and gives
   search engines a second set of internal links to follow. */
.footer-col-heading {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin: 0 0 0.6em;
}
.footer-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}
.footer-nav-list a {
  text-decoration: none;
}
.footer-nav-list a:hover {
  text-decoration: underline;
}

.footer-ciep .ciep-badge-link img {
  /* Deliberately smaller here than on the Home/About pages (60mm) — this
     instance's job is a quiet "yes, this is genuine" confirmation on every
     page, not the primary place a visitor is meant to read it. Still
     comfortably clear of CIEP's 25mm floor.
     Selector needs the extra .ciep-badge-link step: this and the
     Home/About version both style plain "img" inside a same-named class,
     so without the added specificity here, source order alone decided
     the winner — and the 60mm rule, being later in the file, silently
     won everywhere, including the footer. */
  width: 30mm;
  min-width: 25mm;
  height: auto;
  padding: calc(30mm * 0.1244); /* same clearance ratio as the 60mm version, scaled down with it */
  /* Every element on the site defaults to box-sizing: border-box (see
     section 3), which for a sized image means the padding above eats
     into the 30mm rather than sitting outside it — the logo itself was
     rendering at roughly 20mm, under CIEP's 25mm floor. content-box
     makes the 30mm apply to the logo alone, with the clearance genuinely
     additional to it. */
  box-sizing: content-box;
}


/* ---------------------------------------------------------------------
   8. BUTTONS
   --------------------------------------------------------------------- */
.btn {
  display: inline-block;
  background: var(--deep);
  color: var(--white);
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 24px -8px rgba(10, 76, 123, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -8px rgba(10, 76, 123, 0.6);
  color: var(--white);
}


/* ---------------------------------------------------------------------
   9. PAGE SECTIONS
   --------------------------------------------------------------------- */
main {
  padding: var(--space-xl) 0;
}
.section {
  padding: var(--space-lg) 0;
}
.section + .section {
  border-top: 1px solid var(--border);
}

/* The photo + opening-paragraph pairing on the About page. Stacks to a
   single column on narrow screens rather than squeezing the photo down
   to an illegibly small size. */
.about-intro {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
}
.about-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 12px 28px -12px rgba(10, 76, 123, 0.45);
}
.about-intro p {
  margin-bottom: 0;
}
@media (max-width: 600px) {
  .about-intro {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* A heading with a small coloured bar beside it — the same accent
   used throughout the brand direction work, so headings feel
   consistent with the rest of the identity rather than plain text. */
.heading-accent {
  position: relative;
  padding-left: 18px;
}
.heading-accent::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 4px;
  border-radius: 2px;
  background: var(--brand);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: var(--space-xs);
}

/* The reassurance/skills bullet lists use a tick instead of the
   default dot. The tick is decorative — the list still reads
   correctly to a screen reader regardless of the icon. */
.tick-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-md);
}
.tick-list li {
  position: relative;
  padding-left: 1.8em;
  margin-bottom: 0.75em;
}
.tick-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand);
}
.tick-list li::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.62em;
  width: 8px;
  height: 4px;
  border-left: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: rotate(-45deg);
}


/* ---------------------------------------------------------------------
   10. CARDS
   --------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -16px rgba(10, 76, 123, 0.3);
}
.card h3 {
  color: var(--deep);
  margin-bottom: 0.4em;
}
.card p {
  margin-bottom: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}


/* ---------------------------------------------------------------------
   11. CIEP BADGE
   Sized directly in millimetres, since that's the unit CIEP publish
   their spec in — the browser converts it correctly on any screen,
   with no manual pixel maths needed. 25mm is their published floor;
   we use 60mm wherever there's room, since 30mm still proved hard to
   read on screen. Clear space is 12.4% of the badge's own width,
   measured from their source artwork (the height of the "e" in
   "ciep" against the full logo width).
   --------------------------------------------------------------------- */
.credential-strip {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}
.ciep-badge-link {
  display: inline-block;
  line-height: 0;
  border-radius: 4px;
}
.ciep-badge-link img {
  width: 60mm;
  min-width: 25mm;
  height: auto;
  padding: calc(60mm * 0.1244);
  /* See the equivalent footer rule for why this is needed: without it,
     the site-wide border-box default shrinks the visible logo to less
     than its stated width. */
  box-sizing: content-box;
}
.credential-strip .cred-text {
  font-size: 0.88rem;
  color: var(--ink-muted);
  max-width: 34ch;
}
.credential-strip .cred-text b {
  display: block;
  color: var(--ink);
  margin-bottom: 0.25em;
}


/* ---------------------------------------------------------------------
   12. FORMS
   Base styling for the contact form, once it's wired up to a
   processor. Every field has a real, visible <label> — placeholder
   text alone is not an accessible substitute for a label.
   --------------------------------------------------------------------- */
.field {
  margin-bottom: var(--space-md);
  max-width: 480px;
}
.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4em;
  font-size: 0.92rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  background: var(--white);
}
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.field-hint {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-top: 0.3em;
}


/* ---------------------------------------------------------------------
   13. RESPONSIVE
   Below 760px wide (most phones, portrait tablets) the two-column
   card grid becomes one column, and the navigation collapses behind
   a menu button. The button is only shown at this width — above it,
   all the links are visible all the time and pressing the button
   (which is hidden) does nothing.
   --------------------------------------------------------------------- */
@media (max-width: 760px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .wordmark .chris,
  .selected-word {
    font-size: 1.6rem;
  }

  .nav-toggle {
    display: block;
  }
  .nav-bar .wrap {
    /* Without this, the wrap stays a row and the open menu appears
       beside the toggle button instead of below it. */
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-menu {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  .nav-menu.is-open {
    display: flex;
  }
  .nav-primary,
  .nav-secondary {
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
  }
  .nav-contact {
    /* The pill background reads well when it's a standalone item on a
       wide screen, but in the stacked mobile menu it just knocks the
       word "Contact" out of alignment with the links above it. */
    background: none;
    padding: 0;
    border-radius: 0;
  }

}
