* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--page-background); }
body {
  margin: 0;
  color: var(--text-primary);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
a { color: var(--link); text-underline-offset: 0.25em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--link); outline-offset: 5px; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: 1rem; padding: 0.75rem 1rem; background: var(--surface); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.page { width: min(100% - 6rem, 80rem); margin-inline: auto; padding-block: 3rem; }
.identity { display: flex; align-items: baseline; gap: 1rem; margin: 0; font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.2; }
.identity-mark { display: inline-block; flex: 0 0 0.75rem; height: 0.75rem; background: var(--accent); }
.opening { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 4rem; align-items: center; }
h1 { color: var(--accent); max-width: 16ch; margin: 0; font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 550; letter-spacing: -0.045em; line-height: 1.08; text-wrap: balance; }
.opening h1:only-child { grid-column: 1 / -1; }
.intro-details { min-width: 0; }
.summary { max-width: 43ch; margin: 0; font-size: 1.25rem; line-height: 1.65; color: var(--text-secondary); white-space: pre-line; }
.contact { margin-top: 2rem; }
.contact:only-child { margin-top: 0; }
.contact-action { display: inline-flex; align-items: center; justify-content: space-between; gap: 2rem; max-width: 100%; padding: 0.875rem 1.25rem; border: 1px solid var(--accent); border-radius: 3px; background: var(--accent); color: var(--accent-contrast); font-weight: 600; text-decoration: none; }
.contact-action:hover { background: var(--accent); border-color: var(--accent); text-decoration: underline; }
.contact-action span { flex-shrink: 0; }
.email-address { margin: 0.75rem 0 0; color: var(--text-secondary); font-size: 0.875rem; }
.services { display: grid; gap: 1.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.section-label { margin: 0; color: var(--text-secondary); font-size: 1.125rem; font-weight: 600; }
.service-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 3rem; min-width: 0; }
.service { padding-top: 1.25rem; border-top: 1px solid var(--border); }
.service h3 { color: var(--link); margin: 0; font-size: 1.5rem; font-weight: 550; letter-spacing: -0.02em; line-height: 1.3; }
.service p { max-width: 52ch; margin: 0.75rem 0 0; color: var(--text-secondary); white-space: pre-line; }
.about-section, .contact-section { display: grid; gap: 1.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.about-text { max-width: 65ch; margin: 0; color: var(--text-secondary); white-space: pre-line; }
.contact-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 3rem; margin: 0; }
.contact-details dt { color: var(--text-secondary); font-size: .875rem; font-weight: 600; }
.contact-details dd { margin: .5rem 0 0; white-space: pre-line; }
.contact-details a { display: inline-block; padding-block: .25rem; }
.custom-contact-details { padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* Below 60rem, stacking preserves useful line lengths for both opening columns. */
@media (width <= 60rem) {
  .opening { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}

/* At 44rem, services stack to preserve a comfortable reading measure. */
@media (width <= 44rem) {
  .page { width: calc(100% - 3rem); padding-block: 2rem; }
  .identity { gap: 0.75rem; }
  h1 { font-size: clamp(2.5rem, 8vw, 3.5rem); }
  .opening { gap: 1.5rem; }
  .summary { font-size: 1.125rem; }
  .services { padding-top: 1.5rem; }
  .service-list { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .contact-details { grid-template-columns: minmax(0, 1fr); }
  .about-section, .contact-section { padding-top: 1.5rem; }
}

.identity-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.theme-switcher { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; padding: 10px; border: 0; border-radius: 4px; background: transparent; color: var(--text-secondary); cursor: pointer; }
.theme-switcher:hover { color: var(--link); background: var(--surface); }
.theme-switcher:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.theme-switcher svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.theme-switcher[data-theme-mode="light"] [data-theme-icon="light"],
.theme-switcher[data-theme-mode="dark"] [data-theme-icon="dark"] { display: none; }

@media (width <= 44rem) { .identity-row { margin-bottom: 2rem; padding-bottom: 1.5rem; } }
