/* Page layout for the whole site: an off-white page with large rounded linen
   panels, soft cards, pill buttons and two-voice headlines. Brand colours and
   typefaces come from site.css. */

.v2 {
  --page: #FDFBF8;
  --panel: var(--linen);
  --v2-card: #FFFDF9;
  --v2-card-line: rgb(11 51 45 / 0.08);
  --r-panel: clamp(1.25rem, 3vw, 2.25rem);
  --r-card: clamp(1rem, 2vw, 1.5rem);
  --edge: clamp(0.5rem, 1.5vw, 1rem);
  --pad: clamp(1.25rem, 4.5vw, 4rem);
  background: var(--page);
}
@media (prefers-color-scheme: dark) {
  .v2 {
    --page: var(--pine-deeper);
    --panel: var(--pine);
    --v2-card: #123F38;
    --v2-card-line: rgb(247 236 218 / 0.1);
  }
}

.v2 main { padding-top: max(var(--edge), env(safe-area-inset-top)); }

/* Large rounded panels that almost touch the screen edges. */
.v2-panel {
  max-width: 88rem;
  margin-inline: max(var(--edge), env(safe-area-inset-left)) max(var(--edge), env(safe-area-inset-right));
  padding: clamp(1rem, 2.5vw, 1.75rem) var(--pad) var(--pad);
  border-radius: var(--r-panel);
  background: var(--panel);
}
@media (min-width: 90rem) { .v2-panel { margin-inline: auto; } }

.v2-wrap--narrow.v2-wrap { max-width: 50rem; }
.v2-wrap {
  max-width: 80rem;
  margin-inline: auto;
  padding-left: max(calc(var(--edge) + var(--pad)), env(safe-area-inset-left));
  padding-right: max(calc(var(--edge) + var(--pad)), env(safe-area-inset-right));
}
.v2-section { padding-block: clamp(3.5rem, 9vw, 7.5rem); }
.v2-section--flush { padding-top: 0; }
.v2-spacer { height: clamp(2rem, 6vw, 5rem); }

.v2-card {
  display: block;
  border: 1px solid var(--v2-card-line);
  border-radius: var(--r-card);
  background: var(--v2-card);
  color: inherit;
  text-decoration: none;
}
.v2-section .v2-card, .v2-posts .v2-card, .post-nav .v2-card { background: var(--panel); border-color: transparent; }

/* Two-voice headline: a light sans line, then the brand title face. */
.v2-h { font-size: clamp(2.25rem, 1.3rem + 4.6vw, 4.5rem); line-height: 1.02; }
h2.v2-h { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.5rem); }
.v2-h__light { display: block; font-family: var(--font-body); font-weight: 300; letter-spacing: -0.035em; text-transform: none; }
.v2-h__strong { display: block; }

.v2-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 2.75rem;
  padding: 0.6rem 1.35rem;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.v2-pill:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); transform: translateY(-1px); }
.v2-pill--accent, .site-nav .v2-pill--accent { border-color: var(--terra); background: var(--terra); color: var(--linen); }
.v2-pill--accent:hover { background: #D94A1B; border-color: #D94A1B; color: var(--linen); }

.v2-more { display: inline-block; font-size: 0.95rem; font-weight: 600; text-decoration: underline; text-decoration-color: var(--terra); text-decoration-thickness: 0.1em; text-underline-offset: 0.25em; }
a:hover > .v2-more, a.v2-more:hover { text-decoration-thickness: 0.2em; }

/* -------------------------------------------------------------------- hero */

.ext-icon { display: inline-block; width: 0.7em; height: 0.7em; margin-left: 0.12em; vertical-align: 0; overflow: visible; }

.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; min-height: 4rem; }
.site-logo { display: block; flex: none; color: var(--fg); }
.site-logo svg { height: 3rem; width: auto; }
.site-nav__list { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem; }
.site-nav a { padding: 0.5rem 0; border-bottom: 2px solid transparent; font-size: 0.92rem; font-weight: 500; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--terra); }
.site-nav__ext { white-space: nowrap; }
.site-nav .v2-pill { order: 2; margin-left: 0.5rem; padding: 0.7rem 1.6rem; border: 1.5px solid var(--terra); font-weight: 600; }
.site-nav .v2-pill:hover { border-color: #D94A1B; }
.nav-toggle { display: none; }

/* Below this width the links and the Subscribe button no longer fit on one row
   next to the logo (phones, small tablets, an unfolded iPhone Duo in portrait),
   so the menu collapses behind a button instead of wrapping onto extra lines. */
@media (max-width: 58rem) {
  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 1.1rem;
    border: 1.5px solid currentColor;
    border-radius: 999px;
    background: none;
    color: inherit;
    font: 600 0.9rem/1 var(--font-body);
    cursor: pointer;
  }
  /* The row keeps its height through padding, not min-height: once the open
     menu wraps onto a second line, min-height no longer centres the first one
     and the logo and button would jump up by half a rem. */
  .site-header__inner { min-height: 0; padding-block: 0.5rem; row-gap: 0; }
  .site-nav { flex-basis: 100%; }
  .site-nav__list { padding-top: 0.75rem; }
  /* Closed, the menu is a grid row of 0fr; open, 1fr. Transitioning between
     the two slides it to its natural height without any measuring in JS. */
  .js .site-nav {
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    opacity: 0;
    transition: grid-template-rows 0.3s ease, opacity 0.2s ease, visibility 0s 0.3s;
  }
  .js .site-nav.is-open { grid-template-rows: 1fr; visibility: visible; opacity: 1; transition-delay: 0s; }
  .js .site-nav__list { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; min-height: 0; overflow: hidden; padding-top: 0; }
  .js .site-nav a { padding: 0.95rem 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .js .site-nav a:last-child { margin-bottom: 0.5rem; }
  .js .site-nav .v2-pill { order: 0; margin: 1.5rem 0 0.5rem; justify-content: center; padding: 0.7rem 1.6rem; border: 1.5px solid var(--terra); }
}

/* Intro block at the top of every page other than the homepage. */
.v2-intro { padding-block: clamp(2rem, 6vw, 4.5rem) clamp(0.5rem, 2vw, 1.5rem); }
.v2-intro .v2-lede { max-width: 42rem; }
.v2-intro .v2-pill { margin-top: 1.75rem; }
.v2-intro--post { max-width: 56rem; }
.v2-intro--post h1 { font-size: clamp(2rem, 1.3rem + 3.4vw, 4rem); }
.v2-intro .eyebrow { color: var(--fg-muted); }

.v2-hero__body {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(1.5rem, 6vw, 5rem);
  padding-block: clamp(2rem, 6vw, 4.5rem);
}
.v2-portrait { position: relative; width: min(100%, 24rem); aspect-ratio: 1; justify-self: end; }
/* Brand accent as an offset disc behind the photo. */
.v2-portrait::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--terra); transform: translate(-7%, 5%); }
.v2-portrait img { position: relative; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 12%; background: var(--verde); }
.v2-lede { max-width: 34rem; margin: 1.5rem 0 0; font-size: clamp(1.1rem, 1rem + 0.7vw, 1.5rem); line-height: 1.4; }
.v2-lede a { font-weight: 600; }

.v2-feature { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; padding: clamp(1.5rem, 4vw, 3.25rem); scroll-margin-top: 1rem; }
.v2-feature__logo svg { height: 1.9rem; width: auto; margin-bottom: 1.5rem; }
.v2-feature__lead { margin-bottom: 0.9rem; font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.6rem); font-weight: 600; line-height: 1.2; }
.v2-feature__text p:not(.v2-feature__lead) { max-width: 32rem; color: var(--fg-muted); }
.v2-feature .v2-pill { margin-top: 0.75rem; }

.v2-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin: 0; }
.v2-stats div { display: flex; flex-direction: column; justify-content: space-between; min-height: clamp(8rem, 16vw, 13rem); padding: 1rem; border-radius: calc(var(--r-card) * 0.7); background: var(--pine); color: var(--linen); }
.v2-stats div:nth-child(2) { background: var(--verde); }
.v2-stats dt { font-family: var(--font-title); font-size: clamp(2rem, 1.3rem + 2.4vw, 3.25rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.v2-stats dt { white-space: nowrap; }
.v2-stats dd { margin: 0.4rem 0 0; font-size: 0.85rem; line-height: 1.2; color: #CED6D5; overflow-wrap: normal; }
@media (prefers-color-scheme: dark) {
  .v2-stats div { background: var(--pine-deeper); }
}

/* --------------------------------------------------------- what to do here */

.v2-help { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2.5rem); align-items: start; }
.v2-help__col { display: grid; gap: clamp(1rem, 3vw, 2.5rem); }
.v2-help .v2-h { padding-bottom: clamp(1rem, 4vw, 3rem); }
.v2-tile { padding: clamp(1.5rem, 3.5vw, 2.75rem); transition: transform 0.2s ease; }
.v2-tile:hover { transform: translateY(-4px); }
.v2-icon { width: 3.25rem; height: 3.25rem; margin-bottom: 1.5rem; color: var(--terra); }
.v2-tile h3, .v2-post h3 { margin-bottom: 0.75rem; font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem); }
.v2-tile p, .v2-post p { max-width: 26rem; color: var(--fg-muted); }

/* ------------------------------------------------------------------ videos */

.v2-row-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(1.5rem, 4vw, 2.75rem); }
.v2-arrows { display: flex; gap: 0.5rem; }
.v2-arrows button { width: 3rem; height: 3rem; border: 0; border-radius: 50%; background: var(--terra); color: var(--linen); font-size: 1.2rem; line-height: 1; cursor: pointer; transition: transform 0.15s ease; }
.v2-arrows button:hover { transform: scale(1.08); }

.v2-scroller {
  /* Full-bleed: the row starts at the screen edge, not under the heading. */
  --inset: max(var(--edge), env(safe-area-inset-left));
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(82vw, 25rem);
  gap: clamp(0.75rem, 2vw, 1.25rem);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding: 0.25rem var(--inset) 1rem;
  scroll-padding-inline: var(--inset);
  scrollbar-width: none;
}
.v2-scroller::-webkit-scrollbar { display: none; }
.v2-video { scroll-snap-align: start; padding: 0.75rem 0.75rem 1.25rem; }
.v2-video .video__text { padding: 1rem 0.5rem 0; }
.v2-video h2, .v2-video h3 { font-size: 1.25rem; line-height: 1.08; }
.video h2 a, .video h3 a { text-decoration: none; }
.video h2 a:hover, .video h3 a:hover { text-decoration: underline; }
.v2-video--all { display: grid; place-items: center; min-height: 12rem; font-size: 1.1rem; }

/* ------------------------------------------------------------------- about */

.v2-about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 5rem); align-items: center; padding-block: var(--pad); }
.v2-about .v2-h { margin-bottom: 1.75rem; }
.v2-about__text p { max-width: 32rem; }
.v2-about__photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(0.6rem, 1.5vw, 1rem); }
.v2-about__photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-card); }
.v2-about__photos img:last-child { margin-top: 18%; }
.v2-about__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; padding-top: clamp(0.5rem, 2vw, 1.5rem); }

/* -------------------------------------------------------------------- blog */

.v2-posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: clamp(1rem, 2.5vw, 1.75rem); }
.v2-post { display: flex; flex-direction: column; padding: clamp(1.5rem, 3vw, 2.25rem); transition: transform 0.2s ease; }
.v2-post:hover { transform: translateY(-4px); }
.v2-post .eyebrow { color: var(--fg-muted); }
.v2-post h3 { font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem); }
.v2-post p { flex: 1; }

/* ------------------------------------------------------- grids and listings */

.v2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: clamp(1rem, 2.5vw, 1.75rem); }
.v2-scroller--tall { grid-auto-columns: clamp(9.5rem, 42vw, 15rem); }
.v2-post h2 { margin-bottom: 0.75rem; font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem); line-height: 1.08; }

.v2-tool { padding: 0.75rem 0.75rem 1.5rem; }
.v2-tool img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: calc(var(--r-card) * 0.7); }
.v2-tool h3 { margin: 1.25rem 0.5rem 0.6rem; font-size: 1.35rem; }
.v2-tool p { margin: 0 0.5rem; color: var(--fg-muted); }

.v2-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: clamp(1rem, 2.5vw, 1.75rem); }
.v2-app { display: grid; grid-template-columns: 3.75rem minmax(0, 1fr); gap: 1.25rem; padding: clamp(1.25rem, 3vw, 1.75rem); transition: transform 0.2s ease; }
.v2-app:hover { transform: translateY(-4px); }
.v2-app img { width: 3.75rem; height: 3.75rem; border-radius: 22%; }
.v2-app h3 { margin-bottom: 0.5rem; font-size: 1.35rem; }
.v2-app p { margin: 0; color: var(--fg-muted); }

/* ------------------------------------------------------------------ topics */

.v2-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1.75rem; }
.v2-chips__label { margin-right: 0.35rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
.v2-chip { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0.4rem 1rem; border: 1.5px solid var(--line); border-radius: 999px; font-size: 0.875rem; font-weight: 600; text-decoration: none; transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease; }
.v2-chip:hover { border-color: var(--fg); }
.v2-chip[aria-current="page"] { border-color: var(--fg); background: var(--fg); color: var(--bg); }
.v2-intro .v2-chips .v2-pill { margin-top: 0; }
.v2-intro--post .v2-chips { margin-top: 1.25rem; }

.v2-related { padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.v2-related .v2-h { margin-bottom: 1.5rem; font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); }
.v2-related__list { display: grid; gap: 0.75rem; }
.v2-related__item { padding: 1.25rem 1.5rem; background: var(--panel); border-color: transparent; font-family: var(--font-title); font-size: 1.15rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; text-transform: uppercase; transition: transform 0.2s ease; }
.v2-related__item:hover { transform: translateX(0.3rem); }
.v2-related__item .eyebrow { display: block; margin-bottom: 0.4rem; font-family: var(--font-body); color: var(--fg-muted); }

/* ---------------------------------------------------------------- articles */

.prose { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.prose img { border-radius: var(--r-card); }
.post-nav { border-top: 0; padding-top: 0; }
.post-nav .v2-card { padding: 1.5rem; }

/* ------------------------------------------------------------------ footer */

.site-footer .wrap { max-width: none; padding-inline: var(--pad); }
.v2 .site-footer {
  max-width: 88rem;
  margin: 0 max(var(--edge), env(safe-area-inset-left)) max(var(--edge), env(safe-area-inset-bottom)) max(var(--edge), env(safe-area-inset-right));
  border-radius: var(--r-panel);
}
@media (min-width: 90rem) { .v2 .site-footer { margin-inline: auto; } }

/* -------------------------------------------------------------- responsive */

@media (max-width: 56rem) {
  .v2-feature, .v2-about { grid-template-columns: minmax(0, 1fr); }
  .v2-about__photos { order: -1; max-width: 30rem; }
  .v2-about__actions { justify-content: flex-start; }
}
@media (max-width: 44rem) {
  .v2-hero__body { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .v2-portrait { width: min(62%, 15rem); justify-self: start; margin-left: 5%; }
  .v2-help { grid-template-columns: minmax(0, 1fr); }
  .v2-stats { gap: 0.4rem; }
  .v2-stats div { min-height: 6.5rem; padding: 0.75rem 0.6rem; }
  .v2-stats dt { font-size: clamp(1.5rem, 7vw, 2rem); }
  .v2-stats dd { font-size: 0.72rem; }
}
@media (max-width: 40rem) {
  .v2-arrows { display: none; }
}
@media (max-width: 22rem) {
  .v2-stats { grid-template-columns: minmax(0, 1fr); }
  .v2-stats div { min-height: 0; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 0.75rem; }
}
