:root {
  --color-background: #f1f1ed;
  --color-text: #111111;
  --color-accent: #1457ff;
  --color-muted: #6f706d;
  --color-line: #c9c9c4;
  --color-white: #ffffff;
  --font-display: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: Inter, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --page-max: 1560px;
  --page-padding: clamp(1rem, 2.4vw, 2rem);
  --header-offset: 4.5rem;
  --line-thin: 1px;
  --transition-fast: 180ms ease;
  --transition-medium: 260ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-body);
  background: var(--color-background);
  min-width: 320px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 clamp(1rem, 11vw, 12rem);
  width: 1px;
  background: rgba(20, 87, 255, 0.18);
  pointer-events: none;
  z-index: 0;
}

body.js-ready .site-shell[hidden] {
  display: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 0.18em;
}

button,
a {
  min-height: 44px;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--page-padding);
  top: 0.5rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--color-accent);
  color: var(--color-white);
  transform: translateY(-140%);
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: translateY(0);
}

.layout-grid {
  width: min(calc(100% - (var(--page-padding) * 2)), var(--page-max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 1rem;
  position: relative;
}

.layout-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc((100% / 12) - 1px),
    rgba(201, 201, 196, 0.35) calc((100% / 12) - 1px),
    rgba(201, 201, 196, 0.35) calc(100% / 12)
  );
  pointer-events: none;
  z-index: 0;
}

.layout-grid > * {
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.65rem 0;
  background: rgba(241, 241, 237, 0.94);
  border-bottom: 1px solid rgba(201, 201, 196, 0.9);
}

.site-header__inner {
  align-items: center;
}

.site-name {
  grid-column: 1 / span 3;
  font-family: var(--font-display);
  font-size: clamp(0.98rem, 0.7vw + 0.78rem, 1.18rem);
  line-height: 1;
  text-decoration: none;
}

.site-nav {
  grid-column: 6 / span 5;
  display: flex;
  justify-content: flex-end;
  gap: clamp(0.7rem, 1vw, 1.25rem);
  font-size: 0.88rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  color: var(--color-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--color-text);
}

.language-switch {
  grid-column: 11 / span 2;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.language-button {
  border: 0;
  background: transparent;
  padding: 0.25rem 0.2rem;
  color: var(--color-muted);
  cursor: pointer;
}

.language-button.is-active {
  color: var(--color-accent);
}

.menu-toggle {
  display: none;
  grid-column: 9 / span 2;
  justify-self: end;
  border: 1px solid var(--color-line);
  background: transparent;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
}

.hero,
.content-section,
.signal-band,
.contact-section,
.site-footer {
  position: relative;
}

.hero {
  min-height: min(74vh, 40rem);
  display: flex;
  align-items: center;
}

.hero__grid {
  padding: clamp(2.5rem, 5vw, 4.25rem) 0 2.25rem;
}

.hero__portrait {
  grid-column: 11 / 13;
  grid-row: 1 / span 2;
  align-self: start;
  justify-self: start;
  width: clamp(140px, 13vw, 190px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  margin-top: 0.25rem;
}

.hero__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.achievement-number,
.site-footer__meta,
.site-footer__year {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.hero__title {
  grid-column: 2 / 11;
  margin: 0;
  max-width: 1200px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.hero__title strong {
  display: inline;
  font-weight: inherit;
}

.hero__subtitle {
  grid-column: 2 / 10;
  margin: 1rem 0 0;
  max-width: 42rem;
  font-size: clamp(0.96rem, 1vw, 1.08rem);
  line-height: 1.5;
  color: var(--color-muted);
}

.hero__link {
  grid-column: 2 / 10;
  align-self: start;
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  color: var(--color-accent);
  text-decoration: none;
  font-size: 0.92rem;
}

.hero__link::after {
  content: "";
  width: 1.5rem;
  height: 1px;
  margin-left: 0.55rem;
  background: currentColor;
}

.content-section__grid,
.contact-section__grid {
  row-gap: 0.9rem;
}

.section-title {
  grid-column: 2 / span 4;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 1.8vw, 2rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.content-section {
  padding: 3rem 0;
}

.prose,
.services-list,
.achievement-list {
  grid-column: 2 / span 8;
}

.prose p,
.services-list p,
.achievement-content p {
  margin: 0;
  max-width: 50rem;
  font-size: clamp(1rem, 1.02vw, 1.1rem);
  line-height: 1.62;
  text-wrap: normal;
  overflow-wrap: anywhere;
}

.signal-band {
  padding: 0.7rem 0 0.8rem;
  background: var(--color-accent);
  color: var(--color-white);
}

.signal-band__text {
  grid-column: 2 / span 10;
  margin: 0;
  max-width: 720px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.services-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--color-line);
}

.services-list--more {
  overflow: hidden;
}

.service-item {
  display: grid;
  grid-template-columns: minmax(3.2rem, 4rem) minmax(0, 1fr);
  gap: 0.5rem 1rem;
  align-items: start;
  padding: 0.95rem 0 1.05rem;
  border-bottom: 1px solid var(--color-line);
}

.service-item__number {
  grid-column: 1;
  grid-row: 1 / span 2;
  font-family: var(--font-mono);
  color: var(--color-accent);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding-top: 0.2rem;
}

.service-item__title {
  grid-column: 2;
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 1.4vw, 1.32rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.service-item p {
  grid-column: 2;
}

body.js-ready .services-list--more[hidden] {
  display: block;
  height: 0;
  border-top-color: transparent;
}

.more-services-toggle {
  grid-column: 2 / span 8;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border: 0;
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.more-services-toggle:hover,
.more-services-toggle:focus-visible {
  color: var(--color-accent);
}

.more-services-toggle__icon {
  flex-shrink: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  font-weight: 300;
}

.achievement-list {
  border-top: 1px solid var(--color-line);
  overflow: hidden;
}

.achievement-item {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  padding: 1.2rem 0 1.25rem;
  border-bottom: 1px solid var(--color-line);
}

.achievement-content {
  max-width: 850px;
}

.achievement-content h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.1vw, 1.95rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

body.js-ready .achievement-list[hidden] {
  display: block;
  height: 0;
  border-top-color: transparent;
}

.achievements-toggle {
  grid-column: 2 / span 8;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0;
  border: 0;
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.achievements-toggle:hover,
.achievements-toggle:focus-visible {
  color: var(--color-accent);
}

.achievements-toggle__label {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 1.8vw, 2rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.achievements-toggle__icon {
  flex-shrink: 0;
  font-size: clamp(2.4rem, 4.2vw, 4rem);
  line-height: 1;
  font-weight: 300;
}

.contact-section {
  padding: 3rem 0 3.5rem;
}

.contact-title {
  grid-column: 2 / span 8;
  margin: 0;
  max-width: 36rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 2.4vw, 2.35rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.contact-actions {
  grid-column: 9 / span 3;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-self: end;
}

.contact-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-line);
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.contact-action::after {
  content: "↗";
  color: var(--color-accent);
}

.contact-action[data-cv]::after {
  content: "↓";
}

.contact-action:hover,
.contact-action:focus-visible {
  border-color: var(--color-accent);
}

.cv-note {
  grid-column: 9 / span 3;
  margin: 0.2rem 0 0;
  min-height: 1.5rem;
  color: var(--color-muted);
}

.site-footer {
  padding: 1rem 0 1.4rem;
  border-top: 1px solid var(--color-line);
}

.site-footer__grid {
  align-items: end;
}

.site-footer__name,
.site-footer__role {
  margin: 0;
}

.site-footer__name {
  grid-column: 1 / span 3;
  font-family: var(--font-display);
}

.site-footer__role {
  margin-top: 0.2rem;
  color: var(--color-muted);
}

.site-footer__meta {
  grid-column: 8 / span 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  margin: 0;
}

.site-footer__dot {
  width: 0.2rem;
  height: 0.2rem;
  border-radius: 50%;
  background: currentColor;
}

.site-footer__year {
  grid-column: 11 / span 2;
  justify-self: end;
  margin: 0;
}

.reveal {
  opacity: 1;
  transform: none;
}

body.js-ready .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 480ms ease, transform 480ms ease;
}

body.js-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1024px) {
  .site-nav {
    grid-column: 5 / span 6;
  }

  .hero__title,
  .hero__subtitle,
  .prose,
  .services-list,
  .more-services-toggle,
  .achievement-list,
  .achievements-toggle,
  .contact-title {
    grid-column: 2 / span 10;
  }

  .hero__link,
  .contact-actions,
  .cv-note {
    grid-column: 2 / span 5;
  }

  .hero__portrait {
    grid-column: 10 / span 2;
    width: clamp(120px, 14vw, 140px);
  }

  .signal-band__text {
    grid-column: 2 / span 10;
  }
}

@media (max-width: 820px) {
  body::before {
    left: auto;
    right: var(--page-padding);
  }

  .layout-grid {
    gap: 0 0.75rem;
  }

  .site-name {
    grid-column: 1 / span 6;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
  }

  .language-switch {
    grid-column: 9 / span 2;
  }

  .site-nav {
    grid-column: 1 / -1;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-line);
  }

  .site-header.is-menu-open .site-nav {
    display: flex;
  }

  .hero__title,
  .hero__subtitle,
  .hero__link,
  .hero__portrait,
  .section-title,
  .prose,
  .services-list,
  .more-services-toggle,
  .achievement-list,
  .achievements-toggle,
  .contact-title,
  .contact-actions,
  .cv-note,
  .signal-band__text,
  .site-footer__meta,
  .site-footer__year {
    grid-column: 2 / -1;
  }

  .achievement-item {
    grid-template-columns: 3rem minmax(0, 1fr);
    gap: 1rem;
  }

  .hero__portrait {
    grid-column: 2 / span 2;
    grid-row: auto;
    align-self: start;
    width: clamp(120px, 18vw, 170px);
    margin-bottom: 0.5rem;
  }

  .site-footer__grid {
    row-gap: 0.75rem;
  }
}

@media (max-width: 540px) {
  .layout-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .layout-grid::before {
    background-image: repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc((100% / 4) - 1px),
      rgba(201, 201, 196, 0.35) calc((100% / 4) - 1px),
      rgba(201, 201, 196, 0.35) calc(100% / 4)
    );
  }

  .site-name {
    grid-column: 1 / span 2;
    font-size: 1rem;
  }

  .menu-toggle {
    grid-column: 3 / span 1;
    width: 100%;
    padding-inline: 0.4rem;
  }

  .language-switch {
    grid-column: 4 / span 1;
  }

  .hero__title,
  .hero__subtitle,
  .hero__link,
  .hero__portrait,
  .section-title,
  .prose,
  .services-list,
  .more-services-toggle,
  .achievement-list,
  .achievements-toggle,
  .contact-title,
  .contact-actions,
  .cv-note,
  .signal-band__text,
  .site-footer__name,
  .site-footer__meta,
  .site-footer__year {
    grid-column: 1 / -1;
  }

  .hero {
    min-height: auto;
  }

  .hero__grid {
    padding-top: 2.25rem;
    padding-bottom: 2rem;
  }

  .hero__title {
    max-width: 100%;
    font-size: clamp(2rem, 9.5vw, 3.15rem);
  }

  .hero__portrait {
    width: clamp(96px, 28vw, 120px);
    margin-bottom: 0;
  }

  .hero__subtitle,
  .prose p,
  .services-list p,
  .achievement-content p {
    font-size: 1rem;
  }

  .signal-band__text,
  .contact-title {
    max-width: 100%;
  }

  .service-item {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .service-item__number,
  .service-item__title,
  .service-item p {
    grid-column: 1;
  }

  .service-item__number {
    grid-row: auto;
    padding-top: 0;
  }

  .contact-actions {
    gap: 0.7rem;
  }

  .achievement-item {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .achievement-content {
    max-width: 100%;
  }

  .site-footer__meta {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .site-footer__year {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  body.js-ready .reveal {
    opacity: 1;
    transform: none;
  }
}
