@import url('variables.css');

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

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

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

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

/* Custom element wrapper — must be block so sticky header works */
site-nav { display: contents }

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

ul { list-style: none; }

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ============================================================
   Navigation
   ============================================================ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
}

/* Full-width bottom border — fades in on scroll via main.js .is-scrolled */
#site-header::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--color-border);
  opacity: 0;
  transition: opacity var(--t-slow);
}

#site-header.is-scrolled::after {
  opacity: 1;
}

.site-nav {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: 100px;           /* Initial expanded height */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  transition: height var(--t-slow);
}

/* Scrolled state: compact nav */
#site-header.is-scrolled .site-nav {
  height: var(--nav-h);   /* 72px */
}

/* Left and right link groups */
.nav-group {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  flex: 1;
}

.nav-left  { justify-content: flex-end; }
.nav-right { justify-content: flex-start; }

.nav-link {
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text);
  white-space: nowrap;
  transition: color var(--t-fast);
}

.nav-link:hover { color: var(--color-primary); }
.nav-link.active {
  font-weight: 700;
  color: var(--color-text);
}

/* ── Center logomark ────────────────────────────────────────
   Starts gray and transitions to red on scroll.
   Color is controlled via `color: currentColor` on the SVG,
   toggled by the .is-scrolled class added in main.js.
   ────────────────────────────────────────────────────────── */
.nav-logomark {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: var(--sp-4);   /* Breathing room on each side */
  color: #444444;
  transition: color var(--t-slow);
  line-height: 1;
}

#site-header.is-scrolled .nav-logomark {
  color: var(--color-primary);
}

.nav-logomark svg {
  height: 80px;           /* Initial expanded logo */
  width: auto;
  display: block;
  transition: height var(--t-slow);
}

#site-header.is-scrolled .nav-logomark svg {
  height: 44px;           /* Compact logo */
}

/* ── Mobile hamburger ───────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-1);
  color: var(--color-text);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform var(--t-base), opacity var(--t-base);
}

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

/* Mobile dropdown menu */
.mobile-nav {
  display: none;
  border-top: 1px solid var(--color-border);
  padding: var(--sp-3) var(--gutter) var(--sp-4);
  flex-direction: column;
  gap: var(--sp-2);
}

.mobile-nav.is-open {
  display: flex;
}

.mobile-nav .nav-link {
  font-size: var(--text-base);
  padding: 3px 0;
}

/* ============================================================
   Hero
   ============================================================ */
.section-hero {
  padding-top: var(--sp-6);
}

.hero-inner {
  display: flex;
  align-items: center;     /* Vertically center both columns */
  gap: var(--sp-5);
}

/* Profile photo */
.hero-photo { flex-shrink: 0; }

.photo-profile {
  width: 320px;
  display: block;
}

/* Text column */
.hero-text {
  flex: 1;
}

.wordmark-wrap { margin-bottom: var(--sp-2); }

.wordmark-img {
  height: 68px;
  width: auto;
  display: block;
}

.wordmark-placeholder {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--color-text);
}

.wordmark-placeholder .accent { color: var(--color-primary); }

/* Tagline */
.hero-tagline {
  font-size: var(--text-xl);
  font-weight: 200;
  color: var(--color-text-sub);
  line-height: 1.5;
}

/* Red rule at bottom of hero — also reused before testimonials */
.rule-primary {
  height: 2px;
  background: var(--color-primary);
  border: none;
  margin: 0;
}

/* ============================================================
   About
   ============================================================ */
.section-about {
  padding: var(--sp-5) 0;
}

.about-text {
  font-size: var(--text-lg);
  line-height: var(--leading);
  color: var(--color-text);
}

/* Emphasis: medium weight + barely-noticeable size lift */
p strong {
  font-weight: 500;
  font-size: calc(1em + 1px);
}

/* ============================================================
   Stats
   ============================================================ */
.section-stats {
  border-top:    1px dashed var(--color-border-dash);
  border-bottom: 1px dashed var(--color-border-dash);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: var(--sp-4) 0;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-inline: var(--sp-4);
}

.stat:first-child { padding-left: 0; }

.stat + .stat {
  border-left: 1px dashed var(--color-border-dash);
}

.stat-number {
  font-size: var(--text-stat);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--color-text);
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-sub);
  line-height: 1.4;
}

/* ============================================================
   Expertise Domains
   ============================================================ */
.section-domains {
  padding: var(--sp-4) 0 var(--sp-5);
}

.domains-heading {
  font-size: var(--text-lg);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--sp-3);
}

.domains-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2) var(--sp-5);
}

.domains-list li {
  font-size: var(--text-base);
  color: var(--color-text-sub);
}


/* ============================================================
   Testimonials
   ============================================================ */
.section-testimonials {
  padding-bottom: var(--sp-7);
}

.testimonials-heading {
  font-size: var(--text-xl);
  font-weight: 700;
  text-align: center;
  padding: var(--sp-5) 0 var(--sp-4);
}

/* ── Company Block ──────────────────────────────────────────
   Three-sided bracket: top, right, bottom borders only.
   Right corners are rounded (22px); left corners are square.
   Right-side accent line via ::after; horizontal lines via .company-rule spans.
   The ::after draws a top border (last 24px, matching the second rule's end)
   + a right border running down, forming a rounded-corner ╗ shape.
   No top border across the full block width — the company-rule spans serve as
   the horizontal portion of the line, threading through the dates.
   ────────────────────────────────────────────────────────── */
.company-block {
  position: relative;
  margin-bottom: var(--sp-6);
  /* No right padding — lets company-rule extend flush to the right edge   */
  /* where it meets the ::after pseudo-element.                             */
  padding: var(--sp-4) 0 var(--sp-4) 0;
}

/* Right-side accent line.
   top = padding-top (var(--sp-4)=32px) + half of 44px logo = 53px.
   This aligns the top of the pseudo-element with the company-rule line.
   The 24px width creates the corner overlap with the second .company-rule. */
.company-block::after {
  content: '';
  position: absolute;
  top: calc(var(--sp-4) + 21px);   /* align with top edge of 2px rule */
  right: 0;
  bottom: 0;
  width: 24px;
  border-top:   2px solid transparent;
  border-right: 2px solid transparent;
  border-radius: 0 22px 22px 0;    /* rounded top-right and bottom-right */
  box-sizing: border-box;
  pointer-events: none;
}

/* SwipeSimple — brand blue */
.company-block--swipesimple::after    { border-color: #1371CF; }
.company-block--swipesimple .company-rule { background: #1371CF; }

/* One Identity — brand blue */
.company-block--oneidentity::after    { border-color: #04AADA; }
.company-block--oneidentity .company-rule { background: #04AADA; }

/* DirectScale — brand blue */
.company-block--directscale::after    { border-color: #3DB6E5; }
.company-block--directscale .company-rule { background: #3DB6E5; }

/* Workfront — brand orange */
.company-block--workfront::after    { border-color: #F7812F; }
.company-block--workfront .company-rule { background: #F7812F; }

/* NuSkin */
.company-block--NuSkin::after    { border-color: #007599; }
.company-block--NuSkin .company-rule { background: #007599; }

.company-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.company-logo-wrap { flex-shrink: 0; }

.company-logo-img {
  height: 44px;
  width: auto;
  display: block;
}

/* Timeline: flex row containing rule ── dates ── rule */
.company-timeline {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}

/* Both the rule before AND after the dates */
.company-rule {
  flex: 1;
  display: block;
  height: 2px;
  background: var(--color-border);  /* Overridden per company above */
}

.company-years {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-sub);
  white-space: nowrap;
  margin-right: var(--sp-4);   /* mirrors the gap on the left side of the dates */
}

/* ── Individual Testimonial ─────────────────────────────────*/
.testimonial {
  display: flex;
  gap: var(--sp-4);
  /* Right padding keeps content well clear of the ::after right border */
  padding: var(--sp-3) var(--sp-6) var(--sp-3) 0;
}

/* Reviewer meta: photo + name + role */
.testimonial-meta {
  flex-shrink: 0;
  width: 150px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;   /* Right-justify photo, name, role */
  gap: 6px;
}

.reviewer-photo-wrap {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 22px 22px 0 22px;  /* no bottom-right — badge corner is square */
  overflow: hidden;
  flex-shrink: 0;
}

.reviewer-img {
  width: 150px;
  height: 150px;
  border-radius: 22px 22px 0 22px;
  object-fit: cover;
  display: block;
}

/* ── LinkedIn badge + hover jiggle ─────────────────────────
   Sits at the square bottom-right corner of the photo (26×26).
   On photo hover: plays a quick jiggle anchored at that corner.
   ────────────────────────────────────────────────────────── */
.reviewer-linkedin {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0A66C2;
  transform-origin: bottom right;
}

.reviewer-linkedin img {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes linkedin-jiggle {
  0%   { transform: rotate(0deg); }
  20%  { transform: rotate(-14deg); }
  45%  { transform: rotate(14deg); }
  65%  { transform: rotate(-8deg); }
  82%  { transform: rotate(6deg); }
  100% { transform: rotate(0deg); }
}

.reviewer-photo-wrap:hover .reviewer-linkedin {
  animation: linkedin-jiggle 0.45s ease both;
}

.reviewer-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
  line-height: 1.3;
}

.reviewer-role {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: right;
}

/* Quote text */
.testimonial-quote { flex: 1; }

.testimonial-quote p {
  font-size: var(--text-sm);
  line-height: var(--leading);
  color: var(--color-text);
  margin-bottom: var(--sp-2);
}

.testimonial-quote p:last-child { margin-bottom: 0; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--sp-4) 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
}

/* ============================================================
   Responsive — Three breakpoints
   ──────────────────────────────────────────────────────────
   > 1060px  Full-size desktop (base styles above)
   ≤ 1060px  Nav squeezes: tighter gaps + smaller logo padding
   ≤  768px  Hamburger menu + stacked layout
   ≤  480px  Small phone tweaks
   ============================================================ */

/* ── Mid breakpoint: squeeze nav links together ───────────── */
@media (max-width: 1060px) {
  .nav-group    { gap: var(--sp-3); }          /* 64px → 24px between links */
  .nav-logomark { padding-inline: var(--sp-1); } /* 32px → 8px beside logo   */
}

/* ── Mobile breakpoint: hamburger + stacked layout ─────────── */
@media (max-width: 768px) {
  :root {
    --nav-h:   60px;
    --gutter:  20px;
  }

  /* Mobile nav: always compact (no tall initial state) */
  .site-nav {
    height: 60px;
    justify-content: space-between;
  }

  #site-header.is-scrolled .site-nav {
    height: 60px;
  }

  /* Logo stays normal size on mobile */
  .nav-logomark svg { height: 44px; }
  #site-header.is-scrolled .nav-logomark svg { height: 44px; }

  /* Restore a bit more padding around logo on mobile */
  .nav-logomark { padding-inline: var(--sp-2); }

  /* Hide desktop nav groups, show hamburger */
  .nav-group  { display: none; }
  .nav-toggle { display: flex; }

  /* Hero: text on top, photo below, red rule directly under photo */
  .hero-inner {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: var(--sp-3);
  }

  .photo-profile { width: 100%; max-width: 320px; }

  /* Stats: single column, centered */
  .stats-grid { grid-template-columns: 1fr; gap: 0; }

  .stat {
    padding: var(--sp-3) 0;
    align-items: center;      /* center number + label horizontally */
  }
  .stat-number,
  .stat-label { text-align: center; }

  .stat:first-child { padding-top: 0; }
  .stat + .stat {
    border-left: none;
    border-top: 1px dashed var(--color-border-dash);
  }

  /* Testimonials */
  .testimonial {
    flex-direction: column;
    gap: var(--sp-2);
    padding-right: 0;          /* No right padding needed — no side border */
  }

  /* Grid layout: photo spans both rows, name + role stack in column 2 */
  .testimonial-meta {
    display: grid;
    grid-template-columns: 100px 1fr;
    grid-template-rows: auto auto;
    column-gap: var(--sp-2);
    width: auto;
  }

  /* Scale photo down for mobile; keep the square bottom-right corner */
  .reviewer-photo-wrap,
  .reviewer-img {
    width: 100px;
    height: 100px;
    border-radius: 14px 14px 0 14px;
    grid-row: 1 / span 2;
    grid-column: 1;
  }

  .reviewer-name {
    grid-row: 1;
    grid-column: 2;
    align-self: end;
    text-align: left;
    font-size: var(--text-base);  /* up from --text-sm */
    padding-bottom: 3px;
  }

  .reviewer-role {
    grid-row: 2;
    grid-column: 2;
    align-self: start;
    text-align: left;
    font-size: var(--text-sm);    /* up from --text-xs */
  }

  /* Company block on mobile: no side bracket at all.
     Keep only the horizontal rule between logo and dates.
     Hide the second rule (after dates) — it connects to nothing. */
  .company-block {
    padding: var(--sp-3) 0;
  }

  .company-block::after { display: none; }


  /* Hide explicit line break in hero tagline — let it wrap */
  .hero-tagline br { display: none; }
}

@media (max-width: 480px) {
  .wordmark-placeholder { font-size: 2.5rem; }
  .stat-number          { font-size: 1.625rem; }
  .hero-tagline         { font-size: var(--text-base); }
  .domains-list         { gap: var(--sp-1) var(--sp-3); }
}
