/* ============================================================
   JohnsCo — styles.css
   Single-page professional site, no build step required.
   Deployable as-is to Synology Web Station.
   ============================================================ */

/* ===== Custom Properties (light mode) ===== */
:root {
  /* Brand palette */
  --brand-primary: #2878B8;
  --brand-mid:     #3A7DC6;
  --brand-light:   #B0C8E0;
  --brand-tint:    #E8F2FA;
  --brand-dark:    #1A5A8F;

  /* Text */
  --text-primary:   #111111;
  --text-secondary: #555555;
  --text-muted:     #888888;

  /* Backgrounds */
  --bg-primary:   #FFFFFF;
  --bg-secondary: #F7FBFE;

  /* Borders */
  --border-light: #E0E0E0;

  /* Layout */
  --nav-height:    64px;
  --max-width:     1100px;
  --section-v-pad: 80px;
  --section-h-pad: 24px;

  /* Typography */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --brand-primary: #5AA0DC;
    --brand-mid:     #6AAFE8;
    --brand-light:   #3A607A;
    --brand-tint:    #1A2E48;
    --brand-dark:    #3A80C0;

    --text-primary:   #E8F0F8;
    --text-secondary: #A8BCCC;
    --text-muted:     #6A8099;

    --bg-primary:   #0F1C2E;
    --bg-secondary: #162335;

    --border-light: #243444;
  }
}

/* ===== Base Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
}

a:hover {
  color: var(--brand-mid);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ===== Navigation ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--section-h-pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand:hover {
  text-decoration: none;
}

.nav-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-brand-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-primary);
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2px;
  align-items: center;
}

.nav-links a {
  display: block;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-links a:hover {
  color: var(--brand-primary);
  background-color: var(--brand-tint);
  text-decoration: none;
}

.nav-links a:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* ===== Hero ===== */
.hero-section {
  position: relative;
  background-color: var(--brand-tint);
  overflow: hidden;
  padding: var(--section-v-pad) var(--section-h-pad);
}

.hero-bg-svg {
  position: absolute;
  top: -30px;
  right: -60px;
  color: var(--brand-primary);
  opacity: 0.09;
  pointer-events: none;
  user-select: none;
}

@media (prefers-color-scheme: dark) {
  .hero-bg-svg {
    opacity: 0.13;
  }
}

.hero-container {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}

.hero-content {
  max-width: 640px;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: 16px;
}

.hero-name {
  font-size: clamp(30px, 4.5vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.hero-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--brand-primary);
  margin-bottom: 20px;
  letter-spacing: 0.01em;
}

.hero-tagline {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 560px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease,
              border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #FFFFFF;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(40, 120, 184, 0.35);
}

.btn-secondary {
  background-color: transparent;
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-secondary:hover {
  background-color: var(--brand-primary);
  color: #FFFFFF;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(40, 120, 184, 0.25);
}

/* Portrait */
.hero-portrait {
  display: flex;
  justify-content: center;
  align-items: center;
}

.portrait-wrapper {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 4px solid #FFFFFF;
  box-shadow: 0 4px 20px rgba(40, 120, 184, 0.2);
  overflow: hidden;
  flex-shrink: 0;
  background-color: var(--brand-tint);
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ===== Shared Section Styles ===== */
.section {
  padding: var(--section-v-pad) var(--section-h-pad);
}

.section-alt {
  background-color: var(--bg-secondary);
}

.section-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-heading {
  font-size: clamp(20px, 2.8vw, 28px);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--brand-light);
  letter-spacing: -0.3px;
}

.subsection-heading {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 40px;
  margin-bottom: 16px;
}

/* Prose block — used in About, Product Experience */
.prose p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 780px;
  margin-bottom: 20px;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* ===== Expertise Section ===== */
.expertise-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.cluster-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-primary);
  margin-bottom: 14px;
}

/* Scrollable table wrapper for narrow viewports */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.expertise-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.capabilities-table {
  max-width: 780px;
}

.expertise-table thead th {
  text-align: left;
  padding: 9px 14px;
  background-color: var(--brand-tint);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-light);
}

.expertise-table thead th:first-child { border-radius: 6px 0 0 0; }
.expertise-table thead th:last-child  { border-radius: 0 6px 0 0; }

.expertise-table tbody td {
  padding: 10px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  line-height: 1.55;
}

.expertise-table tbody td:first-child {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 160px;
}

.expertise-table tbody tr:last-child td {
  border-bottom: none;
}

.expertise-table tbody tr:hover td {
  background-color: var(--brand-tint);
}

/* ===== Consulting Engagements ===== */
.engagements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.engagement-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--brand-primary);
  border-radius: 0 8px 8px 0;
  padding: 24px 24px 24px 22px;
  transition: box-shadow 0.15s ease;
}

.engagement-card:hover {
  box-shadow: 0 4px 18px rgba(40, 120, 184, 0.13);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  background-color: var(--brand-tint);
  color: var(--brand-primary);
  border: 1px solid var(--brand-light);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.card-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Additional engagements list */
.additional-engagements {
  border-top: 1px solid var(--border-light);
  padding-top: 40px;
}

.additional-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 780px;
}

.additional-list li {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  padding-left: 16px;
  border-left: 2px solid var(--brand-light);
}

.additional-list li strong {
  color: var(--text-primary);
}

/* ===== Contact Section ===== */
.contact-statement {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 36px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 40px;
  max-width: 640px;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.contact-item dt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.contact-item dd {
  font-size: 14px;
  color: var(--text-secondary);
}

.contact-item dd a {
  color: var(--brand-primary);
  text-decoration: none;
}

.contact-item dd a:hover {
  color: var(--brand-mid);
  text-decoration: underline;
}

/* ===== Footer ===== */
.site-footer {
  background-color: var(--brand-primary);
  color: rgba(255, 255, 255, 0.92);
  padding: 28px var(--section-h-pad);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.footer-container p {
  margin: 0;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ===== Responsive — Mobile (<= 768px) ===== */
@media (max-width: 768px) {
  :root {
    --section-v-pad: 56px;
    --section-h-pad: 20px;
  }

  /* Nav: show hamburger, hide link list by default */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 10px 20px 16px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    padding: 10px 12px;
  }

  /* Hero: single column, portrait on top */
  .hero-container {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .hero-portrait { order: 1; }
  .hero-content  { order: 2; }

  .hero-ctas {
    justify-content: center;
  }

  .hero-tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-bg-svg {
    opacity: 0.06;
    right: -100px;
  }

  /* Expertise: stack clusters */
  .expertise-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Engagements: single column */
  .engagements-grid {
    grid-template-columns: 1fr;
  }

  /* Contact: single column */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Footer: stack */
  .footer-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
