/* ============================================================
   Framework & Co. — style.css
   Design system: tokens, reset, base, components, layout
   ============================================================ */

/* ------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------ */
:root {
  /* Colors */
  --color-bg:          #FAF8F4;        /* warm off-white */
  --color-surface:     #FFFFFF;
  --color-surface-alt: #F3F1EC;        /* slightly deeper warm gray */
  --color-border:      #E4E0D8;
  --color-text:        #1C1917;        /* near-black, warm */
  --color-text-muted:  #6B6560;
  --color-text-faint:  #A39E98;
  --color-accent:      #2847C4;        /* slate blue */
  --color-accent-dark: #1D3699;
  --color-accent-light:#EEF1FC;
  --color-accent-warm: #C8773A;        /* amber — used sparingly */

  /* Typography */
  --font-heading: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Mono', monospace;

  /* Type scale */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */
  --text-6xl:  3.75rem;    /* 60px */
  --text-7xl:  4.5rem;     /* 72px */

  /* Line heights */
  --leading-tight:  1.15;
  --leading-snug:   1.3;
  --leading-normal: 1.6;
  --leading-loose:  1.8;

  /* Spacing */
  --space-1:   0.25rem;
  --space-2:   0.5rem;
  --space-3:   0.75rem;
  --space-4:   1rem;
  --space-5:   1.25rem;
  --space-6:   1.5rem;
  --space-8:   2rem;
  --space-10:  2.5rem;
  --space-12:  3rem;
  --space-16:  4rem;
  --space-20:  5rem;
  --space-24:  6rem;
  --space-32:  8rem;

  /* Layout */
  --container-max: 1160px;
  --container-pad: var(--space-6);

  /* Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-md:  0 4px 12px rgba(28, 25, 23, 0.08), 0 2px 4px rgba(28, 25, 23, 0.04);
  --shadow-lg:  0 16px 40px rgba(28, 25, 23, 0.10), 0 4px 8px rgba(28, 25, 23, 0.04);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
}


/* ------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

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

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

ul, ol {
  list-style: none;
}

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

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}


/* ------------------------------------------------------------
   3. TYPOGRAPHY
   ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--color-text);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(var(--text-4xl), 6vw, var(--text-7xl)); }
h2 { font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }

p {
  max-width: 65ch;
  color: var(--color-text-muted);
}

.text-balance { text-wrap: balance; }

/* Utility text styles */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  color: var(--color-text-muted);
  max-width: 60ch;
}


/* ------------------------------------------------------------
   4. LAYOUT UTILITIES
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--space-24);
}

.section--sm {
  padding-block: var(--space-16);
}

.section--lg {
  padding-block: var(--space-32);
}

/* Grid helpers */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

/* Flex helpers */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }


/* ------------------------------------------------------------
   5. BUTTONS
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
}

/* Primary */
.btn-primary {
  background: var(--color-accent);
  color: #FFFFFF;
  border: 2px solid var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(40, 71, 196, 0.25);
}

/* Secondary / outlined */
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-text);
  transform: translateY(-1px);
}

/* Ghost — text link style */
.btn-ghost {
  background: transparent;
  color: var(--color-accent);
  border: 2px solid transparent;
  padding-inline: 0;
}

.btn-ghost:hover {
  color: var(--color-accent-dark);
}

/* Arrow icon inside buttons */
.btn-arrow {
  display: inline-block;
  transition: transform var(--transition-base);
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

/* Sizes */
.btn-lg {
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
}

.btn-sm {
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-4);
}


/* ------------------------------------------------------------
   6. NAVIGATION
   ------------------------------------------------------------ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 244, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition-base);
}

.site-nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* ── SVG Logo ──────────────────────────────────────────── */

.nav-wordmark,
.footer-wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
}

/* Nav logo */
.nav-wordmark img {
  display: block;
  height: 65px;
  width: auto;
  max-width: 351px;
}

/* Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform var(--transition-base);
  transform-origin: left;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

/* Mobile hamburger (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-2);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition-base);
}


/* ------------------------------------------------------------
   7. HERO
   ------------------------------------------------------------ */
.hero {
  padding-block: var(--space-32) var(--space-24);
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-headline {
  margin-block: var(--space-4) var(--space-6);
  font-size: clamp(2.75rem, 7vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

/* Accent underline on a key word */
.hero-headline .underline-accent {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.hero-headline .underline-accent::after {
  content: '';
  position: absolute;
  bottom: 0.08em;
  left: 0;
  width: 100%;
  height: 0.08em;
  background: var(--color-accent);
  border-radius: 2px;
}

.hero-body {
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  color: var(--color-text-muted);
  max-width: 55ch;
  margin-bottom: var(--space-10);
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Subtle background decoration */
.hero-bg-dot {
  position: absolute;
  top: -80px;
  right: -120px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, var(--color-accent-light) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}


/* ------------------------------------------------------------
   8. SECTION HEADERS
   ------------------------------------------------------------ */
.section-header {
  margin-bottom: var(--space-12);
}

.section-header .eyebrow {
  margin-bottom: var(--space-3);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
}


/* ------------------------------------------------------------
   9. SERVICE CARDS
   ------------------------------------------------------------ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: all var(--transition-base);
  cursor: default;
}

.service-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.service-icon {
  width: 44px;
  height: 44px;
  background: var(--color-accent-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
  font-size: var(--text-xl);
}

.service-card h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.service-card p {
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
  max-width: none;
}


/* ------------------------------------------------------------
   10. PORTFOLIO TEASER
   ------------------------------------------------------------ */
.portfolio-teaser {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-12);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
  transition: box-shadow var(--transition-base);
}

.portfolio-teaser:hover {
  box-shadow: var(--shadow-lg);
}

.portfolio-teaser-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-warm);
  background: rgba(200, 119, 58, 0.1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.portfolio-teaser h3 {
  margin-bottom: var(--space-4);
}

.portfolio-teaser p {
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  margin-bottom: var(--space-6);
}

/* Tech tags */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  padding: 3px var(--space-3);
  border-radius: var(--radius-full);
}

/* Visual placeholder / screenshot area */
.portfolio-teaser-visual {
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg);
  aspect-ratio: 4/3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  position: relative;
}

.portfolio-teaser-visual-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-faint);
}

.portfolio-visual-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

.portfolio-visual-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}


/* ------------------------------------------------------------
   11. CTA BAND
   ------------------------------------------------------------ */
.cta-band {
  background: var(--color-text);
  color: #FAF8F4;
  border-radius: var(--radius-xl);
  padding: var(--space-16) var(--space-12);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(40, 71, 196, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.cta-band h2 {
  color: #FFFFFF;
  margin-bottom: var(--space-4);
  position: relative;
}

.cta-band p {
  color: rgba(250, 248, 244, 0.7);
  font-size: var(--text-lg);
  margin-inline: auto;
  margin-bottom: var(--space-8);
  position: relative;
}

.cta-band .btn-primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  position: relative;
}

.cta-band .btn-primary:hover {
  background: #FFFFFF;
  border-color: #FFFFFF;
  color: var(--color-accent);
}


/* ------------------------------------------------------------
   12. FOOTER
   ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-12);
  margin-top: var(--space-24);
}

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

/* Footer logo */
.footer-wordmark img {
  display: block;
  height: 76px;
  width: auto;
  opacity: 0.85;
}

.footer-links {
  display: flex;
  gap: var(--space-6);
}

.footer-link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--color-text);
}

.footer-copy {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}


/* ------------------------------------------------------------
   13. DIVIDER / SEPARATOR
   ------------------------------------------------------------ */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-0);
}


/* ------------------------------------------------------------
   14. UTILITY CLASSES
   ------------------------------------------------------------ */
.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;
}

.text-center { text-align: center; }
.text-muted   { color: var(--color-text-muted); }
.text-accent  { color: var(--color-accent); }

.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }

.w-full { width: 100%; }


/* ------------------------------------------------------------
   15. RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  :root {
    --container-pad: var(--space-5);
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .portfolio-teaser {
    grid-template-columns: 1fr;
  }

  /* Reorder: visual goes below on mobile */
  .portfolio-teaser-visual {
    order: -1;
  }
}

@media (max-width: 680px) {
  :root {
    --container-pad: var(--space-4);
  }

  .hero {
    padding-block: var(--space-20) var(--space-16);
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4) var(--container-pad);
    /* Allow scrolling on very short screens (landscape phones) */
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    padding-block: var(--space-3);
    width: 100%;
    font-size: var(--text-base);
  }

  /* Hide the desktop slide-underline — on mobile, nav-link is width:100%,
     so ::after at left:0/right:0 renders as a full-width bar that cuts
     visually through each menu item. Use colour for active state instead. */
  .nav-link::after {
    display: none;
  }

  .nav-link.active {
    color: var(--color-accent);
    font-weight: 600;
  }

  /* "Let's talk" CTA button — keep pill shape, don't stretch to full row width */
  .nav-links .btn.nav-link {
    width: auto;
    align-self: flex-start;
    margin-top: var(--space-2);
  }

  .nav-toggle {
    display: flex;
  }

  /* Keep nav sticky on mobile so the hamburger remains accessible
     when the user has scrolled down the page                      */

  .cta-band {
    padding: var(--space-10) var(--space-6);
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .section {
    padding-block: var(--space-16);
  }

  .section--lg {
    padding-block: var(--space-20);
  }

  /* Logo: shrink for mobile so it fits left of the hamburger */
  .nav-wordmark img {
    height: 46px;
    max-width: 270px;
  }

  .footer-wordmark img {
    height: 59px;
  }
}
