/* ==========================================================================
   KairosTech IT Solutions — Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Custom properties — swap these values to update the brand palette
      and type scale everywhere at once.
   -------------------------------------------------------------------------- */
:root {
  /* Brand colors — see brand guide for usage rules */
  --navy: #0D2B5E;        /* Kairos Navy — primary, backgrounds/text/logo spine */
  --gold: #C9A84C;        /* Kairos Gold — accents, CTAs, highlights */
  --light-gold: #E8C96A;  /* hover states */
  --dark-navy: #07111E;   /* dark sections/footer */
  --off-white: #F5F0E8;   /* body text on dark, light surfaces */
  --muted-gold: #A8832A;  /* gold on light backgrounds, for AA contrast */

  /* Semantic aliases — change these, not the raw colors above, when
     restyling a specific role (e.g. swap --color-surface for a new bg) */
  --color-bg: var(--off-white);
  --color-bg-alt: #EDE6D8;       /* slightly deeper off-white for alternating sections */
  --color-surface-dark: var(--dark-navy);
  --color-text: var(--navy);
  --color-text-on-dark: var(--off-white);
  --color-accent: var(--muted-gold);
  --color-accent-on-dark: var(--gold);
  --color-accent-hover: var(--light-gold);

  /* Typography */
  --font-display: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  /* Layout */
  --container-width: 1200px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  --border-thin: 1px solid rgba(13, 43, 94, 0.15);
  --border-thin-on-dark: 1px solid rgba(245, 240, 232, 0.2);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 var(--space-sm);
}

p {
  margin: 0 0 var(--space-sm);
}

em {
  font-style: italic;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

/* Skip link — visually hidden until focused */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: var(--off-white);
  padding: var(--space-xs) var(--space-sm);
  z-index: 1000;
}

.skip-link:focus {
  left: var(--space-sm);
  top: var(--space-sm);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Eyebrow / label text — sparing use, all caps, wide tracking */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 200;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-xs);
}

/* --------------------------------------------------------------------------
   3. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  padding: 0.85em 2em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background-color: var(--navy);
  color: var(--off-white);
  border-color: var(--navy);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--muted-gold);
  border-color: var(--muted-gold);
}

/* --------------------------------------------------------------------------
   4. Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.site-header.scrolled {
  border-bottom-color: rgba(13, 43, 94, 0.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.logo {
  height: 32px; /* brand minimum digital size */
  width: auto;
}

/* Wordmark set beside the icon in the header — "Kairos" bold, "Tech" regular */
.logo-wordmark {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  white-space: nowrap;
}

.logo-wordmark span {
  font-weight: 400;
}

/* The provided logo file has an opaque white background — this backing
   plate keeps it legible on the dark footer until a transparent/white
   logo variant is provided. Not needed on the light header. */
.logo-badge {
  background-color: var(--off-white);
  padding: var(--space-xs) var(--space-sm);
}

/* Hamburger toggle — mobile only */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--navy);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.primary-nav {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(80vw, 320px);
  background-color: var(--navy);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  padding: calc(var(--space-xl)) var(--space-md);
}

.primary-nav.is-open {
  transform: translateX(0);
}

.primary-nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.primary-nav a {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.1rem;
  color: var(--off-white);
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  color: var(--gold);
}

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */
.hero {
  padding: var(--space-xl) 0;
}

.hero-inner {
  max-width: 760px;
}

.hero-tagline {
  font-size: clamp(2.25rem, 5vw + 1rem, 4rem);
  font-weight: 300;
  color: var(--navy);
  margin-bottom: var(--space-md);
}

.hero-tagline em {
  color: var(--muted-gold);
}

.hero-sub {
  font-size: 1.1rem;
  max-width: 46ch;
  margin-bottom: var(--space-md);
}

/* --------------------------------------------------------------------------
   6. About / Why Kairos / How I Work — shared text-section rhythm
   -------------------------------------------------------------------------- */
.about,
.why-kairos,
.how-i-work {
  padding: var(--space-lg) 0;
}

.why-kairos {
  background-color: var(--color-bg-alt);
}

.about h2,
.why-kairos h2,
.how-i-work h2 {
  font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem);
  max-width: 20ch;
}

.about p,
.why-kairos p,
.how-i-work p {
  max-width: 62ch;
  font-size: 1rem;
}

/* --------------------------------------------------------------------------
   7. Services
   -------------------------------------------------------------------------- */
.services {
  padding: var(--space-lg) 0;
  background-color: var(--dark-navy);
  color: var(--off-white);
}

.services h2 {
  color: var(--off-white);
  font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem);
  margin-bottom: var(--space-md);
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.service-card {
  padding: var(--space-md);
  border: var(--border-thin-on-dark);
}

.service-card h3 {
  color: var(--gold);
  font-size: 1.3rem;
  margin-bottom: var(--space-xs);
}

.service-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
  color: var(--off-white);
}

.service-card .card-link {
  display: inline-block;
  margin-top: var(--space-sm);
  color: var(--gold);
  font-size: 0.95rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.service-card .card-link:hover,
.service-card .card-link:focus-visible {
  border-bottom-color: var(--gold);
}

/* --------------------------------------------------------------------------
   8. Contact
   -------------------------------------------------------------------------- */
.contact {
  padding: var(--space-lg) 0;
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.contact h2 {
  font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem);
}

.contact-details {
  margin: var(--space-md) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.contact-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 200;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.contact-details a {
  font-size: 1.05rem;
}

.contact-details a:hover,
.contact-details a:focus-visible {
  color: var(--muted-gold);
}

/* Hidden per request — markup kept in place so it's a one-line
   change to bring back once profile URLs are ready. */
.social-links {
  display: none;
  gap: var(--space-sm);
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: var(--border-thin);
  color: var(--navy);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.social-links a:hover,
.social-links a:focus-visible {
  background-color: var(--navy);
  color: var(--off-white);
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

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

.form-field label {
  font-family: var(--font-body);
  font-weight: 200;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--navy);
}

.form-field input,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  color: var(--navy);
  background-color: var(--color-bg);
  border: var(--border-thin);
  border-width: 0 0 1px 0;
  padding: 0.6em 0.2em;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-bottom-color: var(--muted-gold);
}

.form-field input:invalid:not(:placeholder-shown),
.form-field textarea:invalid:not(:placeholder-shown) {
  border-bottom-color: #A83A2A;
}

.form-error {
  font-size: 0.8rem;
  color: #A83A2A;
  min-height: 1.2em;
}

.form-status {
  font-size: 0.95rem;
  color: var(--muted-gold);
  margin: 0;
}

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--dark-navy);
  color: var(--off-white);
  padding: var(--space-lg) 0 var(--space-md);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
}

.footer-tagline {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
  margin: 0;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
}

.footer-nav a {
  font-size: 0.9rem;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--gold);
}

.site-footer .social-links a {
  border-color: var(--border-thin-on-dark);
  color: var(--off-white);
}

.site-footer .social-links a:hover,
.site-footer .social-links a:focus-visible {
  background-color: var(--gold);
  color: var(--dark-navy);
}

.footer-copyright {
  font-size: 0.8rem;
  color: rgba(245, 240, 232, 0.6);
  margin: 0;
}

/* --------------------------------------------------------------------------
   10. Breakpoints — mobile-first, min-width media queries
   -------------------------------------------------------------------------- */

/* 480px — small phones up to large phones */
@media (min-width: 480px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 768px — tablets and up: switch to horizontal nav, wider layouts */
@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .primary-nav {
    position: static;
    height: auto;
    width: auto;
    background-color: transparent;
    transform: none;
    padding: 0;
  }

  .primary-nav ul {
    flex-direction: row;
    gap: var(--space-md);
  }

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

  .primary-nav a:hover,
  .primary-nav a:focus-visible {
    color: var(--muted-gold);
  }

  .contact-inner {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .footer-nav ul {
    justify-content: flex-start;
  }
}

/* 1024px — desktop: three-column services grid, roomier spacing */
@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Projects page: two cards share the row equally */
  #projects .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    padding: calc(var(--space-xl) * 1.25) 0;
  }
}

/* 1440px — large desktop: cap line lengths, add breathing room */
@media (min-width: 1440px) {
  :root {
    --container-width: 1320px;
  }

  .hero-sub {
    font-size: 1.25rem;
  }
}
