/* =========================================================
   SECTIONS — each part of the page, in page order
   Mobile first: the plain rules are for phones; the
   @media blocks add the wider layouts on top.
   ========================================================= */


/* =================== HERO =================== */

.hero {
  padding-block: var(--space-5) var(--section-space);
  row-gap: var(--space-4);
  align-content: end;
}

/* Everything spans the full width on phones */
.hero > * { grid-column: 1 / -1; }

/* Initials mark: "SA." in a thin square frame, cobalt full stop */
.hero__mark {
  justify-self: end;
  display: flex;                   /* keeps "SA" and "." on one line, centred */
  align-items: center;
  justify-content: center;
  width: clamp(4rem, 3rem + 5vw, 7.5rem);
  aspect-ratio: 1;                 /* always a perfect square */
  margin-bottom: var(--space-2);
  border: 1px solid var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.75rem);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}
.hero__mark-dot { color: var(--cobalt); }

.hero__title {
  max-width: 14ch;   /* keeps the headline breaking into 2–3 strong lines */
}

.hero__sub {
  font-size: var(--text-lg);
  line-height: 1.45;
  max-width: 40ch;
}
.hero__sub + .hero__sub { margin-top: var(--space-2); }

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Laptop and up: hero fills the first screen; intro left, buttons right */
@media (min-width: 64em) {
  .hero {
    /* fill the first screen, but never taller than ~900px on big monitors */
    min-height: min(calc(100svh - var(--nav-height)), 56rem);
    padding-block-start: var(--space-6);
    /* 3 rows: mark at the top · stretchy middle · intro + buttons */
    grid-template-rows: auto 1fr auto;
    align-content: stretch;
  }

  .hero__mark {
    grid-column: 10 / -1;
    grid-row: 1;
    align-self: start;
    margin-bottom: 0;
  }

  .hero__title {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: end;   /* headline sits at the bottom of the middle row */
  }

  .hero__intro {
    grid-column: 1 / span 7;
    grid-row: 3;
    margin-top: var(--space-4);
  }

  .hero__links {
    grid-column: 9 / -1;
    grid-row: 3;
    justify-content: flex-end;
    align-self: end;
  }
}


/* =================== THE STORY =================== */

.story {
  row-gap: var(--space-5);
}

.story__aside,
.story__chapters { grid-column: 1 / -1; }

/* Same size as the pillar labels ("01 / THE MAIN PROJECT") */
.story__label {
  color: var(--ink);
  font-size: clamp(0.9375rem, 0.875rem + 0.2vw, 1.0625rem);   /* 15–17px */
  letter-spacing: 0.06em;
}

.chapter {
  padding-block: var(--space-5);
  border-top: var(--border);
}
.chapter:first-child {
  border-top: 0;
  padding-top: 0;
}
.chapter:last-child { padding-bottom: 0; }

.chapter__title {
  font-size: var(--text-xl);
  line-height: 1.1;
  margin-bottom: var(--space-3);
}

.chapter p {
  font-size: var(--text-base);
  line-height: 1.65;
}

.chapter p + p { margin-top: var(--space-2); }

/* "What I aspire to inspire": short stacked lines */
.chapter--lines p + p { margin-top: var(--space-1); }

/* Tablet: label left, chapters right */
@media (min-width: 40em) {
  .story__aside    { grid-column: 1 / span 2; }
  .story__chapters { grid-column: 3 / -1; }
}

/* Laptop: narrow label column that stays in view while chapters scroll */
@media (min-width: 64em) {
  .story__aside    { grid-column: 1 / span 3; }
  .story__chapters { grid-column: 4 / span 7; }   /* same left edge as the pillar text */

  .story__label {
    position: sticky;
    top: calc(var(--nav-height) + var(--space-4));
  }
}


/* =================== THE FIVE PILLARS (01–05) ===================
   All five share one layout, like rows in a table of contents. */

.pillars { padding-block: var(--section-space); }

.pillar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--column-gap);
  row-gap: var(--space-2);
  padding-block: var(--space-5);
  border-top: var(--border);
}
.pillar:last-child { border-bottom: var(--border); }
.pillar > * { grid-column: 1 / -1; }

/* Label: "01 / THE MAIN PROJECT" */
.pillar__label {
  font-family: var(--font-mono);
  font-size: clamp(0.9375rem, 0.875rem + 0.2vw, 1.0625rem);   /* 15–17px */
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
}
.pillar__label .label__num { color: var(--cobalt); }

/* Headline */
.pillar h2 {
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3.5rem);               /* 32–56px */
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  max-width: 20ch;
}

/* Subtitle: always visible */
.pillar__sub {
  font-size: var(--text-lg);                                     /* 18–20px */
  line-height: 1.45;
  max-width: 40ch;
  margin-top: var(--space-1);
}

/* ---------- "More +" toggle ----------
   <details> opens and closes on click by itself; <summary> is the clickable part. */
.pillar__more summary {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding-block: var(--space-1);
  cursor: pointer;
  list-style: none;                       /* hide the default ▸ triangle */
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--cobalt);
}
.pillar__more summary::-webkit-details-marker { display: none; }
.pillar__more summary:hover .more__word {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* Show "More" when closed, "Less" when open */
.more__less { display: none; }
.pillar__more[open] .more__more { display: none; }
.pillar__more[open] .more__less { display: inline; }

/* Small + drawn with two lines; rotates into × when open */
.more__icon {
  position: relative;
  width: 0.7em;
  height: 0.7em;
  transition: transform var(--duration) var(--ease);
}
.more__icon::before,
.more__icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.more__icon::before { left: 50%; top: 0; width: 1.5px; height: 100%; transform: translateX(-50%); }
.more__icon::after  { top: 50%; left: 0; height: 1.5px; width: 100%; transform: translateY(-50%); }
.pillar__more[open] .more__icon { transform: rotate(45deg); }

/* Revealed description */
.pillar__text {
  max-width: var(--measure);
  padding-top: var(--space-2);
  padding-bottom: var(--space-1);
}
.pillar__text p {
  font-size: var(--text-base);                                   /* 16–17px */
  line-height: 1.65;
}
.pillar__text p + p { margin-top: var(--space-2); }

/* Smooth opening in browsers that support it (Chrome); others simply open instantly */
:root { interpolate-size: allow-keywords; }
.pillar__more::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 300ms var(--ease), content-visibility 300ms allow-discrete;
}
.pillar__more[open]::details-content { block-size: auto; }

/* Link */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.15em;
}
.link-arrow span { transition: transform var(--duration) var(--ease); }
.link-arrow:hover span { transform: translateX(3px); }

/* Platform icon in front of the link text (GitHub, Substack, Instagram) */
.link-icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;   /* same cobalt as the link */
}

/* "Coming soon" in place of a link */
.pillar__soon {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Laptop: label left · headline, subtitle, More in the middle · link right */
@media (min-width: 64em) {
  .pillar { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .pillar .pillar__label { grid-column: 1 / span 3; grid-row: 1; padding-top: 0.5em; }
  .pillar h2             { grid-column: 4 / -1;     grid-row: 1; }
  .pillar .pillar__sub   { grid-column: 4 / span 6; grid-row: 2; }
  .pillar .pillar__more  { grid-column: 4 / span 6; grid-row: 3; }
  .pillar .pillar__end   { grid-column: 4 / span 6; grid-row: 4; }
}


/* =================== CLOSING ===================
   Mirrors the hero, so the page opens and closes in the same frame:
   huge headline · text left (cols 1–7) · button bottom-right. */

.closing {
  border-top: var(--border);
  row-gap: var(--space-4);
}
.closing > * { grid-column: 1 / -1; }

.closing__title {
  font-size: var(--text-display);          /* same as the hero headline */
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  max-width: 14ch;
}

.closing__text p {
  font-size: var(--text-lg);               /* same as the hero intro */
  line-height: 1.45;
  max-width: 40ch;
}
.closing__text p + p { margin-top: var(--space-2); }

.closing__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

@media (min-width: 64em) {
  .closing__text {
    grid-column: 1 / span 7;
    grid-row: 2;
    margin-top: var(--space-4);
  }
  .closing__cta {
    grid-column: 9 / -1;
    grid-row: 2;
    justify-content: flex-end;
    align-self: end;
  }
}
