/* ==========================================================================
   Fractalic Studio — Design System
   Based on Brand Identity v0.9
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens (from fractalic_identity.md)
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --bg: #F9FAFB;
  --bg-alt: #F3F4F6;
  --ink: #0B1120;
  --graphite: #4B5563;
  --fog: #E5E7EB;
  --accent: #059669;
  --accent-hover: #047857;
  --accent-light: rgba(5, 150, 105, 0.1);
  --warn: #B45309;
  --error: #B91C1C;
  --white: #FFFFFF;
  
  /* Typography */
  --font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.375rem;   /* 22px */
  --font-size-2xl: 1.75rem;   /* 28px */
  --font-size-3xl: 2.25rem;   /* 36px */
  --font-size-4xl: 3rem;      /* 48px */
  
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.2;
  --line-height-base: 1.6;
  --line-height-relaxed: 1.8;
  
  /* Spacing (8pt grid) */
  --space-xs: 0.5rem;    /* 8px */
  --space-sm: 0.75rem;   /* 12px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */
  --space-4xl: 6rem;     /* 96px */
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 8px 20px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  
  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
  color: var(--ink);
  background-color: var(--bg);
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

ul, ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--ink);
}

h1 {
  font-size: var(--font-size-3xl);
}

h2 {
  font-size: var(--font-size-2xl);
}

h3 {
  font-size: var(--font-size-xl);
}

h4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
}

p {
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: var(--font-weight-semibold);
}

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.section {
  padding: var(--space-3xl) 0;
}

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

.section--dark {
  background-color: var(--ink);
  color: var(--white);
}

.section__title {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-xl);
  text-align: center;
}

.section__title--light {
  color: var(--white);
}

.section__intro {
  font-size: var(--font-size-lg);
  color: var(--graphite);
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-2xl);
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-4xl) 0;
  }
  
  .section__title {
    font-size: var(--font-size-3xl);
  }
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn--primary {
  background-color: var(--accent);
  color: var(--white);
}

.btn--primary:hover {
  background-color: var(--accent-hover);
  color: var(--white);
}

.btn--large {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--font-size-lg);
}

/* --------------------------------------------------------------------------
   6. Header & Navigation
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(249, 250, 251, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--fog);
  transition: all var(--transition-base);
}

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

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--ink);
  text-decoration: none;
}

.nav__logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.nav__logo-text {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
}

.nav__menu {
  display: none;
}

.nav__list {
  display: flex;
  gap: var(--space-xl);
}

.nav__link {
  color: var(--graphite);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast);
}

.nav__link:hover {
  color: var(--ink);
}

.nav__cta {
  display: none;
}

.nav__toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-xs);
  background: none;
  border: none;
  cursor: pointer;
}

.nav__toggle-bar {
  width: 24px;
  height: 2px;
  background-color: var(--ink);
  transition: all var(--transition-fast);
}

@media (min-width: 768px) {
  .nav__menu {
    display: block;
  }
  
  .nav__cta {
    display: inline-flex;
  }
  
  .nav__toggle {
    display: none;
  }
}

/* Mobile menu open state */
.nav__menu.active {
  display: block;
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  background-color: var(--bg);
  border-bottom: 1px solid var(--fog);
  padding: var(--space-lg);
}

.nav__menu.active .nav__list {
  flex-direction: column;
  gap: var(--space-md);
}

/* --------------------------------------------------------------------------
   7. Hero Section
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 72px;
  overflow: hidden;
}

.hero__video-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(249, 250, 251, 0.85) 0%,
    rgba(249, 250, 251, 0.95) 50%,
    rgba(249, 250, 251, 1) 100%
  );
}

.hero__content {
  position: relative;
  text-align: center;
  max-width: 800px;
  padding: var(--space-2xl) var(--space-lg);
}

.hero__title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-lg);
  letter-spacing: -0.02em;
}

.hero__subtitle {
  font-size: var(--font-size-lg);
  color: var(--graphite);
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero__actions {
  margin-bottom: var(--space-md);
}

.hero__microcopy {
  font-size: var(--font-size-sm);
  color: var(--graphite);
  font-style: italic;
}

@media (min-width: 768px) {
  .hero__title {
    font-size: var(--font-size-4xl);
  }
  
  .hero__subtitle {
    font-size: var(--font-size-xl);
  }
}

/* --------------------------------------------------------------------------
   8. Problem Section
   -------------------------------------------------------------------------- */
.problem__grid {
  display: grid;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.problem__card {
  background: var(--white);
  border: 1px solid var(--fog);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.problem__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  color: var(--accent);
}

.problem__text {
  color: var(--graphite);
  margin: 0;
}

.problem__result {
  text-align: center;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  color: var(--ink);
}

@media (min-width: 768px) {
  .problem__grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .problem__card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}

/* --------------------------------------------------------------------------
   9. Pillars (Approach)
   -------------------------------------------------------------------------- */
.pillars {
  display: grid;
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

.pillar {
  text-align: center;
}

.pillar__number {
  display: inline-block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.pillar__title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
}

.pillar__text {
  color: var(--graphite);
}

@media (min-width: 768px) {
  .pillars {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --------------------------------------------------------------------------
   10. Services
   -------------------------------------------------------------------------- */
.services__grid {
  display: grid;
  gap: var(--space-lg);
}

.service-card {
  background: var(--white);
  border: 1px solid var(--fog);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  transition: box-shadow var(--transition-base);
}

.service-card:hover {
  box-shadow: var(--shadow-card);
}

.service-card__header {
  margin-bottom: var(--space-md);
}

.service-card__duration {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.service-card__title {
  font-size: var(--font-size-xl);
}

.service-card__for {
  color: var(--graphite);
  margin-bottom: var(--space-md);
}

.service-card__deliverables,
.service-card__format {
  margin-bottom: var(--space-md);
}

.service-card__deliverables h4,
.service-card__format h4 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--ink);
  margin-bottom: var(--space-xs);
}

.service-card__deliverables ul,
.service-card__format ul {
  padding-left: var(--space-lg);
}

.service-card__deliverables li,
.service-card__format li {
  position: relative;
  color: var(--graphite);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-xs);
  list-style: disc;
}

@media (min-width: 768px) {
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --------------------------------------------------------------------------
   11. Cases
   -------------------------------------------------------------------------- */
.cases__grid {
  display: grid;
  gap: var(--space-lg);
}

.case-card {
  background: var(--white);
  border: 1px solid var(--fog);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
}

.case-card__industry {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.case-card__title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-lg);
}

.case-card__section {
  margin-bottom: var(--space-md);
}

.case-card__section:last-child {
  margin-bottom: 0;
}

.case-card__section h4 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.case-card__section p {
  color: var(--graphite);
  font-size: var(--font-size-sm);
  margin: 0;
}

@media (min-width: 768px) {
  .cases__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cases__grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Make first two cards span full width on large screens */
  .case-card:nth-child(1),
  .case-card:nth-child(2) {
    grid-column: span 1;
  }
}

/* --------------------------------------------------------------------------
   12. Process
   -------------------------------------------------------------------------- */
.process__steps {
  display: grid;
  gap: var(--space-lg);
}

.process__step {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.process__number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--white);
  font-weight: var(--font-weight-semibold);
  border-radius: 50%;
}

.process__title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-xs);
}

.process__text {
  color: var(--graphite);
  margin: 0;
}

@media (min-width: 768px) {
  .process__steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .process__steps {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .process__step {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}

/* --------------------------------------------------------------------------
   13. Fit Section
   -------------------------------------------------------------------------- */
.fit__content {
  max-width: 600px;
  margin: 0 auto;
}

.fit__list {
  margin: var(--space-md) 0;
  padding-left: var(--space-lg);
}

.fit__list li {
  position: relative;
  color: var(--graphite);
  margin-bottom: var(--space-sm);
  list-style: disc;
}

.fit__caveat {
  font-style: italic;
  color: var(--graphite);
  padding-top: var(--space-md);
  border-top: 1px solid var(--fog);
}

/* --------------------------------------------------------------------------
   14. FAQ
   -------------------------------------------------------------------------- */
.faq__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.faq__item {
  background: var(--white);
  border: 1px solid var(--fog);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  list-style: none;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question::after {
  content: '+';
  font-size: var(--font-size-xl);
  color: var(--accent);
  transition: transform var(--transition-fast);
}

.faq__item[open] .faq__question::after {
  transform: rotate(45deg);
}

.faq__answer {
  padding: 0 var(--space-lg) var(--space-lg);
  color: var(--graphite);
}

/* --------------------------------------------------------------------------
   15. About
   -------------------------------------------------------------------------- */
.about__content {
  margin-bottom: var(--space-2xl);
}

.about__content p {
  font-size: var(--font-size-lg);
  color: var(--graphite);
}

.about__principles h3 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-lg);
  text-align: center;
}

.principles__grid {
  display: grid;
  gap: var(--space-lg);
}

.principle {
  padding: var(--space-lg);
  background: var(--bg-alt);
  border-radius: var(--radius-md);
}

.principle h4 {
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.principle p {
  color: var(--graphite);
  font-size: var(--font-size-sm);
  margin: 0;
}

@media (min-width: 768px) {
  .principles__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .principles__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --------------------------------------------------------------------------
   16. Contact
   -------------------------------------------------------------------------- */
.contact__intro {
  font-size: var(--font-size-lg);
  text-align: center;
  margin-bottom: var(--space-xl);
  opacity: 0.9;
}

.contact__calendar {
  width: 100%;
  min-height: 600px;
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   17. Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--ink);
  color: var(--white);
  padding: var(--space-2xl) 0;
}

.footer__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__logo {
  width: 40px;
  height: 40px;
}

.footer__tagline {
  color: var(--graphite);
  font-size: var(--font-size-sm);
  margin: 0;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-xl);
}

.footer__links a {
  color: var(--graphite);
  font-size: var(--font-size-sm);
  transition: color var(--transition-fast);
}

.footer__links a:hover {
  color: var(--white);
}

.footer__bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__bottom p {
  color: var(--graphite);
  font-size: var(--font-size-sm);
  margin: 0;
}

@media (min-width: 768px) {
  .footer__content {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

/* --------------------------------------------------------------------------
   18. Utilities
   -------------------------------------------------------------------------- */
.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;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Selection color */
::selection {
  background-color: var(--accent);
  color: var(--white);
}
