/* ============================================
   OACIS Consulting — Organizations as Code
   Hosted on Cloudflare Pages (Static Site)
   Design: Editorial / Architectural Modernism
   Palette: Deep navy, warm amber, clean whites
   Typography: Playfair Display + Source Sans 3
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400;1,600&family=Source+Sans+3:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- CSS Variables --- */
:root {
  --navy: #0a1628;
  --navy-mid: #132240;
  --navy-light: #1c3259;
  --amber: #d4952a;
  --amber-light: #e8b65c;
  --amber-glow: rgba(212, 149, 42, 0.12);
  --cream: #faf8f4;
  --white: #ffffff;
  --gray-100: #f4f2ee;
  --gray-200: #e8e4dc;
  --gray-300: #d1ccc2;
  --gray-500: #8a8477;
  --gray-700: #4a4640;
  --gray-900: #1a1815;
  --text-body: #2c2a26;
  --text-muted: #6b665d;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  --max-width: 1200px;
  --content-width: 800px;
  --radius: 3px;
  --shadow-sm: 0 1px 3px rgba(10, 22, 40, 0.06);
  --shadow-md: 0 4px 16px rgba(10, 22, 40, 0.08);
  --shadow-lg: 0 12px 40px rgba(10, 22, 40, 0.12);
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--cream);
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--amber); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--navy); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
}

h1 { font-size: 3.2rem; letter-spacing: -0.02em; }
h2 { font-size: 2.2rem; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1.2rem; }

/* --- Utility --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; }
.content-narrow { max-width: var(--content-width); margin: 0 auto; }
.text-center { text-align: center; }
.text-amber { color: var(--amber); }
.text-muted { color: var(--text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* --- Navigation --- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--navy);
  border-bottom: 2px solid var(--amber);
  transition: var(--transition);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-logo span {
  color: var(--amber);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.65em;
  margin-left: 0.3em;
  font-weight: 400;
  opacity: 0.8;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
}

.nav-links a {
  display: block;
  padding: 0.5rem 1rem;
  color: rgba(255,255,255,0.75);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
  background: rgba(212, 149, 42, 0.15);
}

.nav-links a.active {
  border-bottom: 2px solid var(--amber);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  margin: 5px 0;
  transition: var(--transition);
}

/* --- Hero Sections --- */
.hero {
  position: relative;
  background: var(--navy);
  color: var(--white);
  padding: 10rem 0 6rem;
  overflow: hidden;
  margin-top: 72px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(212, 149, 42, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(28, 50, 89, 0.4) 0%, transparent 60%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 60px,
      rgba(255,255,255,0.015) 60px,
      rgba(255,255,255,0.015) 61px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 60px,
      rgba(255,255,255,0.015) 60px,
      rgba(255,255,255,0.015) 61px
    );
  pointer-events: none;
}

.hero .container { position: relative; z-index: 1; }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--amber);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.hero h1 {
  color: var(--white);
  font-size: 3.8rem;
  max-width: 700px;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.15s forwards;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255,255,255,0.7);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.3s forwards;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.45s forwards;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--amber);
  color: var(--navy);
  border-color: var(--amber);
}

.btn-primary:hover {
  background: var(--amber-light);
  border-color: var(--amber-light);
  color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 149, 42, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.3);
}

.btn-outline:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.btn-outline-dark {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

.btn-outline-dark:hover {
  background: var(--navy);
  color: var(--white);
}

/* --- Sections --- */
.section {
  padding: 5rem 0;
}

.section-dark {
  background: var(--navy);
  color: var(--white);
}

.section-dark h2,
.section-dark h3 {
  color: var(--white);
}

.section-alt {
  background: var(--gray-100);
}

.section-header {
  margin-bottom: 3.5rem;
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
}

.section-header.text-center p {
  margin-left: auto;
  margin-right: auto;
}

.section-divider {
  width: 60px;
  height: 3px;
  background: var(--amber);
  margin: 1.5rem 0;
}

.section-header.text-center .section-divider {
  margin-left: auto;
  margin-right: auto;
}

/* --- Cards Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--amber);
  border-radius: var(--radius) var(--radius) 0 0;
  opacity: 0;
  transition: var(--transition);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1.2rem;
  display: block;
}

.card h3 {
  margin-bottom: 0.8rem;
  font-size: 1.25rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --- Principle Cards (numbered) --- */
.principle-card {
  counter-increment: principle;
  padding-left: 5rem;
}

.principle-card::after {
  content: counter(principle);
  position: absolute;
  top: 2rem;
  left: 2rem;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--amber);
  opacity: 0.2;
  line-height: 1;
}

/* --- Blog Cards --- */
.blog-card {
  padding: 0;
  overflow: hidden;
}

.blog-card-image {
  height: 200px;
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

.blog-card-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--navy-mid), var(--navy-light));
}

.blog-card-image .blog-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  opacity: 0.3;
  z-index: 1;
}

.blog-card-body {
  padding: 2rem;
}

.blog-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--amber);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.blog-card h3 {
  margin-bottom: 0.8rem;
  font-size: 1.2rem;
  line-height: 1.4;
}

.blog-card h3 a {
  color: var(--navy);
}

.blog-card h3 a:hover {
  color: var(--amber);
}

.blog-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber);
  margin-top: 0.5rem;
}

.read-more:hover {
  gap: 0.8rem;
  color: var(--navy);
}

.read-more::after {
  content: '\2192';
}

/* --- Blockquote / Pullquote --- */
.pullquote {
  position: relative;
  padding: 3rem 3rem 3rem 4rem;
  background: var(--amber-glow);
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 3rem 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--navy);
}

.pullquote::before {
  content: '\201C';
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-size: 4rem;
  color: var(--amber);
  opacity: 0.3;
  line-height: 1;
  font-family: var(--font-display);
}

.pullquote cite {
  display: block;
  margin-top: 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-style: normal;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* --- Stats Row --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
  padding: 3rem 0;
}

.stat h3 {
  font-size: 3rem;
  color: var(--amber);
  margin-bottom: 0.3rem;
}

.stat p {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.6);
}

/* --- Services / Consulting --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  transition: var(--transition);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--amber);
}

.service-icon {
  width: 64px;
  height: 64px;
  background: var(--amber-glow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.6rem;
}

.service-card h3 {
  margin-bottom: 1rem;
  font-size: 1.15rem;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* --- Contact Form --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-info h3 {
  margin-bottom: 1.5rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.contact-item-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--amber-glow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.contact-item h4 {
  font-family: var(--font-body);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.contact-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.contact-item a {
  color: var(--amber);
}

.contact-form {
  background: var(--white);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--text-body);
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

/* --- Blog Post (full page) --- */
.post-header {
  padding: 8rem 0 4rem;
  margin-top: 72px;
  background: var(--navy);
  color: var(--white);
}

.post-header h1 {
  color: var(--white);
  font-size: 2.8rem;
  max-width: 700px;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--amber);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.post-content {
  padding: 4rem 0;
}

.post-content .content-narrow {
  font-size: 1.05rem;
  line-height: 1.8;
}

.post-content h2 {
  margin-top: 3rem;
  margin-bottom: 1.2rem;
}

.post-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.post-content ul, .post-content ol {
  margin: 1.5rem 0;
  padding-left: 1.8rem;
}

.post-content li {
  margin-bottom: 0.6rem;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--gray-100);
  padding: 0.15em 0.4em;
  border-radius: 2px;
}

.post-content pre {
  background: var(--navy);
  color: rgba(255,255,255,0.9);
  padding: 1.5rem 2rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* --- About / Book Section --- */
.book-showcase {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 4rem;
  align-items: center;
}

.book-cover {
  background: linear-gradient(145deg, var(--navy), var(--navy-mid));
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--white);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.book-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--amber);
}

.book-cover h3 {
  font-size: 2rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.book-cover .subtitle {
  font-style: italic;
  font-family: var(--font-display);
  color: var(--amber-light);
  font-size: 0.95rem;
  line-height: 1.5;
}

.book-cover .tradition {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin-top: 2rem;
  font-style: italic;
}

.book-details h2 {
  margin-bottom: 1.5rem;
}

.book-details p {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.book-editions {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
}

.edition-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.edition-badge.active {
  border-color: var(--amber);
  color: var(--navy);
  background: var(--amber-glow);
}

/* --- Page Hero (smaller) --- */
.page-hero {
  padding: 8rem 0 4rem;
  margin-top: 72px;
  background: var(--navy);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 70%, rgba(212, 149, 42, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.page-hero .container { position: relative; z-index: 1; }

.page-hero h1 {
  color: var(--white);
  font-size: 2.8rem;
  margin-bottom: 1rem;
}

.page-hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.65);
  max-width: 560px;
}

/* --- Footer --- */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 4rem 0 2rem;
  border-top: 2px solid var(--amber);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--white);
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.5);
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.2rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.6rem;
}

.footer-col a {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.35);
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .book-showcase { grid-template-columns: 1fr; }
  .book-cover { max-width: 320px; margin: 0 auto; }
  .contact-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  html { font-size: 15px; }
  h1 { font-size: 2.4rem; }
  h2 { font-size: 1.7rem; }
  .hero { padding: 8rem 0 4rem; }
  .hero h1 { font-size: 2.6rem; }
  .section { padding: 3.5rem 0; }

  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
  }

  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }

  .footer-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}
