:root {
  color-scheme: light;
  --accent: #1c6cec;
  --accent-dark: #10479e;
  --ink: #111318;
  --muted: #596476;
  --line: #d8dee8;
  --surface: #ffffff;
  --focus: #ffc048;
  --image-surface: #f1f5fb;
  --control-surface: #ffffff;
  --control-hover: #f2f5fa;
  --control-shadow: rgba(16, 71, 158, 0.14);
  --content-width: 1240px;
  --radius: 8px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: #78aaff;
  --accent-dark: #abc8ff;
  --ink: #f4f6f8;
  --muted: #aeb7c4;
  --line: #343a44;
  --surface: #111316;
  --focus: #ffd166;
  --image-surface: #20252c;
  --control-surface: #1b1f25;
  --control-hover: #272d36;
  --control-shadow: rgba(0, 0, 0, 0.34);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --accent: #78aaff;
    --accent-dark: #abc8ff;
    --ink: #f4f6f8;
    --muted: #aeb7c4;
    --line: #343a44;
    --surface: #111316;
    --focus: #ffd166;
    --image-surface: #20252c;
    --control-surface: #1b1f25;
    --control-hover: #272d36;
    --control-shadow: rgba(0, 0, 0, 0.34);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--surface);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.theme-toggle {
  position: fixed;
  z-index: 10;
  top: clamp(1rem, 2vw, 1.5rem);
  right: clamp(1rem, 2vw, 1.5rem);
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--control-surface);
  box-shadow: 0 5px 18px var(--control-shadow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  background: var(--control-hover);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.theme-icon {
  width: 20px;
  height: 20px;
}

.theme-icon-sun {
  display: none;
}

.theme-toggle[data-active-theme="dark"] .theme-icon-moon {
  display: none;
}

.theme-toggle[data-active-theme="dark"] .theme-icon-sun {
  display: block;
}

.page-shell {
  display: grid;
  width: min(var(--content-width), calc(100% - 64px));
  min-height: 100vh;
  grid-template-columns: minmax(300px, 0.82fr) minmax(480px, 1.18fr);
  gap: clamp(3rem, 6vw, 6.5rem);
  margin-inline: auto;
  padding: clamp(4.75rem, 7vh, 5rem) 0;
}

.introduction {
  align-self: start;
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: var(--radius);
  object-fit: cover;
  object-position: 25% center;
  background: var(--image-surface);
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 9.5em;
  margin-top: clamp(1.8rem, 4vw, 2.8rem);
  font-size: clamp(2.55rem, 4.1vw, 4.15rem);
  line-height: 1.02;
}

h2 {
  font-size: clamp(1.85rem, 2.7vw, 2.65rem);
  line-height: 1.08;
}

.about-copy {
  max-width: 38rem;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.link-column {
  min-width: 0;
  padding-left: clamp(2.2rem, 4.5vw, 5rem);
  border-left: 1px solid var(--line);
}

.project-list {
  margin-top: 1.45rem;
  border-top: 1px solid var(--line);
}

.project-link {
  display: grid;
  min-height: 112px;
  grid-template-columns: 72px minmax(0, 1fr) 26px;
  gap: 1.25rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.project-icon {
  display: block;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: var(--radius);
  object-fit: cover;
  background: transparent;
}

.project-icon-channel {
  border-radius: 50%;
}

.project-copy {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.project-copy strong {
  color: var(--accent);
  font-size: 1.22rem;
  line-height: 1.25;
}

.project-copy span {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.project-copy .project-meta {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.3;
}

.project-arrow {
  color: var(--accent);
  font-size: 1.65rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.project-link:hover .project-copy strong,
.project-link:focus-visible .project-copy strong {
  color: var(--accent-dark);
}

.project-link:hover .project-arrow,
.project-link:focus-visible .project-arrow {
  transform: translateX(5px);
}

.social-section {
  margin-top: clamp(2.5rem, 5vw, 4.25rem);
}

.social-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2.5rem;
  margin-top: 1rem;
}

.social-list a {
  display: grid;
  grid-template-columns: minmax(6.25rem, 0.62fr) minmax(0, 1.38fr);
  gap: 0.65rem;
  align-items: baseline;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}

.social-list span {
  font-weight: 750;
}

.social-list strong {
  min-width: 0;
  color: var(--accent);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.social-list a:hover strong,
.social-list a:focus-visible strong {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

@media (min-width: 1500px) {
  :root {
    --content-width: 1500px;
  }

  .page-shell {
    grid-template-columns: minmax(730px, 1.08fr) minmax(600px, 0.92fr);
    gap: clamp(4rem, 5vw, 5.5rem);
  }

  h1 {
    max-width: none;
    font-size: 2.9rem;
    white-space: nowrap;
  }

  .link-column {
    padding-left: clamp(2.2rem, 3vw, 3.5rem);
  }

  .social-list {
    column-gap: 1.5rem;
  }

  .social-list a {
    gap: 0.45rem;
  }
}

@media (max-width: 940px) {
  .page-shell {
    width: min(720px, calc(100% - 40px));
    grid-template-columns: 1fr;
    gap: 3.5rem;
    padding: 4.75rem 0 4rem;
  }

  .portrait {
    aspect-ratio: 4 / 3;
  }

  h1 {
    max-width: 12em;
  }

  .link-column {
    padding: 3.5rem 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 32px, 520px);
    gap: 2.75rem;
    padding-top: 4.75rem;
  }

  .portrait {
    aspect-ratio: 1;
  }

  h1 {
    margin-top: 1.6rem;
    font-size: 2.6rem;
  }

  h2 {
    font-size: 2rem;
  }

  .about-copy {
    font-size: 1rem;
  }

  .link-column {
    padding-top: 2.75rem;
  }

  .project-link {
    min-height: 0;
    grid-template-columns: 60px minmax(0, 1fr) 20px;
    gap: 0.85rem;
    padding: 1rem 0;
  }

  .project-icon {
    width: 60px;
    height: 60px;
  }

  .project-copy strong {
    font-size: 1.06rem;
  }

  .project-copy span {
    font-size: 0.9rem;
  }

  .project-arrow {
    font-size: 1.3rem;
  }

  .social-list {
    grid-template-columns: 1fr;
  }

  .social-list a {
    grid-template-columns: minmax(7.25rem, 0.72fr) minmax(0, 1.28fr);
    column-gap: 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-arrow {
    transition: none;
  }
}
