/* ==========================================================================
   CognivaSoft — Page-specific styles
   Scoped by the body class so nothing leaks between pages.
   ========================================================================== */

/* -- Home: hero -------------------------------------------------------------
   The hero is the page's single authored moment: three elements rise and
   sharpen once, on load, then the page is still. Everything is CSS animation
   (off the main thread), gated behind prefers-reduced-motion, and the
   un-animated default is the finished, visible state. */

.hero {
  position: relative;
  padding-top: clamp(2.5rem, 1.5rem + 4vw, 5.5rem);   /* cap ≈ 6rem */
  padding-bottom: clamp(2rem, 1rem + 3vw, 3.5rem);
}

.hero__top {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: var(--gutter) clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: end;
}

.hero__title {
  font-size: var(--fs-mega);
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 13ch;
}

.hero__title em { color: var(--clay); }

/* Hand-drawn underline beneath the emphasised word */
.hero__title .mark {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  padding-bottom: 0.06em;   /* descender + stroke clearance */
}

.hero__title .mark svg {
  position: absolute;
  left: 0;
  bottom: -0.04em;
  width: 100%;
  height: 0.2em;
  color: var(--ochre);
  overflow: visible;
}

.hero__title .mark svg path {
  stroke-dasharray: 340;
  stroke-dashoffset: 0;
}

.hero__aside {
  padding-bottom: 0.5rem;
  border-left: 1px solid var(--clay);
  padding-left: var(--space-m);
}

.hero__aside p { color: var(--ink-soft); font-size: 1.0625rem; line-height: 1.6; max-width: 42ch; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-s);
  margin-top: var(--space-xl);
}

.hero__trust {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin-left: var(--space-2xs);
}

.hero__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--pine-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pine-soft) 22%, transparent);
  animation: pulse 2.8s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--pine-soft) 22%, transparent); }
  50%      { box-shadow: 0 0 0 8px color-mix(in srgb, var(--pine-soft) 3%, transparent); }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes hero-rise {
    from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
    to   { opacity: 1; transform: none; filter: blur(0); }
  }

  @keyframes hero-draw {
    from { stroke-dashoffset: 340; }
    to   { stroke-dashoffset: 0; }
  }

  .hero__title   { animation: hero-rise 700ms var(--ease-out) both; }
  .hero__aside   { animation: hero-rise 700ms var(--ease-out) 110ms both; }
  .hero__actions { animation: hero-rise 700ms var(--ease-out) 200ms both; }

  .hero__title .mark svg path {
    stroke-dashoffset: 340;
    animation: hero-draw 900ms var(--ease-out) 620ms forwards;
  }
}

@media (max-width: 900px) {
  .hero__top { grid-template-columns: 1fr; gap: var(--space-l); }
  .hero__title { max-width: 100%; }
  .hero__aside { padding-bottom: 0; }
  .hero__actions { margin-top: var(--space-l); }
  .hero__trust { margin-left: 0; width: 100%; }
}

/* -- Home: split sections --------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 1rem + 5vw, 5.5rem);
  align-items: start;
}

.split--reverse > *:first-child { order: 2; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: var(--space-l); }
  .split--reverse > *:first-child { order: 0; }
}

.sticky-col { position: sticky; top: calc(var(--header-h) + var(--space-l)); }

@media (max-width: 900px) { .sticky-col { position: static; } }

/* Checklist */
.checklist li {
  position: relative;
  padding-left: 2.2rem;
  line-height: 1.6;
}

.checklist li + li { margin-top: var(--space-m); }

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--pine-wash);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 7.3l2.7 2.7L11 4.4' stroke='%232f6153' stroke-width='1.9' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.9rem;
}

.checklist strong { display: block; font-size: 1.05rem; margin-bottom: 0.15rem; }
.checklist span { color: var(--text-muted); font-size: 0.9688rem; display: block; max-width: 58ch; }

/* -- Model grid -------------------------------------------------- */

.model-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: stretch;
}

@media (max-width: 980px) { .model-grid { grid-template-columns: 1fr; } }

/* -- Services page ----------------------------------------------------------- */

.service-block {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 1rem + 4vw, 4.5rem);
  padding-block: var(--space-xl);
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-h) + 4.5rem);
}

.service-block__aside { position: sticky; top: calc(var(--header-h) + 4.5rem); }

@media (max-width: 900px) { .service-block__aside { position: static; } }

.service-block__title { max-width: 14ch; }

.service-block__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: var(--space-m);
}

.service-block__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-s) var(--space-m);
  margin-top: var(--space-l);
  padding-top: var(--space-m);
  border-top: 1px solid var(--border);
}

.service-block__list li {
  position: relative;
  padding-left: 1.05rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.service-block__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--clay);
}

@media (max-width: 900px) {
  .service-block { grid-template-columns: 1fr; gap: var(--space-m); }
  .service-block__list { grid-template-columns: 1fr; }
}

/* Sticky in-page nav */
.jump-nav {
  position: sticky;
  top: var(--header-h);
  z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--bg) 93%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.jump-nav__track {
  display: flex;
  gap: var(--space-m);
  overflow-x: auto;
  padding-block: var(--space-s);
  scrollbar-width: none;
}

.jump-nav__track::-webkit-scrollbar { display: none; }

.jump-nav a {
  font-size: var(--fs-small);
  font-weight: 520;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.jump-nav a:hover { color: var(--accent-text); border-bottom-color: var(--clay); }

/* -- Approach page ------------------------------------------------------------ */

.mark-panel {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: var(--grad-pine);
  background-color: var(--pine);
  border-radius: var(--radius-l);
  padding: var(--space-xl);
  perspective: 700px;
  overflow: hidden;
}

/* Slow drift so the mark reads as an object in space, not a flat sticker.
   transform only, so it stays on the compositor. */
@media (prefers-reduced-motion: no-preference) {
  .mark-panel svg { animation: mark-drift 14s var(--ease-in-out) infinite; }

  @keyframes mark-drift {
    0%, 100% { transform: rotateY(-9deg) rotateX(4deg) translateZ(0); }
    50%      { transform: rotateY(9deg) rotateX(-4deg) translateZ(18px); }
  }
}

.mark-panel svg {
  width: min(62%, 15rem);
  height: auto;
  color: var(--on-dark);
}

.mark-panel .dot { fill: var(--ochre); }

/* Human / AI split — two roles, stated plainly side by side. */
.duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xl) clamp(2rem, 1rem + 4vw, 4rem);
}

.duo__col { padding-top: var(--space-m); border-top: 1px solid var(--on-dark-line); }

.duo__label {
  font-size: var(--fs-micro);
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ochre);
  margin-bottom: var(--space-2xs);
}

.duo__col h3 { margin-bottom: var(--space-s); max-width: 18ch; }

.duo__list li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--on-dark-soft);
  font-size: 0.9688rem;
  line-height: 1.6;
}

.duo__list li + li { margin-top: var(--space-s); }

.duo__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ochre);
}

@media (max-width: 780px) { .duo { grid-template-columns: 1fr; gap: var(--space-l); } }

/* -- About page --------------------------------------------------------------- */

.values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xl) clamp(2rem, 1rem + 4vw, 4rem);
}

.value {
  padding-top: var(--space-m);
  border-top: 1px solid var(--ink);
}

.value h3 { margin-bottom: var(--space-2xs); max-width: 20ch; }
.value p { color: var(--text-muted); font-size: 0.9688rem; line-height: 1.65; }

@media (max-width: 780px) { .values { grid-template-columns: 1fr; gap: var(--space-l); } }

.team {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gutter);
}

.person__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-l);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--pine-wash);
  margin-bottom: var(--space-s);
}

.person__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.person:hover .person__photo img { transform: scale(1.03); }

/* Soft pine scrim at the foot of the frame, so a photograph reads as part of
   the palette rather than a snapshot pasted onto it. */
.person__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 58%,
    color-mix(in srgb, var(--pine-deep) 42%, transparent) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .person:hover .person__photo img { transform: none; }
}
}

.person__name { font-weight: 620; font-size: 1.05rem; }
.person__role {
  font-size: var(--fs-micro);
  font-weight: 560;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

@media (max-width: 900px) { .team { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* -- Contact page -------------------------------------------------------------- */

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2rem, 1rem + 5vw, 5rem);
  align-items: start;
}

@media (max-width: 980px) { .contact-layout { grid-template-columns: 1fr; } }

.form-card {
  position: relative;
  padding: clamp(1.5rem, 1rem + 2vw, 2.75rem);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-m);
}

.form-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  background: linear-gradient(90deg, transparent, var(--glass-edge) 22%,
                                     var(--glass-edge) 78%, transparent);
  pointer-events: none;
}

.info-block + .info-block { margin-top: var(--space-l); padding-top: var(--space-l); border-top: 1px solid var(--border); }

.info-block__label {
  font-size: var(--fs-micro);
  font-weight: 620;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: var(--space-2xs);
}

.info-block a { color: var(--ink); text-decoration: none; font-size: 1.05rem; font-weight: 560; }
.info-block a:hover { color: var(--accent-text); text-decoration: underline; }
.info-block p { color: var(--text-muted); font-size: 0.9375rem; line-height: 1.6; }

.next-steps { counter-reset: ns; }

.next-steps li {
  position: relative;
  padding-left: 2.4rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.next-steps li + li { margin-top: var(--space-m); }

.next-steps li::before {
  counter-increment: ns;
  content: counter(ns);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-variant-numeric: tabular-nums;
  color: var(--clay);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
}

.next-steps strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 0.1rem; }
