@font-face {
  font-family: Nunito;
  src: url("../assets/nunito.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
}
:root {
  color-scheme: light;
  --page: #f8f7f3;
  --heading: #181e28;
  --body: #444850;
  --strong: #1e2737;
  background: var(--page);
  color: var(--heading);
  font-family: Nunito, ui-rounded, system-ui, sans-serif;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 4.8vw, 72px);
  max-inline-size: 1370px;
  min-block-size: 100svh;
  margin-inline: auto;
  padding: clamp(38px, 6.5vh, 82px) clamp(28px, 3.7vw, 56px);
}
.portrait {
  position: relative;
  margin: 0;
  width: 100%;
  max-inline-size: 660px;
  background: #eae6df;
  overflow: hidden;
}
.portrait img {
  display: block;
  width: 100%;
  height: auto;
}
.intro {
  max-inline-size: 31rem;
  /* A restrained hierarchy: the greeting is 2.5× the unchanged reading size. */
  --bio-size: clamp(1.06rem, 1.46vw, 1.2rem);
  --greeting-ratio: 2.5;
}
h1 {
  margin: 0 0 26px;
  font-weight: 700;
  font-size: calc(var(--bio-size) * var(--greeting-ratio));
  line-height: 1.1;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.story {
  color: var(--body);
  font-size: var(--bio-size);
  line-height: 1.66;
}
.story p { margin: 0; }
.story p + p { margin-top: 1.12em; }
.story strong { color: var(--strong); font-weight: 600; }
@media (max-width: 799px) {
  :root {
    --phone-gutter: clamp(20px, 6vw, 28px);
    --phone-top: clamp(24px, 5.8vw, 28px);
  }
  .about {
    grid-template-columns: minmax(0, 1fr);
    min-block-size: auto;
    max-inline-size: 470px;
    gap: 32px;
    padding-top: max(var(--phone-top), env(safe-area-inset-top, 0px));
    padding-right: max(var(--phone-gutter), env(safe-area-inset-right, 0px));
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-left: max(var(--phone-gutter), env(safe-area-inset-left, 0px));
  }
  .intro { --bio-size: 1.08rem; --greeting-ratio: 2.4; }
  h1 { margin-bottom: 18px; }
  .story { line-height: 1.65; }
}

:root[data-background="porcelain"] { --page: #fdfdfc; }
:root[data-background="mist"] { --page: #edf2f8; }
:root[data-background="sand"] { --page: #f1e7dc; }
:root[data-background="sage"] { --page: #eaf0e8; }
:root[data-background="ink"] {
  color-scheme: dark;
  --page: #172336;
  --heading: #f8f7f3;
  --body: #d0d9e8;
  --strong: #ffffff;
}
/* The public layout is unchanged. These presets are applied only by the preview. */
:root[data-portrait="balanced"] .portrait { max-inline-size: 500px; }
:root[data-portrait="compact"] .portrait { max-inline-size: 370px; }

@media (min-width: 800px) {
  :root[data-portrait="full"] .about {
    max-inline-size: 1510px;
    grid-template-columns: minmax(0, 1.44fr) minmax(0, 1fr);
    padding: 16px clamp(16px, 2vw, 32px);
  }
  :root[data-portrait="full"] .portrait { max-inline-size: calc((100svh - 32px) * .8); justify-self: center; }
  :root[data-portrait="balanced"] .about {
    max-inline-size: 1170px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  :root[data-portrait="balanced"] .portrait, :root[data-portrait="compact"] .portrait { justify-self: end; }
  :root[data-portrait="compact"] .about {
    max-inline-size: 1010px;
    grid-template-columns: minmax(0, .82fr) minmax(0, 1fr);
  }
}
@media (max-width: 799px) {
  :root[data-portrait="full"] .portrait {
    max-inline-size: calc((100svh - 2 * var(--phone-top)) * .8);
    justify-self: center;
  }
  :root[data-portrait="balanced"] .portrait { max-inline-size: 400px; }
  :root[data-portrait="compact"] .portrait { width: 76vw; max-inline-size: 320px; }
  :root[data-portrait="balanced"] .portrait, :root[data-portrait="compact"] .portrait { justify-self: center; }
}
.preview-controls {
  display: flex;
  gap: 7px;
  position: fixed;
  z-index: 5;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  color-scheme: light;
  color: #172133;
}
.preview-controls[hidden] { display: none; }
.palette summary {
  width: max-content;
  margin-left: auto;
  padding: 10px 14px;
  border-radius: 22px;
  border: 1px solid #d9dde2;
  background: #fff;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 3px 12px #17213315;
}
.palette__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 9px);
  width: min(320px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid #d9dde2;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 32px #17213321;
}
.palette fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.palette legend { padding: 0; font-weight: 800; font-size: 15px; }
.palette__hint { color: #4d5665; font-size: 12px; margin: 3px 0 10px; }
.palette__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.palette label { position: relative; display: block; cursor: pointer; }
.palette input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.palette label span {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.15;
}
.palette input:checked + span { border-color: #36558e; background: #f0f4ff; font-weight: 800; }
.palette input:focus-visible + span, .palette summary:focus-visible { outline: 2px solid #36558e; outline-offset: 2px; }
.palette .swatch { width: 19px; height: 19px; border-radius: 50%; border: 1px solid #abb3c1; display: block; flex: none; }
.swatch.paper { background: #f8f7f3; }
.swatch.porcelain { background: #fdfdfc; }
.swatch.mist { background: #edf2f8; }
.swatch.sand { background: #f1e7dc; }
.swatch.sage { background: #eaf0e8; }
.swatch.ink { background: #172336; }

.portrait-options label span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 7px 9px;
}
.portrait-options b { font-size: 13px; }
.portrait-options small { color: #4d5665; font-size: 11px; font-weight: 550; line-height: 1.3; }

@media (max-width: 799px) {
  .preview-controls {
    right: max(var(--phone-gutter), env(safe-area-inset-right, 0px));
    left: max(var(--phone-gutter), env(safe-area-inset-left, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    justify-content: flex-end;
    pointer-events: none;
  }
  .preview-controls > details { pointer-events: auto; }
  .palette__panel { width: min(320px, 100%); }
}

@font-face { font-family: 'DM Sans'; src: url('../assets/dmsans.woff2') format('woff2'); font-style: normal; font-weight: 400 800; font-display: swap; }
@font-face { font-family: Manrope; src: url('../assets/manrope.woff2') format('woff2'); font-style: normal; font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Source Sans 3'; src: url('../assets/sourcesans3.woff2') format('woff2'); font-style: normal; font-weight: 400 800; font-display: swap; }
@font-face { font-family: Lora; src: url('../assets/lora.woff2') format('woff2'); font-style: normal; font-weight: 400 700; font-display: swap; }
:root[data-font="dmsans"] .intro, .font-options input[value="dmsans"] + span b { font-family: 'DM Sans', Nunito, sans-serif; }
:root[data-font="manrope"] .intro, .font-options input[value="manrope"] + span b { font-family: Manrope, Nunito, sans-serif; }
:root[data-font="sourcesans3"] .intro, .font-options input[value="sourcesans3"] + span b { font-family: 'Source Sans 3', Nunito, sans-serif; }
:root[data-font="lora"] h1, .font-options input[value="lora"] + span b { font-family: Lora, Georgia, serif; }
:root[data-font="lora"] h1 { font-weight: 600; letter-spacing: -.045em; }
.font-options label span { min-height: 54px; }
.font-options b { font-size: 15px; }
@media (max-width: 380px) {
  .preview-controls { gap: 5px; }
  .palette summary { padding-inline: 9px; font-size: 13px; }
}

/* Additional self-hosted professional font previews; type scale stays fixed. */
@font-face { font-family: 'Inter'; src: url('../assets/inter.woff2') format('woff2'); font-style: normal; font-weight: 400 800; font-display: swap; }
:root[data-font="inter"] .intro, .font-options input[value="inter"] + span b { font-family: 'Inter', Nunito, sans-serif; }
@font-face { font-family: 'IBM Plex Sans'; src: url('../assets/ibmplexsans.woff2') format('woff2'); font-style: normal; font-weight: 400 700; font-display: swap; }
:root[data-font="ibmplexsans"] .intro, .font-options input[value="ibmplexsans"] + span b { font-family: 'IBM Plex Sans', Nunito, sans-serif; }
.palette__panel--fonts { max-height: min(70svh, 520px); overflow-y: auto; overscroll-behavior: contain; }
:root[data-font="system"] .intro, .font-options input[value="system"] + span b { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

/* Open-font alternatives to Hodinkee's Portrait Light and Portrait Text Regular. */
@font-face { font-family: 'Cormorant Garamond'; src: url('../assets/cormorantgaramond.woff2') format('woff2'); font-style: normal; font-weight: 300 500; font-display: swap; }
@font-face { font-family: 'Source Serif 4'; src: url('../assets/sourceserif4.woff2') format('woff2'); font-style: normal; font-weight: 400 750; font-display: swap; }
:root[data-font="editorial"] h1,
.font-options input[value="editorial"] + span b {
  font-family: 'Cormorant Garamond', Georgia, serif;
}
/* Match the magazine's 52/17 desktop and 42/17 mobile hierarchy.
   Keep the bio's looser leading for multi-paragraph reading. */
:root[data-font="editorial"] h1 {
  font-size: 3.25rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.025em;
}
:root[data-font="editorial"] .story {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.0625rem;
}
@media (max-width: 799px) {
  :root[data-font="editorial"] h1 { font-size: 2.625rem; }
}

/* Refine the default without changing the comparison presets. */
:root:is(:not([data-font]), [data-font="nunito"]) .intro {
  --greeting-ratio: 2.75;
}
:root:is(:not([data-font]), [data-font="nunito"]) h1 {
  margin-bottom: 32px;
  font-weight: 625;
}
:root:is(:not([data-font]), [data-font="nunito"]) .story {
  font-size: clamp(1rem, 1.38vw, 1.0625rem);
  line-height: 1.6;
  max-inline-size: 29rem;
}
:root:is(:not([data-font]), [data-font="nunito"]) .story p + p {
  margin-top: 1.3em;
}
@media (max-width: 799px) {
  :root:is(:not([data-font]), [data-font="nunito"]) .intro { --greeting-ratio: 2.6; }
  :root:is(:not([data-font]), [data-font="nunito"]) h1 { margin-bottom: 23px; }
  :root:is(:not([data-font]), [data-font="nunito"]) .story { font-size: 1rem; line-height: 1.65; }
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0;
  margin-block-start: 22px;
  margin-inline-start: -6px;
}
.social-links a {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 44px;
  color: var(--body);
  text-decoration: none;
}
.social-links svg { width: 16px; height: 16px; }
.social-links a:hover { color: var(--heading); }
.social-links a:focus-visible {
  color: var(--heading);
  outline: 2px solid currentColor;
  outline-offset: -5px;
}

.social-links svg:not([data-icon-art="classic"]) { display: none; }
:root:is([data-icons="outline"], [data-icons="circles"]) .social-links svg[data-icon-art="classic"] { display: none; }
:root[data-icons="outline"] .social-links svg[data-icon-art="outline"],
:root[data-icons="circles"] .social-links svg[data-icon-art="circles"] {
  display: block;
  width: 21px;
  height: 21px;
}
:root[data-icons="circles"] .social-links a { position: relative; }
:root[data-icons="circles"] .social-links a::before {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 9%, transparent);
  pointer-events: none;
}
:root[data-icons="circles"] .social-links svg { position: relative; }
@media (max-width: 380px) {
  .preview-controls { flex-wrap: wrap; }
}

/* Alternate glyph sets, not background-only treatments. */
:root:is([data-icons="geometric"], [data-icons="solid"], [data-icons="monograms"]) .social-links svg[data-icon-art="classic"] { display: none; }
:root[data-icons="geometric"] .social-links svg[data-icon-art="geometric"],
:root[data-icons="solid"] .social-links svg[data-icon-art="solid"],
:root[data-icons="monograms"] .social-links svg[data-icon-art="monograms"] { display: block; width: 22px; height: 22px; }
.palette__panel--icons { max-height: min(70svh, 520px); overflow-y: auto; overscroll-behavior: contain; }
.icon-sample { display: flex; align-items: center; gap: 9px; height: 24px; color: #24334b; font-style: normal; }
.icon-sample svg { display: block; width: 19px; height: 19px; }
.palette__panel--icons label span { min-height: 96px; }

.icon-sample svg[data-icon-art="circles"] { padding: 2px; background: #24334b12; border-radius: 50%; }

/* 28px pointer targets keep the optical spacing of the preview.
   Touch gets 44px square targets with a 4px gap, including on hybrids. */
@media (any-pointer: coarse) {
  .social-links { gap: 4px; margin-inline-start: -14px; }
  .social-links a { width: 44px; }
}

.playground-link { display:inline-flex;align-items:center;gap:9px;margin-top:20px;min-height:44px;color:var(--body);font-size:.95rem;text-decoration:underline;text-underline-offset:5px;text-decoration-color:#bcbab4; }
.playground-link:hover {color:var(--heading);text-decoration-color:currentColor;}
.playground-link:focus-visible {outline:2px solid currentColor;outline-offset:5px;}

/* A compact route into work, play, and existing social profiles. */
/* Always-visible navigation and compact social icons. */
 .section-links {display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:22px;color:var(--body);font-size:.75rem;}
.section-links > a {display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;color:inherit;text-decoration:none;font-weight:500;}
.section-links > a > span {display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:27px;padding:0 9px;border:1px solid currentColor;border-radius:999px;line-height:1;}
.section-links > a:hover {color:var(--heading);}
.section-links .social-links {margin:0;flex-shrink:0;}
.section-links > a:focus-visible {outline:2px solid currentColor;outline-offset:2px;border-radius:6px;}

/* Reserve the classic scrollbar track across short and long routes. */
html {scrollbar-gutter:stable;}
