/* =========================================================
   Matt Gould Portfolio
   Built from Figma frame "MacBook Pro 14' - 114" (207:14128)
   Class names follow the Figma layer names where they exist.
   ========================================================= */

/* ---------- 1. Fonts ----------------------------------------
   Design uses Neue Haas Grotesk Text Std (65 Medium, 75 Bold)
   and Neue Haas Grotesk Display Std (55 Roman).
   Drop your font files (.woff2 or .otf) into /fonts using the file names below
   (or edit the src paths). Until then the stack falls back to
   Helvetica Neue / Arial as a placeholder.
------------------------------------------------------------- */
@font-face {
  font-family: "Brand Text";
  src: url("fonts/NHaasGroteskTXStd-65Md.woff2") format("woff2"),
       url("fonts/NHaasGroteskTXStd-65Md.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Brand Text";
  src: url("fonts/NHaasGroteskTXStd-75Bd.woff2") format("woff2"),
       url("fonts/NHaasGroteskTXStd-75Bd.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Brand Text";
  src: url("fonts/NHaasGroteskTXStd-55Rg.woff2") format("woff2"),
       url("fonts/NHaasGroteskTXStd-55Rg.otf") format("opentype");
  font-weight: 400;               /* 55 Roman: case study body copy */
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Brand Text";
  src: url("fonts/NHaasGroteskTXStd-56It.woff2") format("woff2"),
       url("fonts/NHaasGroteskTXStd-56It.otf") format("opentype");
  font-weight: 400;               /* 56 Italic */
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Brand Text";
  src: url("fonts/NHaasGroteskTXStd-66MdIt.woff2") format("woff2"),
       url("fonts/NHaasGroteskTXStd-66MdIt.otf") format("opentype");
  font-weight: 500;               /* 66 Medium Italic */
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Brand Display";
  src: url("fonts/NHaasGroteskDSStd-55Rg.woff2") format("woff2"),
       url("fonts/NHaasGroteskDSStd-55Rg.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- 2. Tokens (values from Figma) ------------------- */
:root {
  /* Colour */
  --color-bg: #f2efe8;
  --color-text: #000000;
  --color-text-alt: #0f0f0f;          /* "TOP" link */
  --color-rule: #000000;
  --color-rule-soft: rgba(0, 0, 0, 0.5);
  --color-placeholder: #d9d5cc;       /* image placeholders only */
  --shadow-screenshot: 0 0 40px 20px rgba(0, 0, 0, 0.1);

  /* Type families — placeholder fallbacks after the brand name */
  --font-text: "Brand Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Brand Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --weight-medium: 500;   /* 65 Medium */
  --weight-bold: 700;     /* 75 Bold */
  --weight-roman: 400;    /* 55 Roman */

  /* Type sizes: Figma value at 1500px wide, scaling down fluidly */
  --fs-hero: clamp(72px, 13.333vw, 200px);  /* 200 */
  --fs-intro: clamp(26px, 3.2vw, 48px);     /* 48 */
  --fs-now: clamp(34px, 4.267vw, 64px);     /* 64 */
  --fs-h2: clamp(24px, 2.4vw, 36px);        /* 36 */
  --fs-brand: clamp(20px, 1.6vw, 24px);     /* 24 */
  --fs-body: 16px;                          /* 16 */

  /* Spacing */
  --page-pad-x: clamp(20px, 5.333vw, 80px); /* 80 */
  --page-pad-top: clamp(24px, 5.333vw, 80px);  /* 80 */
  --page-pad-bottom: clamp(60px, 12vw, 180px); /* 180 */
  --stack-gap: 20px;                        /* bounder gap */
  --section-pad: clamp(48px, 8vw, 120px);   /* Hero / Now padding 120 */
  --heading-pad-top: 40px;                  /* Heading2 */
  --footer-pad-top: clamp(80px, 12vw, 180px); /* 180 */
  --card-gap: 30px;                         /* featured1/2 */
  --article-gap: 9px;                       /* Article */
  --articles-gap: 80px;                     /* Thoughts row */
  --grid-gap: 10px;                         /* icon grid */

  --content-max: 1340px;                    /* 1500 − 2×80 */
}

/* ---------- 3. Base ---------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-text);
  font-weight: var(--weight-medium);
  font-size: var(--fs-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
img { display: block; max-width: 100%; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- 4. bounder (page wrapper) -----------------------
   Auto layout: vertical, gap 20, padding 80 / 80 / 180 / 80
------------------------------------------------------------- */
.bounder {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--page-pad-x));
  margin: 0 auto;
  padding: var(--page-pad-top) var(--page-pad-x) var(--page-pad-bottom);
}

/* Shared pieces */
.rule { height: 4px; width: 100%; background: var(--color-rule); border: 0; margin: 0; flex-shrink: 0; }
.rule--thin { height: 1px; }
.rule--soft { height: 1px; background: var(--color-rule-soft); }

.brand {
  font-size: var(--fs-brand);
  font-weight: var(--weight-medium);
  line-height: normal;
  /* Figma text box holds two lines (second is empty): 58px tall */
  min-height: 2lh;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: var(--fs-body);
  line-height: normal;
  text-align: right;
}
.nav-list li:not(:last-child)::after { content: "|"; padding: 0 calc(0.3em + 5px); }  /* +5px each side */

.link-row {                      /* "Frame 427321292" / "Frame 427321294" */
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}
.link-row a {
  display: inline-flex;
  align-items: center;
  gap: inherit;
  font-size: var(--fs-body);
  line-height: 2.5;
  text-align: right;
  white-space: nowrap;
}
.icon { flex-shrink: 0; display: block; }

/* ---------- 5. headero ---------------------------------------
   Auto layout: horizontal, space-between, align top
------------------------------------------------------------- */
.headero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

/* ---------- 6. Hero ------------------------------------------
   Auto layout: vertical, padding 120 top/bottom, line-height 120%
------------------------------------------------------------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--section-pad) 0;
  line-height: 1.2;
}
.hero__title {
  font-size: var(--fs-hero);
  font-weight: var(--weight-bold);
  line-height: 1.2;
}
.hero__intro {
  max-width: 830px;
  font-size: var(--fs-intro);
  font-weight: var(--weight-medium);
  line-height: 1.2;
}

/* ---------- 7. Heading2 / heading2 --------------------------
   Auto layout: horizontal, padding-top 40
------------------------------------------------------------- */
.heading2 {
  display: flex;
  align-items: center;
  padding-top: var(--heading-pad-top);
}
.heading2 h2 {
  flex: 1 0 0;
  font-size: var(--fs-h2);
  font-weight: var(--weight-medium);
  line-height: normal;
}

/* ---------- 8. featured --------------------------------------
   Auto layout: horizontal, space-between; children 612 wide
------------------------------------------------------------- */
.featured {
  display: flex;
  align-items: stretch;      /* equal-height cards so featured2 can match featured1 */
  justify-content: space-between;
  gap: 40px;
  width: 100%;
}
.featured1,
.featured2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--card-gap);
  flex: 0 1 612px;
  min-width: 0;
}
.featured__title {
  width: 100%;
  font-size: var(--fs-h2);
  font-weight: var(--weight-medium);
  line-height: 1.2;
}
.featured__tags {
  width: 100%;
  font-size: var(--fs-body);
  line-height: 1;            /* featured1 and featured2 share this */
}

/* image 133: photo, 600:475 */
.image-133 {
  width: 100%;
  aspect-ratio: 600 / 475;
  background: var(--color-placeholder);
  overflow: hidden;
}
.image-133 img { width: 100%; height: 100%; object-fit: cover; object-position: bottom; }

/* image 165 + the rule beneath it.
   Two featured2 tiles side by side: each image starts at 531:403 and the
   shorter tile's image grows, so both bottom rules line up.
   Next to a featured1 tile: the image shrinks or grows until its rule
   lines up with the bottom of image 133, at any screen width. */
.featured2__media {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
  flex: 1 0 auto;
  width: 100%;
}
.image-165 {
  flex: 1 0 auto;
  aspect-ratio: 531 / 403;
  width: 100%;
  background: var(--color-placeholder);
  box-shadow: var(--shadow-screenshot);
  overflow: hidden;
}
.image-165 img { width: 100%; height: 100%; object-fit: cover; }
.featured:has(.featured1) .featured2__media,
.featured:has(.featured1) .image-165 {
  flex: 1 1 0;
  min-height: 0;
  aspect-ratio: auto;
}

/* ---------- 9. Moew ("See more articles") --------------------
   Auto layout: horizontal, justify end, gap 10
------------------------------------------------------------- */
.moew { width: 100%; }
.moew a { font-weight: var(--weight-bold); }

/* ---------- 10. Now ------------------------------------------
   Auto layout: vertical, padding 120 top/bottom
------------------------------------------------------------- */
.now {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;                 /* between title, summary and icon grid */
  padding: var(--section-pad) 0;
}
.now__title {
  font-size: var(--fs-now);
  font-weight: var(--weight-medium);
  line-height: normal;
}
.now__summary {
  max-width: 602px;
  font-size: var(--fs-h2);
  font-weight: var(--weight-medium);
  line-height: 1.2;
}

/* "Frame 427321293": grid, gap 10. Figma has 11 × 2; with 16 icons
   it's 8 × 2 so the rows stay full (4 × 4 on phones) */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 97px));   /* icons max 97px */
  gap: var(--grid-gap);
  width: 100%;
}
.icon-grid > * {
  aspect-ratio: 1 / 1;
  background: var(--color-placeholder);
  overflow: hidden;
}
.icon-grid img { width: 100%; height: 100%; object-fit: contain; }
.icon-grid > :has(img) { background: none; }

/* ---------- 11. Thoughts articles ("Frame 427321298") --------
   Auto layout: horizontal, gap 80, padding-bottom 80;
   each "Article": vertical, gap 9, fill width
------------------------------------------------------------- */
.articles {
  display: flex;
  align-items: center;
  gap: var(--articles-gap);
  padding-bottom: 80px;
}
.article {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--article-gap);
  flex: 1 0 0;
  min-width: 0;
}
.article__title {
  width: 100%;
  min-height: 192px;
  font-size: var(--fs-h2);
  font-weight: var(--weight-medium);
  line-height: normal;
}
.article .link-row { gap: 6px; }

/* ---------- 12. Footer ("Frame 427321299" / "…301") ---------- */
/* main and footer pass their children straight into bounder's auto layout */
main,
.site-footer { display: contents; }
.footer-top {                     /* Frame 427321299: pt 180 */
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  /* thin light divider at the top of the footer; the brand still sits
     180px below the content (140 above the line + 40 below) */
  margin-top: max(calc(var(--footer-pad-top) - 40px), 40px);
  padding-top: 40px;
  border-top: 1px solid var(--menu-divider);
}
.footer-bottom {                  /* Frame 427321301 */
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.footer-email {
  font-family: var(--font-display);
  font-weight: var(--weight-roman);
  font-size: var(--fs-body);
  line-height: 1.5;
  white-space: nowrap;
}
.to-top {                         /* Frame 427321300: gap 7 */
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--color-text-alt);
  line-height: normal;
}
.to-top .icon { transform: rotate(-90deg); }

/* ---------- 13. Responsive ---------------------------------- */
@media (max-width: 1100px) {
  .articles { gap: 40px; }
}

@media (max-width: 900px) {
  .featured { flex-direction: column; gap: 60px; }
  .featured1, .featured2 { flex-basis: auto; width: 100%; }
  .featured2__media,
  .featured:has(.featured1) .featured2__media { flex: none; }
  .image-165,
  .featured:has(.featured1) .image-165 { flex: none; aspect-ratio: 531 / 403; }   /* stacked: natural size */

  .articles { flex-direction: column; align-items: stretch; gap: 48px; padding-bottom: 40px; }
  .article__title { min-height: 0; }

}

@media (max-width: 640px) {

  .icon-grid { grid-template-columns: repeat(4, minmax(0, 97px)); }

  .footer-bottom { flex-wrap: wrap; }
}

/* ---------- 14. Menu ----------------------------------------
   Desktop: inline list beside the brand.
   Compact (html.nav-compact, set by menu.js when the inline menu
   no longer fits): Figma "MacBook Pro 14' - 124 / - 185".
------------------------------------------------------------- */
:root {
  --menu-bg: rgba(242, 239, 232, 0.91);
  --menu-blur: 6.15px;
  --menu-shadow: 0 20px 37.1px 0 rgba(0, 0, 0, 0.25);
  --menu-divider: rgba(0, 0, 0, 0.2);
  --menu-pad: 20px;
  --menu-gap: 14px;
  --menu-icon-speed: 0.2s;
  --menu-open-speed: 0.3s;
  --menu-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

.headero { position: relative; }
.menu-toggle { display: none; }

/* "Frame 427321302": Menu label + 17px icon, gap 4 */
.menu-toggle {
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: var(--fs-body);
  font-weight: var(--weight-medium);
  line-height: normal;
  cursor: pointer;
}
.menu-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* Hamburger → X. Opening: bars slide together, then rotate.
   Closing: rotate back, then slide apart. */
.menuicon {
  position: relative;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.menuicon span {
  position: absolute;
  left: 1px;
  right: 1px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition:
    top var(--menu-icon-speed) ease var(--menu-icon-speed),
    transform var(--menu-icon-speed) ease 0s,
    opacity 0s linear var(--menu-icon-speed);
}
.menuicon span:nth-child(1) { top: 3px; }
.menuicon span:nth-child(2) { top: 7.5px; }
.menuicon span:nth-child(3) { top: 12px; }

.menu-toggle[aria-expanded="true"] .menuicon span {
  transition:
    top var(--menu-icon-speed) ease 0s,
    transform var(--menu-icon-speed) ease var(--menu-icon-speed),
    opacity 0s linear var(--menu-icon-speed);
}
.menu-toggle[aria-expanded="true"] .menuicon span:nth-child(1) { top: 7.5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menuicon span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menuicon span:nth-child(3) { top: 7.5px; transform: rotate(-45deg); }

@media (prefers-reduced-motion: reduce) {
  .menuicon span,
  .menu-toggle[aria-expanded="true"] .menuicon span { transition: none; }
}

/* Compact header: "Frame 427321303", vertical, gap 20 */
.nav-compact .headero {
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.nav-compact .menu-toggle { display: inline-flex; }

/* Shared compact list style: "Frame 427321304" */
.nav-compact .site-nav .nav-list {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--menu-gap);
  /* 20px top/bottom from Figma; sides use the page padding so the
     items line up with the rest of the site at every width */
  padding: var(--menu-pad) var(--page-pad-x);
  background: var(--menu-bg);
  -webkit-backdrop-filter: blur(var(--menu-blur));
  backdrop-filter: blur(var(--menu-blur));
  text-align: left;
}
.nav-compact .site-nav .nav-list li {
  display: flex;
  flex-direction: column;
  gap: var(--menu-gap);
}
.nav-compact .site-nav .nav-list li:not(:last-child)::after {
  content: "";
  height: 1px;
  padding: 0;
  background: var(--menu-divider);
}

/* Header drop-down: 40px below the top of the header, full bleed.
   Opening: the panel unrolls downwards, then the items fade in one
   after another. Closing: items fade out and the panel rolls up. */
.nav-compact .headero .site-nav {
  position: absolute;
  top: 40px;
  left: calc(-1 * var(--page-pad-x));
  right: calc(-1 * var(--page-pad-x));
  z-index: 10;
  box-shadow: var(--menu-shadow);
  visibility: hidden;
  clip-path: inset(0 0 100% 0);
  transition:
    clip-path var(--menu-open-speed) var(--menu-ease),
    visibility 0s linear var(--menu-open-speed);
}
.nav-compact .headero.is-open .site-nav {
  visibility: visible;
  clip-path: inset(0 0 -80px 0);   /* -80px leaves room for the shadow */
  transition:
    clip-path var(--menu-open-speed) var(--menu-ease),
    visibility 0s;
}
.nav-compact .headero .site-nav li {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.nav-compact .headero.is-open .site-nav li {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.25s ease calc(80ms + var(--i, 0) * 35ms),
    transform 0.25s var(--menu-ease) calc(80ms + var(--i, 0) * 35ms);
}
.nav-compact .headero .site-nav li:nth-child(2) { --i: 1; }
.nav-compact .headero .site-nav li:nth-child(3) { --i: 2; }
.nav-compact .headero .site-nav li:nth-child(4) { --i: 3; }
.nav-compact .headero .site-nav li:nth-child(5) { --i: 4; }
.nav-compact .headero .site-nav li:nth-child(6) { --i: 5; }

@media (prefers-reduced-motion: reduce) {
  .nav-compact .headero .site-nav,
  .nav-compact .headero.is-open .site-nav,
  .nav-compact .headero .site-nav li,
  .nav-compact .headero.is-open .site-nav li { transition: none; }
}

/* Footer: same list, always open, sits under the brand */
.nav-compact .footer-top {
  flex-direction: column;
  gap: 20px;
}
.nav-compact .site-nav--footer {
  align-self: stretch;
  margin: 0 calc(-1 * var(--page-pad-x));
}

/* ---------- 15. Hover ----------------------------------------
   One system: same easing as the menu, short durations.
   Focus (keyboard) triggers the same states as hover.
------------------------------------------------------------- */
:root {
  --hover-speed: 0.25s;
  --hover-ease: var(--menu-ease);
}

/* Drawn-in underline: wrap link text in <span class="u"> */
.u,
html:not(.nav-compact) .site-nav a {
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: background-size var(--hover-speed) var(--hover-ease);
}
.featured__title .u,
.article__title .u { background-size: 0 2px; }   /* heavier for 36px titles */

a:hover .u,
a:focus-visible .u,
html:not(.nav-compact) .site-nav a:hover,
html:not(.nav-compact) .site-nav a:focus-visible { background-size: 100% 1px; }

/* Cards: featured1, featured2 and each Article are fully clickable.
   The "Read this…" link stretches over the whole card. */
.card { position: relative; }
.card .link-row a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.card > .rule:first-child {
  transform-origin: top;
  transition: transform var(--hover-speed) var(--hover-ease);
}
.card .link-row .icon,
.image-133 > *,
.image-165 {
  transition:
    transform var(--hover-speed) var(--hover-ease),
    box-shadow 0.6s var(--hover-ease);
}
.image-133 > * { transition-duration: 0.6s; }

.card:hover > .rule:first-child,
.card:focus-within > .rule:first-child { transform: scaleY(1.5); }       /* 4px → 6px */
.card:hover .u,
.card:focus-within .u { background-size: 100% 1px; }
.card:hover .featured__title .u,
.card:focus-within .featured__title .u,
.card:hover .article__title .u,
.card:focus-within .article__title .u { background-size: 100% 2px; }
.card:hover .link-row .icon,
.card:focus-within .link-row .icon { transform: translateX(4px); }
.card:hover .image-133 > *,
.card:focus-within .image-133 > * { transform: scale(1.03); }           /* photo slow zoom */
.card:hover .image-165,
.card:focus-within .image-165 {                                         /* screenshot lifts */
  box-shadow: 0 12px 50px 24px rgba(0, 0, 0, 0.14);
}

/* "See more articles": image 150 as a CSS circle; arrow slides through */
.circle-arrow {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-text);
  color: var(--color-bg);
  overflow: hidden;
}
.moew a:hover .circle-arrow .icon,
.moew a:focus-visible .circle-arrow .icon {
  animation: arrow-through 0.5s var(--hover-ease);
}
@keyframes arrow-through {
  0%     { transform: translateX(0); }
  40%    { transform: translateX(20px); }
  40.01% { transform: translateX(-20px); }
  100%   { transform: translateX(0); }
}

/* TOP: arrow nudges up and back */
.to-top:hover .icon,
.to-top:focus-visible .icon { animation: nudge-up 0.4s var(--hover-ease); }
@keyframes nudge-up {
  0%, 100% { transform: rotate(-90deg) translateX(0); }
  50%      { transform: rotate(-90deg) translateX(3px); }  /* rotated: +x is up */
}

/* Compact menu (header drop-down and footer list):
   item nudges right, chevron fades in, divider fills black */
.nav-compact .site-nav a {
  display: flex;
  align-items: center;
  transition: padding-left var(--hover-speed) var(--hover-ease);
}
.nav-compact .site-nav a::after {
  content: "";
  width: 11px;
  height: 11px;
  margin-left: auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5.5 2.5 11 8l-5.5 5.5' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5.5 2.5 11 8l-5.5 5.5' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity var(--hover-speed) var(--hover-ease),
    transform var(--hover-speed) var(--hover-ease);
}
.nav-compact .site-nav a:hover,
.nav-compact .site-nav a:focus-visible { padding-left: 6px; }
.nav-compact .site-nav a:hover::after,
.nav-compact .site-nav a:focus-visible::after { opacity: 1; transform: none; }

.nav-compact .site-nav .nav-list li:not(:last-child)::after {
  background:
    linear-gradient(var(--color-rule), var(--color-rule)) no-repeat 0 0 / 0% 100%,
    var(--menu-divider);
  transition: background-size var(--hover-speed) var(--hover-ease);
}
.nav-compact .site-nav .nav-list li:hover::after,
.nav-compact .site-nav .nav-list li:focus-within::after { background-size: 100% 100%; }

@media (prefers-reduced-motion: reduce) {
  .u,
  html:not(.nav-compact) .site-nav a,
  .card > .rule:first-child,
  .card .link-row .icon,
  .image-133 > *,
  .image-165,
  .nav-compact .site-nav a,
  .nav-compact .site-nav a::after,
  .nav-compact .site-nav .nav-list li::after { transition: none; }
  .moew a .circle-arrow .icon,
  .to-top .icon { animation: none !important; }
}

/* ---------- 16. Section pages (Leadership, Product Design) ---
   Figma "MacBook Pro 14' - 115": Hero padding-top 120 only,
   title 128px Bold, then two "featured" rows of the home tiles.
------------------------------------------------------------- */
:root { --fs-page-title: clamp(48px, 8.533vw, 128px); }  /* 128 */

.hero--page { padding-bottom: 0; }
.page-title {
  font-size: var(--fs-page-title);
  font-weight: var(--weight-bold);
  line-height: 1.2;
}

@media (max-width: 900px) {
  /* stacked tiles sit 60px apart; keep the same rhythm between rows */
  .featured + .featured { margin-top: 40px; }
}

/* ---------- 17. Current page indicator ----------------------
   The current menu item (aria-current="page") keeps the 1px hover
   underline fully drawn, so it reads as "you are here".
------------------------------------------------------------- */
html:not(.nav-compact) .site-nav a[aria-current="page"] { background-size: 100% 1px; }

/* Compact menu rows are full width, so underline just the text */
.nav-compact .site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* ---------- 18. Thoughts page ------------------------------
   Figma "MacBook Pro 14' - 140". Rows of 3 "Article" tiles, gap 40.
   Each tile: top group (4px rule + title, gap 10) and bottom group
   (soft rule + link, gap 10) pushed apart (space-between).
   One grid with grid-auto-rows: 1fr makes every tile the height of
   the tallest, never shorter than Figma's 356px, whatever the copy.
------------------------------------------------------------- */
:root { --thought-min-height: clamp(220px, 23.733vw, 356px); }  /* 356 */

.thoughts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  column-gap: 40px;
  row-gap: 40px;              /* Figma: 20 row padding + 20 bounder gap */
  width: 100%;
}
.thought {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;                  /* minimum space if a title gets very long */
  min-height: var(--thought-min-height);
}
.thought__top,
.thought__bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.thought__title {
  font-size: var(--fs-h2);
  font-weight: var(--weight-medium);
  line-height: normal;
}
.thought .link-row { gap: 9px; }

/* Hover: same as the other cards (rule thickens, title underlines) */
.thought__top > .rule {
  transform-origin: top;
  transition: transform var(--hover-speed) var(--hover-ease);
}
.thought:hover .thought__top > .rule,
.thought:focus-within .thought__top > .rule { transform: scaleY(1.5); }
.thought__title .u { background-size: 0 2px; }
.thought:hover .thought__title .u,
.thought:focus-within .thought__title .u { background-size: 100% 2px; }

@media (max-width: 1100px) {
  .thoughts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .thoughts-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .thought__top > .rule { transition: none; }
}

/* ---------- 19. About page ---------------------------------
   Figma "MacBook Pro 14' - 141"
------------------------------------------------------------- */
:root { --fs-bio: clamp(18px, 1.6vw, 24px); }  /* 24 */

.about-intro {
  max-width: 1000px;
  font-size: var(--fs-intro);          /* 48 */
  font-weight: var(--weight-medium);
  line-height: 1.2;
}

/* Photo 400 | bio fill | expertise 405, gap 48, padding 80 0 */
.about {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(300px, 1fr) minmax(0, 405px);  /* bio min 300 */
  gap: 48px;
  align-items: start;
  padding: 80px 0;
  width: 100%;
}
.about__photo {
  aspect-ratio: 1 / 1;
  border-radius: 5px;
  background: var(--color-placeholder);
  overflow: hidden;
}
.about__photo img { width: 100%; height: 100%; object-fit: cover; }

.about__bio {
  font-size: var(--fs-bio);
  line-height: 1.5;
}
.about__bio p + p { margin-top: 1.5em; }   /* Figma: one empty line between */

/* Expertise: vertical, gap 20 */
.expertise {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.expertise__title {
  font-size: var(--fs-h2);
  font-weight: var(--weight-medium);
  line-height: normal;
}
.expertise__list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: var(--fs-body);
  line-height: 1;
}
/* soft rule above every item and after the last */
.expertise__list li::before,
.expertise__list li:last-child::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--color-rule-soft);
}
.expertise__list li::before { margin-bottom: 20px; }
.expertise__list li:last-child::after { margin-top: 20px; }

/* maillogo 76px circle + email 20px, gap 14 */
.mail-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 20px;
  line-height: 1.2;
  min-width: 0;
}
.mail-link .u { overflow-wrap: break-word; }
.maillogo {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-text);
  color: var(--color-bg);
  transition: transform var(--hover-speed) var(--hover-ease);
}
.mail-link:hover .maillogo,
.mail-link:focus-visible .maillogo { transform: rotate(-8deg); }

@media (max-width: 1100px) {
  .about { grid-template-columns: minmax(0, 320px) minmax(300px, 1fr); }
  .expertise { grid-column: 1 / -1; max-width: 520px; }
}
@media (max-width: 700px) {
  .about { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 48px 0; }
  .about__photo { max-width: 400px; }
  .expertise { grid-column: auto; }
  .maillogo { width: 60px; height: 60px; }
  .mail-link { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .maillogo { transition: none; }
}

/* ---------- 20. Contact page -------------------------------
   Figma "MacBook Pro 14' - 141" (Contact version)
------------------------------------------------------------- */
.contact-me {
  display: flex;
  align-items: center;             /* icon centred on the text at any wrap */
  gap: 20px;
  padding-bottom: 80px;
}
.contact-me__text {
  max-width: 600px;
  min-width: 0;
  font-size: var(--fs-h2);          /* 36 */
  font-weight: var(--weight-medium);
  line-height: 1.2;
}
.contact-me__text a { display: inline-block; max-width: 100%; overflow-wrap: break-word; }  /* email moves to its own line, as in Figma */
.contact-me:hover .maillogo { transform: rotate(-8deg); }

.contact-expertise__title {
  font-size: var(--fs-h2);
  font-weight: var(--weight-medium);
  line-height: normal;
}

/* 4 equal columns, gap 5; soft rule above and below each item */
.contact-expertise {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;        /* every item as tall as the tallest, in every row */
  gap: 15px;                  /* Figma 5 + 10 */
  width: 100%;
  font-size: var(--fs-body);
  line-height: 1;
}
.contact-expertise li {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.contact-expertise li::before,
.contact-expertise li::after {
  content: "";
  height: 1px;
  background: var(--color-rule-soft);
}
.contact-expertise li::after { margin-top: auto; }   /* bottom rule pinned to the bottom */

@media (max-width: 1000px) {
  .contact-expertise { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 30px; }
}
@media (max-width: 700px) {
  .contact-me { padding-bottom: 48px; }
  .contact-me .maillogo { width: 60px; height: 60px; }
}
@media (max-width: 480px) {
  /* Single list: one rule between items. The top rule moves to the list
     so every item has the same structure (text + rule) and equal height. */
  .contact-expertise {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-rule-soft);
  }
  .contact-expertise li::before { display: none; }
}

/* ---------- 21. Case study (template) ----------------------
   Figma "MacBook Pro 14' - 141" (case study version).
   Text Roman (400) is used for body copy here.
------------------------------------------------------------- */
:root {
  --fs-cs-title: clamp(40px, 6.4vw, 96px);    /* 96 */
  --fs-cs-intro: clamp(22px, 2.133vw, 32px);  /* 32 */
  --fs-cs-body: clamp(17px, 1.333vw, 20px);   /* 20 */
  --cs-panel-pad: clamp(20px, 5.333vw, 80px); /* 80 */
  --cs-image-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.25);
  --color-caption: #7e7e7e;
  /* stand-in for the Figma paper texture: grain, shown at 13% */
  --cs-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cs-category {                     /* 20 Roman, 150%, tracking 2px, pt 120 */
  padding-top: var(--section-pad);
  font-size: var(--fs-cs-body);
  font-weight: var(--weight-roman);
  line-height: 1.5;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.cs-title {                        /* 96 Medium, 120%, max 1095 */
  max-width: 1095px;
  font-size: var(--fs-cs-title);
  font-weight: var(--weight-medium);
  line-height: 1.2;
}
.cs-intro {                        /* 32 Roman, 150%, padding 40 0, max 1014 */
  max-width: 1014px;
  padding: 40px 0;
  font-size: var(--fs-cs-intro);
  font-weight: var(--weight-roman);
  line-height: 1.5;
}

/* Figure: textured panel (padding 80) with a centred, shadowed image */
.cs-figure {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  margin: 0;
}
.cs-figure__panel {
  position: relative;
  display: flex;
  justify-content: center;
  padding: var(--cs-panel-pad);
  isolation: isolate;
}
.cs-figure__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--cs-texture);
  opacity: 0.13;
  pointer-events: none;
}
.cs-figure__image {
  width: 100%;
  max-width: 882px;                /* 881.7 */
  aspect-ratio: 881.7 / 669;
  border-radius: 5px;
  background: var(--color-placeholder);
  box-shadow: var(--cs-image-shadow);
  overflow: hidden;
}
.cs-figure__image img { width: 100%; height: 100%; object-fit: cover; }
.cs-figure--small .cs-figure__image {
  max-width: 446px;
  aspect-ratio: 446 / 339;
}
.cs-figure figcaption {            /* 16 Medium, 150%, #7e7e7e */
  font-size: var(--fs-body);
  font-weight: var(--weight-medium);
  line-height: 1.5;
  color: var(--color-caption);
}

/* Achievements: padding-top 80, gap 26, soft rules, items 32 Roman */
.cs-list {
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 100%;
  padding-top: 80px;
}
.cs-list__title {
  font-size: var(--fs-h2);
  font-weight: var(--weight-medium);
  line-height: normal;
}
.cs-list ul {
  display: flex;
  flex-direction: column;
  gap: 26px;
  font-size: var(--fs-cs-intro);
  font-weight: var(--weight-roman);
  line-height: 1;
}
.cs-list ul::before,
.cs-list li::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--color-rule-soft);
}
.cs-list li::after { margin-top: 26px; }

/* Section: padding-top 40, gap 20, max 1078 */
.cs-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1078px;
  padding-top: 40px;
}
.cs-section h2 {
  font-size: var(--fs-h2);
  font-weight: var(--weight-medium);
  line-height: 1.5;
}
.cs-section__body {
  font-size: var(--fs-cs-body);
  font-weight: var(--weight-roman);
  line-height: 1.5;
}
.cs-section__body ul {
  list-style: disc;
  padding-left: 30px;
}
.cs-section__body p + p,
.cs-section__body ul + p { margin-top: 0; }   /* Figma: no extra space between blocks */

@media (max-width: 700px) {
  .cs-list,
  .cs-figure + .cs-list { padding-top: 48px; }
  .cs-list ul { line-height: 1.2; }
}

/* ---------- 22. Back link (case study + blog post) ----------
   Figma 217:15203: padding-top 120, gap 9, chevron 17 (pointing
   left), 16 Medium, line-height 2.5
------------------------------------------------------------- */
.back-row {
  display: flex;
  align-items: center;
  padding-top: var(--section-pad);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: var(--fs-body);
  line-height: 2.5;
}
.back-link .icon {
  transform: rotate(180deg);
  transition: transform var(--hover-speed) var(--hover-ease);
}
.back-link:hover .icon,
.back-link:focus-visible .icon { transform: rotate(180deg) translateX(4px); }  /* nudges left */
.back-row + .cs-category { padding-top: 0; }   /* back link now carries the 120 */

/* ---------- 23. Blog post --------------------------------- */
.post-image {                      /* "image 178": full width, 1920:657 */
  width: 100%;
  aspect-ratio: 1920 / 657;
  margin: 0;
  background: var(--color-placeholder);
  overflow: hidden;
}
.post-image img { width: 100%; height: 100%; object-fit: cover; }
.post-caption {
  font-size: var(--fs-body);
  font-weight: var(--weight-medium);
  line-height: 1.5;
  color: var(--color-caption);
}

/* ---------- 24. Previous / next ----------------------------
   Same language as the tiles: 4px rule, 16px label with chevron,
   36px title. Previous on the left, next on the right.
------------------------------------------------------------- */
.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  width: 100%;
  padding-top: 80px;
}
.pager__link {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pager__link::before {             /* 4px rule, thickens on hover like the cards */
  content: "";
  align-self: stretch;           /* full width on both sides */
  height: 4px;
  margin-bottom: 10px;
  background: var(--color-rule);
  transform-origin: top;
  transition: transform var(--hover-speed) var(--hover-ease);
}
.pager__link--next { grid-column: 2; text-align: right; align-items: flex-end; }
.pager__label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: var(--fs-body);
  line-height: 2.5;
}
.pager__link--prev .pager__label .icon { transform: rotate(180deg); }
.pager__label .icon { transition: transform var(--hover-speed) var(--hover-ease); }
.pager__title {
  max-width: 560px;
  font-size: var(--fs-h2);
  font-weight: var(--weight-medium);
  line-height: 1.2;
}
.pager__title .u { background-size: 0 2px; }

.pager__link:hover::before,
.pager__link:focus-visible::before { transform: scaleY(1.5); }
.pager__link:hover .pager__title .u,
.pager__link:focus-visible .pager__title .u { background-size: 100% 2px; }
.pager__link--prev:hover .icon,
.pager__link--prev:focus-visible .icon { transform: rotate(180deg) translateX(4px); }
.pager__link--next:hover .icon,
.pager__link--next:focus-visible .icon { transform: translateX(4px); }

@media (max-width: 640px) {
  .pager { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 48px; }
  .pager__link--next { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .back-link .icon,
  .pager__link::before,
  .pager__label .icon { transition: none; }
}

/* ---------- 25. Blog post body -----------------------------
   Real posts are longer than the Figma sample, so blocks in the
   body get a line of space between them for readability.
------------------------------------------------------------- */
.post .cs-section__body > * + * { margin-top: 1em; }
.post .cs-section__body li + li { margin-top: 0.4em; }
.cs-section__body strong { font-weight: var(--weight-medium); }

/* Post images keep their own proportions once a real image is in */
.post-image:has(img) { aspect-ratio: auto; background: none; }
.post-image:has(img) img { height: auto; object-fit: contain; }

/* ---------- 26. Case study body (real content) -------------
   Same readability spacing as blog posts, and figures take the
   real image's proportions once an image is in.
------------------------------------------------------------- */
.case-study .cs-section__body > * + * { margin-top: 1em; }
.case-study .cs-section__body li + li { margin-top: 0.4em; }
.cs-figure__image:has(img) { aspect-ratio: auto; background: none; }
.cs-figure__image:has(img) img { height: auto; object-fit: contain; }

/* ---------- 27. Case study extras: sub-headings and quotes --
   Not in the Figma template; built from the same type and rules.
------------------------------------------------------------- */
.cs-section__body h3 {
  font-size: var(--fs-bio);            /* 24 */
  font-weight: var(--weight-medium);
  line-height: 1.5;
}
.case-study .cs-section__body > * + h3 { margin-top: 1.5em; }

/* "From my team": soft rule above each quote, like Achievements */
.cs-quotes {
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 100%;
  padding-top: 80px;
}
.cs-quote {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1078px;
  margin: 0;
  padding-top: 26px;
  border-top: 1px solid var(--color-rule-soft);
}
.cs-quote blockquote {
  margin: 0;
  font-size: var(--fs-bio);            /* 24 */
  font-weight: var(--weight-roman);
  line-height: 1.5;
}
.cs-quote figcaption {
  font-size: var(--fs-body);
  font-weight: var(--weight-medium);
  line-height: 1.5;
}
.cs-quote figcaption::before { content: "— "; }
@media (max-width: 700px) {
  .cs-quotes { padding-top: 48px; }
}

/* Narrow post image: max 500px wide (e.g. the BJ Fogg diagram) */
.post-image--narrow { max-width: 500px; }

/* ---------- 28. Tile images: fit inside the tile -----------
   Home, Product Design and Leadership tiles. With a real image in
   place the box shows the whole image (no cropping), centred, and the
   drop shadow sits on the image itself rather than on the box.
------------------------------------------------------------- */
.image-133:has(img),
.image-165:has(img) {
  position: relative;
  background: none;
  box-shadow: none;
  overflow: visible;
}
/* taken out of the flow so the tile keeps its size whatever the image's shape */
.image-133:has(img) img,
.image-165:has(img) img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: var(--shadow-screenshot);
}
.card:hover .image-165:has(img),
.card:focus-within .image-165:has(img) { box-shadow: none; }
.card:hover .image-165:has(img) img,
.card:focus-within .image-165:has(img) img { box-shadow: 0 12px 50px 24px rgba(0, 0, 0, 0.14); }
.image-165:has(img) img { transition: box-shadow 0.6s var(--hover-ease); }
.about__photo:has(img) { background: none; }

/* No drop shadow: add "no-shadow" to a tile's <article> or a case
   study's <figure class="cs-figure"> (e.g. images with their own frame
   or a transparent background) */
.no-shadow .image-133,
.no-shadow .image-165,
.no-shadow .image-133 img,
.no-shadow .image-165 img,
.card.no-shadow:hover .image-165,
.card.no-shadow:hover .image-165 img,
.card.no-shadow:focus-within .image-165,
.card.no-shadow:focus-within .image-165 img,
.cs-figure.no-shadow .cs-figure__image { box-shadow: none; }
