/*
  ============================================================
  Shauliuha Consulting — css/styles.css
  Minimal, light-themed personal consulting site.

  Table of Contents
  -----------------
  01. Custom Properties (Design Tokens)
  02. Reset & Base
  03. Typography
  04. Layout Utilities
  05. Header & Navigation
  06. Mobile Menu
  07. Hero / Landing Section
  08. Content Sections (shared)
  09. Background Section
  10. About Section
  11. Clients Section
  12. Contact Section
  13. Footer
  14. Buttons
  15. Form Elements
  16. Responsive — Tablet (≤ 1024 px)
  17. Responsive — Mobile (≤ 768 px)
  18. Reduced-Motion
  ============================================================
*/


/* ============================================================
   01. Custom Properties (Design Tokens)
   ============================================================ */
:root {
  /* — Colour palette — */
  --clr-bg:           #ffffff;
  --clr-bg-alt:       #f5f6f8;       /* soft off-white for alternating sections */
  --clr-surface:      #eef0f4;       /* card / input backgrounds                */
  --clr-border:       #dde1e8;       /* subtle borders                          */

  --clr-accent:       #5b7c99;       /* slate blue — primary accent             */
  --clr-accent-dark:  #46637a;       /* hover / active state for accent         */
  --clr-accent-light: #dce8f1;       /* light tint for focus rings, badges      */

  --clr-text:         #1a1f2e;       /* primary body text                       */
  --clr-text-muted:   #5a6072;       /* secondary / caption text                */
  --clr-text-light:   #ffffff;

  --clr-success:      #2a7a5e;       /* form success state                      */
  --clr-success-bg:   #e8f5ef;
  --clr-error:        #c0392b;       /* form error state                        */

  /* — Typography — */
  --font-heading:  'Playfair Display', Georgia, serif;
  --font-body:     'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;

  --text-xs:   0.75rem;    /*  12 px */
  --text-sm:   0.875rem;   /*  14 px */
  --text-base: 1rem;       /*  16 px */
  --text-lg:   1.125rem;   /*  18 px */
  --text-xl:   1.375rem;   /*  22 px */
  --text-2xl:  1.75rem;    /*  28 px */
  --text-3xl:  2.25rem;    /*  36 px */
  --text-4xl:  3rem;       /*  48 px */

  /* — Spacing (8-px scale) — */
  --space-1:   0.5rem;     /*  8 px */
  --space-2:   1rem;       /* 16 px */
  --space-3:   1.5rem;     /* 24 px */
  --space-4:   2rem;       /* 32 px */
  --space-5:   3rem;       /* 48 px */
  --space-6:   4rem;       /* 64 px */
  --space-7:   6rem;       /* 96 px */

  /* — Layout — */
  --max-width:      1140px;
  --header-height:  72px;

  /* — Visual — */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  14px;

  --shadow-sm:  0 1px  4px  rgba(26, 31, 46, 0.06);
  --shadow-md:  0 4px  16px rgba(26, 31, 46, 0.10);
  --shadow-lg:  0 8px  32px rgba(26, 31, 46, 0.14);

  --transition: 0.3s ease;
}


/* ============================================================
   02. Reset & Base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Enable smooth scrolling site-wide */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height); /* offset for sticky header */
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--clr-text);
  background-color: var(--clr-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Remove list styling where it's applied semantically via role="list" */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

img,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* Accessible focus-visible outline — shown only on keyboard nav */
:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Visually hidden (screen-reader accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ============================================================
   03. Typography
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  color: var(--clr-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl);  }

p {
  color: var(--clr-text-muted);
  max-width: 68ch;             /* comfortable reading line length */
  line-height: 1.75;
}

p + p {
  margin-top: var(--space-2);
}

strong { font-weight: 600; }


/* ============================================================
   04. Layout Utilities
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* Generic section wrapper */
.section {
  padding-block: var(--space-7);
}

.section--alt {
  background-color: var(--clr-bg-alt);
}

/* Two-column section layout used by Background, About, Clients */
.section-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

.section-header {
  max-width: 52ch;
}

.section-title {
  font-size: var(--text-3xl);
  color: var(--clr-text);
  margin-bottom: var(--space-2);
  position: relative;
  padding-bottom: var(--space-2);
}

/* Decorative accent underline beneath section titles */
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background-color: var(--clr-accent);
  border-radius: 2px;
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--clr-text-muted);
  max-width: 60ch;
  margin-top: var(--space-2);
  line-height: 1.6;
}

.section-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Styled bullet list used in Background and Clients */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-left: 0;
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: var(--space-3);
  color: var(--clr-text-muted);
  line-height: 1.65;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--clr-accent);
  flex-shrink: 0;
}

.cfa-badge-wrap {
  margin-top: var(--space-2);
}

.cfa-badge {
  height: 120px;
  width: auto;
  display: block;
  transition: opacity var(--transition);
}

.cfa-badge-wrap a:hover .cfa-badge,
.cfa-badge-wrap a:focus-visible .cfa-badge {
  opacity: 0.8;
}

#background {
  padding-bottom: var(--space-4);
}


/* ============================================================
   05. Header & Navigation
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--header-height);
  background-color: var(--clr-bg);
  border-bottom: 1px solid transparent;
  transition:
    border-color var(--transition),
    box-shadow   var(--transition);
}

/* Shadow added via JS when page is scrolled */
.site-header.scrolled {
  border-bottom-color: var(--clr-border);
  box-shadow: var(--shadow-md);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand */
.brand {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--clr-text);
  letter-spacing: -0.01em;
  transition: color var(--transition);
  white-space: nowrap;
}

.brand:hover,
.brand:focus-visible {
  color: var(--clr-accent);
}

/* When the brand is an image, fade on hover instead of recolouring */
.brand-logo {
  height: 56px;
  width: auto;
  display: block;
  transition: opacity var(--transition);
}

.brand:hover .brand-logo,
.brand:focus-visible .brand-logo {
  opacity: 0.8;
}

/* Desktop nav list */
.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
  padding-bottom: 2px;
  position: relative;
  transition: color var(--transition);
}

/* Animated underline on hover */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--clr-accent);
  border-radius: 1px;
  transition: width var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--clr-accent);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 100%;
}


/* ============================================================
   06. Mobile Menu & Hamburger
   ============================================================ */

/* Hamburger button — hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition);
}

.hamburger:hover {
  background-color: var(--clr-surface);
}

.bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--clr-text);
  border-radius: 2px;
  transition:
    transform    var(--transition),
    opacity      var(--transition),
    width        var(--transition);
  transform-origin: center;
}

/* Animate bars into an × when menu is open */
.hamburger.active .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active .bar:nth-child(2) {
  opacity: 0;
  width: 0;
}
.hamburger.active .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile overlay menu */
.mobile-menu {
  display: none;   /* shown only on mobile via media query */
  position: fixed;
  inset: var(--header-height) 0 0 0;
  background-color: var(--clr-bg);
  padding: var(--space-4);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  z-index: 850;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
}

.mobile-nav-link {
  display: block;
  padding-block: var(--space-2);
  font-size: var(--text-xl);
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--clr-text);
  border-bottom: 1px solid var(--clr-border);
  transition: color var(--transition), padding-left var(--transition);
}

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible {
  color: var(--clr-accent);
  padding-left: var(--space-1);
}


/* ============================================================
   07. Hero / Landing Section
   ============================================================ */
.section--hero {
  padding-top: var(--space-6);
  padding-bottom: var(--space-7);
}

/* Two-image grid */
.hero-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.hero-image-wrap {
  overflow: hidden;
  border-radius: var(--radius-lg);
  aspect-ratio: 4 / 3;
  background-color: var(--clr-surface); /* placeholder colour while loading */
  box-shadow: var(--shadow-sm);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hero-image-wrap:hover .hero-img {
  transform: scale(1.03);
}

/* Intro paragraph area */
.hero-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.hero-logo {
  height: 120px;
  width: auto;
  display: block;
}

.hero-copy {
  text-align: center;
  max-width: 72ch;
  margin-inline: auto;
}

.hero-copy p {
  font-size: var(--text-lg);
  max-width: 100%;
  color: var(--clr-text-muted);
}


/* ============================================================
   08–11. Content Sections
   Shared via .section / .section--alt + .section-inner already
   defined in §04 Layout Utilities. Individual tweaks below.
   ============================================================ */

/* Client cards grid */
.client-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  width: 100%;
}

.client-card {
  background-color: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.client-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.client-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.client-card-logo-wrap {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--clr-surface);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.client-card-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.client-card-name {
  font-size: var(--text-xl);
  color: var(--clr-text);
  margin-bottom: 2px;
}

.client-card-role {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--clr-accent);
  max-width: none;
  line-height: 1.4;
}

/* Clients section header — centred over the two-column cards grid */
#clients .section-header {
  max-width: 100%;
  width: 100%;
  text-align: center;
}

#clients .section-title,
#clients .section-body > p {
  text-align: center;
  margin-inline: auto;
}

#clients .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}

/* Contact section header — centred over the two-column contact grid */
#contact .section-header {
  max-width: 100%;
  margin-bottom: var(--space-5);
  text-align: center;
}

#contact .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}

#contact .section-subtitle {
  margin-inline: auto;
}


/* ============================================================
   12. Contact Section — Two-column grid
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: var(--space-5);
  align-items: start;
}

/* LEFT — contact info card */
.contact-info {
  background-color: var(--clr-bg-alt);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.contact-detail-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-detail-row dt {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-accent);
}

.contact-detail-row dd {
  font-size: var(--text-base);
  color: var(--clr-text);
  font-weight: 400;
}

.contact-link {
  color: var(--clr-text);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition:
    color                   var(--transition),
    text-decoration-color   var(--transition);
}

.contact-link:hover,
.contact-link:focus-visible {
  color: var(--clr-accent);
  text-decoration-color: var(--clr-accent);
}

.contact-link--linkedin {
  font-weight: 600;
  color: var(--clr-accent);
  text-decoration-color: var(--clr-accent-light);
}

.contact-link--linkedin:hover {
  color: var(--clr-accent-dark);
}


/* ============================================================
   13. Footer
   ============================================================ */
.site-footer {
  background-color: var(--clr-bg-alt);
  border-top: 1px solid var(--clr-border);
  padding-block: var(--space-4);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.footer-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.footer-logo {
  height: 56px;
  width: auto;
  display: block;
  opacity: 0.85;
  transition: opacity var(--transition);
}

.footer-brand:hover .footer-logo,
.footer-brand:focus-visible .footer-logo {
  opacity: 1;
}

.footer-copy {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  max-width: none;
  line-height: 1.4;
}


/* ============================================================
   14. Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition:
    background-color   var(--transition),
    transform          var(--transition),
    box-shadow         var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn--primary {
  background-color: var(--clr-accent);
  color: var(--clr-text-light);
  border-color: var(--clr-accent);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background-color: var(--clr-accent-dark);
  border-color: var(--clr-accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(91, 124, 153, 0.30);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: none;
}


/* ============================================================
   15. Form Elements
   ============================================================ */
.contact-form-wrap {
  /* slight visual separation from info card */
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text);
  letter-spacing: 0.02em;
}

.required {
  color: var(--clr-accent);
  margin-left: 2px;
}

.optional {
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  margin-left: 4px;
}

/* Shared input / textarea styles */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--clr-text);
  background-color: var(--clr-bg);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-md);
  transition:
    border-color var(--transition),
    box-shadow   var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: #a8afbe;
}

.form-input:hover {
  border-color: #b5becf;
}

.form-input:focus {
  outline: none;
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px var(--clr-accent-light);
}

/* Error state */
.form-group.has-error .form-input {
  border-color: var(--clr-error);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 132px;
  line-height: 1.6;
}

/* Inline error text */
.form-error {
  font-size: var(--text-sm);
  color: var(--clr-error);
  min-height: 1.2em;    /* prevent layout shift when text appears */
  display: block;
  font-weight: 500;
}

/* Success message */
.form-success {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background-color: var(--clr-success-bg);
  border: 1px solid #b2d9c8;
  border-radius: var(--radius-md);
  color: var(--clr-success);
  font-size: var(--text-base);
  font-weight: 500;
  animation: slideDown 0.35s ease forwards;
}

/* When JS removes the hidden attribute the element is shown */
.form-success[hidden] {
  display: none;
}

.success-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
  stroke: var(--clr-success);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ============================================================
   16. Responsive — Tablet (≤ 1024 px)
   ============================================================ */
@media (max-width: 1024px) {
  :root {
    --space-7: 5rem;   /* slightly less vertical section padding */
  }

  .contact-grid {
    grid-template-columns: 1fr 1.4fr;
    gap: var(--space-4);
  }
}


/* ============================================================
   17. Responsive — Mobile (≤ 768 px)
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --space-7: 4rem;
    --space-6: 3rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
  }

  /* — Navigation — */
  .main-nav {
    display: none;   /* desktop nav hidden; mobile overlay takes over */
  }

  .hamburger {
    display: flex;
  }

  .mobile-menu {
    display: block;
  }

  /* — Hero images: stack vertically — */
  .hero-images {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .hero-image-wrap {
    aspect-ratio: 16 / 9;
  }

  /* — Remove centring constraint on hero copy — */
  .hero-copy {
    text-align: left;
  }

  /* — Full-width section layout — */
  .section-inner {
    gap: var(--space-4);
  }

  /* — Client cards: single column on mobile — */
  .client-cards {
    grid-template-columns: 1fr;
  }

  /* — Contact section: single column — */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  /* Reorder: form above info card on small screens */
  .contact-form-wrap {
    order: -1;
  }

  /* — Footer: stack on small screens — */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }
}

/* Extra-small screens */
@media (max-width: 420px) {
  :root {
    --space-4: 1.25rem;
  }

  h2 { font-size: 1.75rem; }

  .btn--primary {
    width: 100%;
  }
}


/* ============================================================
   18. Reduced-Motion
   Respect user's OS-level "reduce motion" preference.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
