/* ============================================================
   Connett Family Counseling — Case Study
   Design system: "Trust before information"
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Nunito:wght@400;500;600;700&display=swap');

:root {
  --mist: #F0F6FA;
  --harbor: #0F4C66;
  --current: #2F7A9E;
  --seafoam: #A9D2C8;
  --seafoam-soft: #E4F1ED;
  --linen: #FFFFFF;
  --ink-soft: #3D4A52;
  --ink-quiet: #6B7B83;
  --line: #D7E5EC;

  --serif: 'Cormorant', Georgia, serif;
  --sans: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;

  --measure: 680px;
  --measure-wide: 920px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
  --space-7: 9rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--harbor);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--current);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* ---------- Trust progress indicator ---------- */

.trust-track {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 100;
}

.trust-track::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--line);
  opacity: 0.5;
}

.trust-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--seafoam), var(--current));
  transition: width 0.1s linear;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  background: var(--mist);
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}

.site-header .logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-header .logo img {
  height: 28px;
  width: auto;
  display: block;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.site-header nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 2px;
  /* Minimum tap target */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-header nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 1px;
  background: var(--current);
  transition: width 0.25s ease;
}

.site-header nav a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--harbor);
  cursor: pointer;
  border-radius: 8px;
}

.nav-toggle:hover { background: var(--seafoam-soft); }

.nav-links-mobile {
  display: none;
  list-style: none;
  flex-direction: column;
  background: var(--linen);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 49;
  margin: 0;
  padding: 0;
}

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

.nav-links-mobile li { border-top: 1px solid var(--line); }
.nav-links-mobile li:first-child { border-top: none; }

.nav-links-mobile a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--space-3);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
}

/* ---------- Hero ---------- */

.hero {
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6) var(--space-3) var(--space-5);
  position: relative;
}

.hero-eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--current);
  margin-bottom: var(--space-3);
  opacity: 0;
  animation: rise 0.9s ease forwards;
  animation-delay: 0.1s;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.1;
  color: var(--harbor);
  max-width: 14ch;
  margin: 0 0 var(--space-4);
  opacity: 0;
  animation: rise 1s ease forwards;
  animation-delay: 0.25s;
}

.hero p.lede {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--ink-quiet);
  max-width: 38ch;
  margin: 0 auto var(--space-5);
  opacity: 0;
  animation: rise 1s ease forwards;
  animation-delay: 0.45s;
}

.hero .scroll-cue {
  opacity: 0;
  animation: rise 1s ease forwards, float 2.6s ease-in-out infinite;
  animation-delay: 0.7s, 1.6s;
  color: var(--current);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ---------- Metadata strip ---------- */

.meta-strip {
  max-width: var(--measure-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) var(--space-6);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.meta-item .label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--current);
  margin-bottom: 0.35rem;
  display: block;
}

.meta-item .value {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------- Sections ---------- */

.section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--space-6) var(--space-3);
  scroll-margin-top: 90px;
}

.section.wide { max-width: var(--measure-wide); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.section-num {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--current);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.section h2 {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.005em;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  color: var(--harbor);
  margin: 0;
}

.section p {
  margin: 0 0 var(--space-3);
  color: var(--ink-soft);
}

.section p.hook-line {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  font-style: italic;
  line-height: 1.5;
  color: var(--harbor);
  text-align: center;
  max-width: 32ch;
  margin: 0 auto;
}

.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Overview list ---------- */

.overview-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3) var(--space-4);
}

.overview-grid li {
  padding: var(--space-2) 0;
  border-top: 1px solid var(--line);
}

.overview-grid .label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--current);
  display: block;
  margin-bottom: 0.3rem;
}

/* ---------- Honest framing callouts ---------- */

.note {
  background: var(--linen);
  border-left: 3px solid var(--seafoam);
  border-radius: 4px;
  padding: var(--space-3) var(--space-4);
  margin: var(--space-3) 0 var(--space-4);
}

.note .note-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--current);
  display: block;
  margin-bottom: 0.4rem;
}

.note p { margin: 0; color: var(--ink-soft); }

/* ---------- Tension layout (Define & Ideate) ---------- */

.tension {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-3);
  align-items: stretch;
  margin: var(--space-4) 0;
}

.tension-card {
  background: var(--linen);
  border-radius: 10px;
  padding: var(--space-4);
  border: 1px solid var(--line);
}

.tension-card .who {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
  display: block;
}

.tension-card.instinct .who { color: var(--ink-quiet); }
.tension-card.call .who { color: var(--current); }
.tension-card.call { border-color: var(--seafoam); box-shadow: 0 8px 24px -12px rgba(15, 76, 102, 0.18); }

.tension-card p { margin: 0; font-size: 0.95rem; }

.tension-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--seafoam);
  font-size: 1rem;
}

.resolution {
  text-align: center;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--harbor);
  font-style: italic;
  margin-top: var(--space-3);
}

/* ---------- Screenshot placeholders ---------- */

.shot-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.shot-row.single { grid-template-columns: 1fr; }

.shot-frame {
  aspect-ratio: 16 / 11;
  border: 1.5px dashed var(--current);
  border-radius: 10px;
  background: var(--seafoam-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--current);
}

.shot-frame .shot-icon {
  width: 28px;
  height: 28px;
  opacity: 0.7;
}

.shot-frame span.shot-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  padding: 0 var(--space-2);
}

/* Real images replacing placeholders — solid border, image fills frame */
.shot-frame.has-image {
  border-style: solid;
  border-color: var(--line);
  padding: 0;
  overflow: hidden;
  display: block;
}

.shot-frame.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
  display: block;
  cursor: zoom-in;
  transition: filter 0.2s ease, transform 0.3s ease;
}

.shot-frame.has-image img:hover,
.shot-frame.has-image img:focus-visible {
  filter: brightness(1.04);
  transform: scale(1.01);
}

.shot-frame.has-image img:focus-visible {
  outline: 2px solid var(--current);
  outline-offset: -2px;
}

/* Full-page homepage capture is naturally near-square and content-dense
   top to bottom — let it run its own ratio instead of forcing a 16:11
   crop, the same approach used for full-page shots in the other case
   studies. */
.shot-frame.has-image.tall-shot {
  aspect-ratio: auto;
  max-width: 560px;
  margin: 0 auto;
}

.shot-frame.has-image.tall-shot img {
  height: auto;
  object-fit: contain;
  background: var(--linen);
}

/* ---------- Image lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(15, 30, 38, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: min(92vw, 1400px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 64px -16px rgba(15, 30, 38, 0.5);
  background: var(--linen);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.lightbox.is-open .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: fixed;
  top: var(--space-3);
  right: var(--space-3);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--linen);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--harbor);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  border-color: var(--current);
  background: var(--seafoam-soft);
}

@media (max-width: 480px) {
  .lightbox { padding: var(--space-2); }
  .lightbox-close { top: var(--space-2); right: var(--space-2); width: 40px; height: 40px; }
}

/* ---------- Subsection blocks (Design Decisions) ---------- */

.subsection {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
}

.subsection:first-of-type { border-top: none; padding-top: 0; }

.subsection h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--harbor);
  margin: 0 0 var(--space-2);
}

/* ---------- Reflection card ---------- */

.reflection-card {
  background: var(--seafoam-soft);
  border-radius: 14px;
  padding: var(--space-5) var(--space-4);
}

.reflection-card .note { background: var(--linen); border-left-color: var(--current); }

/* ---------- Footer / project nav ---------- */

.project-nav {
  border-top: 1px solid var(--line);
  padding: var(--space-6) var(--space-5);
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  max-width: var(--measure-wide);
  margin: 0 auto;
}

.project-nav a {
  flex: 1;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--linen);
  transition: border-color 0.2s ease, transform 0.2s ease;
  /* Minimum tap target */
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-nav a:hover {
  border-color: var(--current);
  transform: translateY(-2px);
}

.project-nav .direction {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--current);
  margin-bottom: 0.3rem;
}

.project-nav .title {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--harbor);
  font-size: 1.02rem;
}

.project-nav a.next { text-align: right; }

.site-footer {
  text-align: center;
  padding: var(--space-4) var(--space-3) var(--space-5);
  font-size: 0.85rem;
  color: var(--ink-quiet);
}

/* ============================================================
   RESPONSIVE — 760px and below
   ============================================================ */

@media (max-width: 760px) {

  /* Header */
  .site-header {
    padding: 0 var(--space-3);
    height: 56px;
  }

  .site-header .logo img {
    height: 24px;
  }

  .site-header nav { display: none; }

  .nav-toggle { display: flex; order: -1; }

  .site-header .logo { order: 1; }

  /* Pinned mobile dropdown — stays fixed directly under the sticky
     header as the page scrolls, instead of scrolling away with content. */
  .nav-links-mobile.is-open {
    position: fixed;
    top: var(--mobile-nav-offset, 56px);
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--mobile-nav-offset, 56px));
    overflow-y: auto;
    z-index: 49;
  }

  /* Hero */
  .hero {
    min-height: 80vh;
    padding: var(--space-5) var(--space-3) var(--space-4);
    align-items: flex-start;
    text-align: left;
  }

  .hero h1 {
    font-size: clamp(2rem, 9vw, 2.8rem);
    max-width: none;
  }

  .hero p.lede {
    font-size: 1rem;
    max-width: none;
    text-align: left;
    margin-bottom: var(--space-4);
  }

  .hero-eyebrow {
    font-size: 0.72rem;
  }

  /* Meta strip */
  .meta-strip {
    grid-template-columns: repeat(2, 1fr);
    padding: var(--space-3) var(--space-3) var(--space-4);
    gap: var(--space-2) var(--space-3);
  }

  /* Sections */
  .section {
    padding: var(--space-4) var(--space-3);
  }

  .section-head {
    margin-bottom: var(--space-3);
    gap: var(--space-1);
  }

  /* Overview grid */
  .overview-grid {
    grid-template-columns: 1fr;
  }

  /* Note callouts — reduce side padding on small screens */
  .note {
    padding: var(--space-2) var(--space-3);
  }

  /* Tension layout — fully stack */
  .tension {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .tension-card {
    padding: var(--space-3);
    border-radius: 0;
  }

  .tension-card:first-child {
    border-radius: 10px 10px 0 0;
  }

  .tension-card:last-child {
    border-radius: 0 0 10px 10px;
  }

  .tension-divider {
    padding: var(--space-1) 0;
    background: var(--linen);
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    font-size: 0.85rem;
  }

  /* Screenshot placeholders — stack */
  .shot-row {
    grid-template-columns: 1fr;
  }

  .shot-frame:not(.has-image) {
    aspect-ratio: 4 / 3;
  }

  /* Reflection card */
  .reflection-card {
    padding: var(--space-3) var(--space-3);
    border-radius: 10px;
  }

  /* Project nav */
  .project-nav {
    flex-direction: column;
    padding: var(--space-4) var(--space-3);
    gap: var(--space-2);
  }

  .project-nav a {
    flex: none;
    width: 100%;
  }

  .project-nav a.next {
    text-align: left;
  }
}

/* ============================================================
   RESPONSIVE — 480px and below (small phones)
   ============================================================ */

@media (max-width: 480px) {

  :root {
    --space-4: 2rem;
    --space-5: 3rem;
    --space-6: 4rem;
  }

  body {
    font-size: 16px;
  }

  .hero {
    min-height: 75vh;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 10vw, 2.4rem);
    line-height: 1.15;
  }

  .meta-strip {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

  .meta-item .value {
    font-size: 0.88rem;
    word-break: break-word;
  }

  .section h2 {
    font-size: clamp(1.35rem, 6vw, 1.8rem);
  }

  .hook-line {
    font-size: clamp(1.05rem, 4.5vw, 1.25rem) !important;
  }

  .subsection h3 {
    font-size: 1.1rem;
  }

  .resolution {
    font-size: 1rem;
  }

  .tension-card {
    padding: var(--space-2) var(--space-3);
  }

  .note {
    padding: var(--space-2);
  }
}
