/* -------------------------------------------------------------------------
   Esther Yekini — services page
   Built to the styling doc, which supersedes section 4a of the PRD.

   Direction: modern SaaS. Saturated colour as surface rather than accent,
   large soft-cornered cards, layered depth, display type at real scale.
   Retained from the previous direction: the field-label grid, the mono
   labels, and the stamp.
   ---------------------------------------------------------------------- */

/* --- Fonts. Self hosted, two weights per face. --------------------------- */

@font-face {
  font-family: 'Satoshi';
  src: url('/fonts/satoshi-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Satoshi';
  src: url('/fonts/satoshi-900.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Public Sans';
  src: url('/fonts/public-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Public Sans';
  src: url('/fonts/public-sans-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens -------------------------------------------------------------- */

:root {
  /* Ink */
  --ink: #150F2E;
  --ink-soft: #5B5478;

  /* Violet, the surface colour */
  --violet-900: #2A1A5E;
  --violet-600: #4B2FD6;
  --violet-500: #6D4AFF;
  --violet-100: #E9E4FF;

  /* Signal, used once per case study, on the stamp */
  --signal: #FF7A59;
  --signal-ink: #3D1005;

  /* Page */
  --paper: #F6F4FB;
  --surface: #FFFFFF;
  --hairline: #E4E0F0;

  /* Shape */
  --radius-card: 24px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  /* Depth */
  --shadow-card: 0 20px 50px -20px rgba(21, 15, 46, 0.32);
  --shadow-hero: 0 30px 70px -25px rgba(42, 26, 94, 0.55);

  /* Layout */
  --page-max: 84rem;
  --measure: 34rem;
  --bleed: 0.75rem;
  --section: clamp(4rem, 9vw, 7rem);
  --label-width: 8.5rem;
  --pad: clamp(1rem, 4vw, 2.5rem);
  --gutter: 2rem;

  /* Type. The display fallback is sans, never serif. */
  --display: 'Satoshi', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* --- Reset, minimal ------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: var(--violet-500);
}

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

/* --- Focus. 2px violet at 3px offset, on everything interactive. --------- */

:focus-visible {
  outline: 2px solid var(--violet-500);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.hero :focus-visible {
  outline-color: #fff;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-size: 0.9375rem;
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- The field grid. Retained, and still the organising logic. ----------- */

.field {
  display: grid;
  grid-template-columns: var(--label-width) minmax(0, 1fr);
  column-gap: var(--gutter);
  align-items: baseline;
  padding: 1.15rem 0;
}

.field--rule,
.fields .field+.field {
  border-top: 1px solid var(--hairline);
}

.field__label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
  padding-top: 0.35em;
}

.field__value,
.field__body {
  margin: 0;
  min-width: 0;
}

/* Surfaces get wide. Text does not. */
.field__body {
  max-width: var(--measure);
}

/* --- Page container. Wide page, narrow measure. -------------------------- */

.block,
.masthead__inner,
.block__inner,
.footer__inner {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Vertical rhythm between major blocks. */
main>*+* {
  margin-top: var(--section);
}

/* --- Masthead. Transparent, no border, no uppercase. --------------------- */

.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.25rem;
  justify-content: space-between;
  align-items: baseline;
  padding-block: 1.5rem;
}

.masthead__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  margin: 0;
}

.masthead__role {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin: 0;
}

/* --- Structural device. Dotted rule with a plus at each end. ------------- */

/* Sized to the content column rather than the container, so the dashed line
   starts and ends exactly where the text does. */
.rule {
  border: 0;
  border-top: 1px dashed var(--hairline);
  position: relative;
  width: min(calc(var(--page-max) - 2 * var(--pad)), calc(100% - 2 * var(--pad)));
  margin: var(--section) auto;
}

.rule::before,
.rule::after {
  content: "+";
  position: absolute;
  top: -0.7em;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1;
}

.rule::before {
  left: -0.3em;
}

.rule::after {
  right: -0.3em;
}

/* --- Hero. Full-bleed inset card, the one saturated surface. ------------- */

.hero {
  max-width: none;
  padding: var(--bleed);
  margin-top: 0;
}

.hero .card {
  background: linear-gradient(135deg, var(--violet-900) 0%, var(--violet-600) 100%);
  color: #fff;
  border: 0;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-hero);
  min-height: min(86vh, 780px);
  display: grid;
  align-content: center;
  gap: 3rem;
  /* Vertical padding is the tighter of the doc's two figures for this card, so
     the whole hero, button included, clears the fold on a 900px window. */
  padding: clamp(1.75rem, 3.5vw, 3rem) clamp(2rem, 6vw, 5rem);
}

.hero .field {
  padding-block: 0.8rem;
}

@media (min-width: 60rem) {
  .hero .card {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
  }
}

/* The name needs more room than --measure leaves once the label column is
   taken out, so the hero's own field block is capped a little wider. */
.hero .fields,
.hero__foot {
  max-width: 42rem;
}

.hero .field__label {
  color: var(--violet-100);
}

.hero .fields .field+.field,
.hero__foot {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

/* Name first and largest. */
.hero .fields .field:first-child .field__value {
  font-family: var(--display);
  font-weight: 900;
  /* Doc says max 6.5rem. Capped at 5.75rem because the name wraps to two lines
     in the hero's left column, and 6.5rem pushes the button past the fold. */
  font-size: clamp(3.5rem, 8vw, 5.75rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

/* Hero secondary values. */
.hero .fields .field+.field .field__value {
  font-family: var(--body);
  font-weight: 600;
  font-size: 1.25rem;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero .lede {
  font-size: 1.0625rem;
  color: var(--violet-100);
}

/* --- The hero artefact. The only illustration on the page. --------------- */
/*     A payment request in its approved state. All data is invented.        */

.artefact {
  display: none;
}

@media (min-width: 60rem) {
  .artefact {
    display: block;
    justify-self: center;
    width: min(100%, 25rem);
    background: var(--surface);
    color: var(--ink);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    padding: 1.5rem 1.5rem 1.25rem;
    transform: rotate(2deg);
  }
}

.artefact__ref {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.artefact__payee {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.15rem;
}

.artefact__amount {
  font-family: var(--display);
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: -0.03em;
  margin: 0 0 1.15rem;
}

.artefact__trail {
  list-style: none;
  margin: 0;
  padding: 1rem 0 0;
  border-top: 1px dashed var(--hairline);
  font-size: 0.875rem;
}

.artefact__trail li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0;
}

.artefact__trail time {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.artefact__foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

/* --- Case study cards ---------------------------------------------------- */

.card {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: clamp(1.75rem, 4vw, 2.5rem);
}

.card--case .field__label {
  color: var(--violet-600);
}

.card--case h2 {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  margin-bottom: 1.15rem;
}

/* The body of a case study is the wide surface: text left, shots right. */
.card--case .field__body {
  max-width: none;
}

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

@media (min-width: 56rem) {
  .card--case .field__body {
    display: grid;
    grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
  }
}

.list {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
}

.list li {
  margin-bottom: 0.4rem;
}

.list li::marker {
  color: var(--violet-600);
}

/* Screenshot slots. Replace the .shot__slot divs with <img>. */

.shots {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 56rem) {
  .shots {
    margin-top: 0;
  }
}

.shot {
  margin: 0;
}

.shot__slot {
  aspect-ratio: 4 / 3;
  background: var(--paper);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.shot img {
  border-radius: var(--radius-sm);
}

.shot figcaption {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

/* --- The stamp. Signal colour, once per case study, nowhere else. -------- */

.stamp {
  display: block;
  width: fit-content;
  margin: 2rem 0 0 auto;
  background: var(--signal);
  color: var(--signal-ink);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.35rem;
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-4deg);
}

.artefact .stamp {
  margin: 0;
  font-size: 0.75rem;
  padding: 0.4rem 0.9rem;
}

/* --- How I work ---------------------------------------------------------- */

.mono-line {
  font-family: var(--mono);
  font-size: 0.9375rem;
}

.hint {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* --- Work strip. Bleeds past the container on both sides. ---------------- */

.block--flush {
  max-width: none;
  padding-inline: 0;
}

.strip {
  list-style: none;
  margin: 0;
  /* Aligns the first card with the content column, then lets the rest run
     out to the viewport edge, so a partial card shows at each side. */
  padding: 0.5rem max(var(--pad), calc((100% - var(--page-max)) / 2 + var(--pad))) 1.5rem;
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-left: max(var(--pad), calc((100% - var(--page-max)) / 2 + var(--pad)));
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}

.strip.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.strip__card {
  flex: 0 0 auto;
  width: min(19rem, 74vw);
  scroll-snap-align: start;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
}

.strip__card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.strip__card p {
  margin-bottom: 0.6rem;
  font-size: 0.9375rem;
}

.strip__stack {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-bottom: 0 !important;
}

/* --- Contact ------------------------------------------------------------- */

.form {
  margin-top: 0.25rem;
}

@media (min-width: 40rem) {
  .form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2rem;
  }

  .form>.field {
    grid-column: 1 / -1;
  }

  .form>.field--half {
    grid-column: auto;
  }

  /* Side by side fields stack their own label above the value, since the
     two column label grid does not fit in half the width. */
  .form>.field--half {
    grid-template-columns: 1fr;
    row-gap: 0.4rem;
  }

  .form>.field--half .field__label {
    padding-top: 0;
  }
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  appearance: none;
}

textarea {
  resize: vertical;
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: right 1.05rem center, right 0.7rem center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--violet-500);
}

/* --- Button. One primary, and the form submit matches it. ---------------- */

.button {
  display: inline-block;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #fff;
  background: var(--violet-500);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.9rem 1.85rem;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--violet-600);
}

/* --- Footer. Plain text on the page background. -------------------------- */

.footer__inner {
  padding-block: 2rem 3rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* --- Motion. The hero form fills itself in, once, on load. --------------- */
/*     Opacity and transform only. Nothing else on the page animates.        */

@keyframes fill-label {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fill-value {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fill-stamp {
  from {
    opacity: 0;
    transform: rotate(-4deg) scale(1.06);
  }

  to {
    opacity: 1;
    transform: rotate(-4deg) scale(1);
  }
}

.hero .field__label,
.hero__foot .field__body,
.artefact {
  animation: fill-label 200ms ease-out both;
}

.hero [data-fill] {
  animation: fill-value 260ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.hero [data-fill="1"] {
  animation-delay: 240ms;
}

.hero [data-fill="2"] {
  animation-delay: 330ms;
}

.hero [data-fill="3"] {
  animation-delay: 420ms;
}

.hero [data-fill="4"] {
  animation-delay: 510ms;
}

[data-fill="stamp"] {
  animation: fill-stamp 260ms cubic-bezier(0.22, 0.61, 0.36, 1) 880ms both;
}

@media (prefers-reduced-motion: reduce) {

  .hero .field__label,
  .hero__foot .field__body,
  .artefact,
  .hero [data-fill],
  [data-fill="stamp"] {
    animation: none;
  }

  * {
    scroll-behavior: auto !important;
  }
}

/* --- Responsive. The field grid stacks below 600px. ---------------------- */

@media (max-width: 600px) {
  body {
    font-size: 1rem;
  }

  .field {
    grid-template-columns: 1fr;
    row-gap: 0.35rem;
    padding: 1rem 0;
  }

  .field__label {
    padding-top: 0;
  }

  .hero .card {
    min-height: 0;
    gap: 2rem;
  }

  .stamp {
    margin-top: 1.5rem;
  }
}
