:root {
  --ink: #18231d;
  --body: #3d4740;
  --muted: #647067;
  --line: #e2e8e3;
  --surface: #fbfcfa;
  --surface-soft: #f4f7f4;
  --accent: #164d37;
  --icon: #245944;
  --tag: #edf2ee;
  --focus: #326b50;
  --soft: #f7f9f7;
}

*,*::before,*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

svg {
  display: block;
}

a {
  color: inherit;
}

a:focus-visible,summary:focus-visible,button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 8px;
}

.page-width {
  width: min(1120px,calc(100% - 76px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 14px;
  top: -65px;
  background: var(--ink);
  color: #fff;
  padding: 9px 14px;
  z-index: 1000;
  border-radius: 8px;
}

.skip-link:focus {
  top: 8px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 25;
  border-bottom: 1px solid rgba(226,232,227,.72);
  background: rgba(251,252,250,.91);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 47px;
  min-height: 61px;
}

.nav a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 530;
  color: #4c5750;
  transition: color .15s;
}

.nav a:hover {
  color: var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: 226px minmax(0,1fr);
  gap: 47px;
  align-items: start;
  padding-top: 60px;
  padding-bottom: 58px;
  scroll-margin-top: 95px;
}

.portrait {
  display: block;
  width: 226px;
  height: 226px;
  object-fit: cover;
  object-position: 50% 43%;
  border-radius: 17px;
  background: #e8eae8;
}

h1 {
  font-size: clamp(39px,4.8vw,53px);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -.046em;
  margin: 0 0 4px;
}

.role {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -.024em;
  font-weight: 400;
  margin: 25px 0 10px;
  color: #333d37;
}

.bio {
  max-width: 760px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--body);
  margin: 0;
}

section {
  scroll-margin-top: 94px;
}

.section-heading {
  font-size: 31px;
  line-height: 1.25;
  letter-spacing: -.037em;
  font-weight: 690;
  margin: 0;
}

.section-intro {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-intro.compact {
  margin-bottom: 22px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  border: 1px solid #dee6df;
  background: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 560;
  color: #4d5a50;
  cursor: pointer;
  transition: .16s ease;
}

.filter-chip:hover {
  border-color: #c8d6cc;
  color: var(--accent);
}

.filter-chip.is-active {
  background: #edf4ef;
  border-color: #c9daca;
  color: #184d37;
}

.projects {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.project-card {
  border: 1px solid #dfe7e0;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(34,53,39,.018);
  transition: border-color .17s ease,box-shadow .17s ease;
}

.project-card:hover {
  border-color: #d1ddd3;
  box-shadow: 0 6px 23px rgba(37,60,44,.042);
}

.project-card.is-hidden {
  display: none;
}

.project-body {
  display: grid;
  grid-template-columns: minmax(0,1.08fr) minmax(0,1fr);
  gap: 48px;
  padding: 28px 32px 28px;
}

.project-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.project-icon,.skill-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #edf4ef;
  color: var(--icon);
  border-radius: 12px;
  width: 47px;
  height: 47px;
}

.project-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.project-heading h3 {
  font-size: 22px;
  letter-spacing: -.027em;
  line-height: 1.25;
  font-weight: 680;
  margin: 1px 0 10px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.tags span {
  font-size: 11px;
  line-height: 1.3;
  font-weight: 540;
  color: #516055;
  background: var(--tag);
  border-radius: 50px;
  padding: 5px 11px;
  white-space: nowrap;
}

.project-overview>p {
  margin: 18px 0 0;
  font-size: 14.2px;
  line-height: 1.66;
  color: var(--body);
}

.project-value {
  color: #4c5950;
  font-weight: 470;
}

.project-implemented h4,.details-inner h4 {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 690;
  margin: 0 0 12px;
}

.project-implemented ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.project-implemented li {
  position: relative;
  padding-left: 19px;
  color: #3f4a41;
  font-size: 13.3px;
  line-height: 1.5;
}

.project-implemented li:before {
  content: "";
  position: absolute;
  top: .56em;
  left: 1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #417c5c;
}

.project-details {
  border-top: 1px solid #e9eeea;
}

.project-details>summary {
  list-style: none;
  cursor: pointer;
  background: #f7f9f7;
  padding: 15px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 590;
  color: #314939;
  transition: background .15s;
}

.project-details>summary::-webkit-details-marker {
  display: none;
}

.project-details>summary:hover {
  background: #eef4ef;
}

.chevron {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform .2s;
}

.project-details[open] .chevron {
  transform: rotate(180deg);
}

.details-inner {
  border-top: 1px solid #e6ede6;
  padding: 30px 32px 33px;
  color: #485249;
  font-size: 14px;
  background: #fdfefd;
}

.details-inner p {
  margin: 0 0 18px;
  line-height: 1.68;
}

.details-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 48px;
  margin-bottom: 6px;
}

.showcase-block {
  margin: 10px 0 22px;
  padding: 18px;
  border: 1px solid #e7ede8;
  border-radius: 16px;
  background: #fafcfb;
}

.muted-block {
  background: #f7faf7;
}

.inline-note {
  font-size: 12.5px;
  color: #667067;
  margin-top: 14px!important;
}

.workflow-scheme {
  display: grid;
  grid-template-columns: 1.55fr .95fr;
  gap: 16px;
  align-items: stretch;
}

.workflow-main,.workflow-side {
  display: grid;
  gap: 10px;
}

.workflow-main span,.workflow-side div,.process-strip span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid #dfe8e1;
  border-radius: 12px;
  background: #fff;
  min-height: 48px;
  padding: 10px 12px;
  font-size: 13px;
  color: #314139;
}

.workflow-main span {
  position: relative;
}

.workflow-main span:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  color: #91a297;
  font-size: 14px;
  background: var(--soft);
  padding-inline: 2px;
}

.process-strip {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
}

.meta-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.meta-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  padding: 10px 0;
  border-top: 1px solid #ecf0ed;
}

.meta-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.meta-row span {
  font-size: 12px;
  color: #738077;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.meta-row strong {
  font-size: 13.5px;
  line-height: 1.55;
  color: #243029;
  font-weight: 570;
}

.external-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 650;
  text-underline-offset: 4px;
  color: #1c5a3c;
  text-decoration: underline;
}

.external-link svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.phone-mockup {
  width: min(310px,100%);
  margin-top: 8px;
  background: #141915;
  border-radius: 32px;
  padding: 16px 12px 14px;
  box-shadow: 0 14px 32px rgba(20,25,21,.12);
}

.phone-top {
  width: 86px;
  height: 7px;
  border-radius: 999px;
  background: #2a312d;
  margin: 0 auto 12px;
}

.phone-screen {
  background: #f7faf7;
  border-radius: 23px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.screen-card {
  border: 1px solid #dbe5dc;
  background: #fff;
  border-radius: 16px;
  padding: 14px 12px;
  font-size: 13px;
  font-weight: 630;
  color: #223028;
  line-height: 1.35;
}

.screen-card span {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 420;
  color: #657167;
}

.screen-card.active {
  background: #eef5ef;
}

.desktop-mockup {
  border: 1px solid #dfe8e1;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.window-bar {
  display: flex;
  gap: 7px;
  padding: 12px 14px;
  border-bottom: 1px solid #ebf0ec;
  background: #f7faf7;
}

.window-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d5dfd7;
}

.window-content {
  display: grid;
  grid-template-columns: 126px 1fr;
  min-height: 245px;
}

.window-sidebar {
  background: #f8fbf8;
  border-right: 1px solid #ebf0ec;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.side-item {
  padding: 10px 11px;
  border-radius: 11px;
  font-size: 12.5px;
  color: #5b665d;
}

.side-item.active {
  background: #edf4ef;
  color: #204734;
  font-weight: 600;
}

.window-main {
  padding: 16px 18px 18px;
}

.mock-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px solid #edf1ee;
  font-size: 12.8px;
  color: #4b574e;
}

.mock-row strong {
  color: #26322b;
}

.mock-files {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.mock-files div {
  background: #f7faf7;
  border: 1px solid #e6ece7;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.6px;
  color: #455148;
}

.mock-footer-line {
  margin-top: 10px;
  padding: 10px 12px;
  background: #edf4ef;
  border-radius: 12px;
  font-size: 12.4px;
  color: #234734;
}

.skills-section {
  margin-top: 72px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 17px;
}

.skill-card {
  border: 1px solid #e0e7e1;
  background: #fff;
  border-radius: 15px;
  min-height: 136px;
  padding: 21px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.skill-icon {
  width: 43px;
  height: 43px;
  border-radius: 10px;
}

.skill-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skill-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.36;
  letter-spacing: -.01em;
  font-weight: 680;
}

.skill-card p {
  margin: 0;
  font-size: 12.8px;
  line-height: 1.57;
  color: var(--muted);
}

.contacts-section {
  margin-top: 72px;
  margin-bottom: 108px;
}

.contact-links {
  display: flex;
  align-items: center;
  gap: 34px;
  flex-wrap: wrap;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  color: #36443a;
}

.contact-links a:hover {
  color: #1b6845;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.contact-links svg {
  width: 20px;
  height: 20px;
}

.site-footer {
  color: #8b958e;
  padding-bottom: 26px;
  font-size: 12px;
}

@media (max-width:980px) {
  .page-width {
    width: min(100% - 50px,1120px);
  }

  .hero {
    gap: 35px;
    grid-template-columns: 190px minmax(0,1fr);
    padding-bottom: 50px;
  }

  .portrait {
    width: 190px;
    height: 190px;
  }

  .project-body {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 26px;
  }

  .project-details>summary,.details-inner {
    padding-left: 26px;
    padding-right: 26px;
  }

  .details-columns,.workflow-scheme {
    grid-template-columns: 1fr;
  }

  .workflow-main span:not(:last-child)::after {
    display: none;
  }

  .skills-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width:650px) {
  .page-width {
    width: calc(100% - 34px);
  }

  .nav {
    min-height: 56px;
    gap: 21px;
  }

  .nav a {
    font-size: 11.5px;
  }

  .hero {
    grid-template-columns: 116px minmax(0,1fr);
    gap: 16px;
    align-items: start;
    padding: 37px 0 42px;
  }

  .portrait {
    width: 116px;
    height: 128px;
    border-radius: 12px;
  }

  .hero-copy h1 {
    font-size: 32px;
    margin-top: 0;
    letter-spacing: -.045em;
  }

  .role {
    font-size: 16px;
    margin-bottom: 13px;
  }

  .bio {
    font-size: 13px;
    line-height: 1.61;
  }

  .project-body {
    gap: 23px;
    padding: 22px 20px 25px;
  }

  .project-heading h3 {
    font-size: 19px;
    margin-bottom: 10px;
  }

  .project-icon {
    width: 42px;
    height: 42px;
  }

  .project-icon svg {
    width: 24px;
    height: 24px;
  }

  .project-heading {
    gap: 12px;
  }

  .project-overview>p {
    font-size: 13.5px;
    margin-top: 16px;
  }

  .project-implemented h4 {
    margin-top: 0;
  }

  .project-implemented li {
    font-size: 13px;
  }

  .section-heading {
    font-size: 27px;
  }

  .section-intro.compact {
    margin-bottom: 18px;
  }

  .projects {
    gap: 18px;
  }

  .project-details>summary {
    padding: 14px 20px;
  }

  .details-inner {
    padding: 24px 20px;
  }

  .details-columns {
    gap: 0;
  }

  .meta-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .meta-row span {
    text-transform: none;
    letter-spacing: 0;
  }

  .showcase-block {
    padding: 16px;
  }

  .process-strip {
    grid-template-columns: 1fr;
  }

  .window-content {
    grid-template-columns: 1fr;
  }

  .window-sidebar {
    grid-template-columns: repeat(4,minmax(0,1fr));
    border-right: 0;
    border-bottom: 1px solid #ebf0ec;
  }

  .skills-section {
    margin-top: 58px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .skill-card {
    min-height: unset;
    padding: 18px;
  }

  .contacts-section {
    margin-top: 58px;
    margin-bottom: 91px;
  }

  .contact-links {
    gap: 22px;
  }

  .phone-mockup {
    width: 100%;
  }
}

@media (max-width:410px) {
  .nav {
    gap: 14px;
  }

  .nav a {
    font-size: 10.6px;
  }

  .hero {
    grid-template-columns: 96px minmax(0,1fr);
    gap: 14px;
  }

  .portrait {
    width: 96px;
    height: 112px;
  }

  .hero-copy h1 {
    font-size: 29px;
  }

  .role {
    font-size: 14.7px;
  }

  .bio {
    font-size: 12.5px;
  }
}

@media (prefers-reduced-motion:reduce) {
  html {
    scroll-behavior: auto;
  }

  *,*::before,*::after {
    transition: none!important;
  }
}

/* Публичные ссылки на проект остаются видимыми при свернутых подробностях. */

.project-links {
  margin-top: 14px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.project-links .external-link {
  margin-top: 0;
}

/* Compact project headings: icon on the title baseline, tags directly under the name. */

.project-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.project-heading-content {
  min-width: 0;
  flex: 1;
}

.project-heading h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}

.project-heading .project-icon {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  border-radius: 0;
  background: none;
  color: var(--icon);
}

.project-heading .project-icon svg {
  width: 23px;
  height: 23px;
}

.project-heading .tags {
  margin-left: 33px;
}

.project-heading .project-links {
  margin-top: 3px;
  flex: 0 0 auto;
}

.project-heading .project-links .external-link {
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width:650px) {
  .project-heading {
    flex-wrap: wrap;
    gap: 9px;
  }

  .project-heading .project-icon,.project-heading .project-icon svg {
    width: 21px;
    height: 21px;
    flex-basis: 21px;
  }

  .project-heading h3 {
    gap: 8px;
  }

  .project-heading .tags {
    margin-left: 29px;
  }

  .project-heading .project-links {
    margin: 0 0 0 29px;
  }
}

/* Project gallery: two project cards per row, without extra visual filler. */

.projects {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 20px;
  align-items: stretch;
}

.project-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.project-body {
  display: grid;
  grid-template-columns: minmax(0,1.14fr) minmax(0,.86fr);
  grid-template-rows: auto auto 1fr;
  column-gap: 16px;
  row-gap: 12px;
  padding: 24px 23px 25px;
  flex: 1;
  align-items: start;
}

.project-heading {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  min-height: 29px;
}

.project-heading-content {
  min-width: 0;
  flex: 1;
}

.project-heading h3 {
  margin: 0;
  line-height: 1.28;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -.027em;
}

.project-heading .project-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  background: none;
  border: 0;
  border-radius: 0;
}

.project-heading .project-icon svg {
  width: 24px;
  height: 24px;
}

.project-heading .project-links {
  margin: 1px 0 0;
  flex: 0 0 auto;
}

.project-heading .project-links .external-link {
  font-size: 12px;
  line-height: 24px;
  font-weight: 650;
  color: #155b3e;
  gap: 4px;
}

.project-heading .project-links .external-link svg {
  width: 13px;
  height: 13px;
}

.project-tags {
  grid-column: 1;
  grid-row: 2;
  margin: 0 0 0 34px !important;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 28px;
  align-self: start;
}

.project-tags span {
  font-size: 10.5px;
  padding: 5px 10px;
  white-space: nowrap;
}

.project-info {
  grid-column: 1;
  grid-row: 3;
  min-width: 0;
}

.project-overview>p {
  font-size: 13.2px;
  line-height: 1.58;
  margin: 0 0 13px;
  color: #435047;
}

.project-overview>p.project-value {
  margin-top: 13px;
}

.project-implemented {
  margin-top: 19px;
}

.project-implemented h4 {
  font-size: 13px;
  margin: 0 0 8px;
}

.project-implemented ul {
  gap: 7px;
}

.project-implemented li {
  font-size: 12.6px;
  line-height: 1.5;
  padding-left: 16px;
}

.project-implemented li:before {
  top: .52em;
  width: 5px;
  height: 5px;
}

.project-details {
  margin-top: auto;
}

.project-details>summary {
  padding: 14px 23px;
}

.details-inner {
  padding: 22px 23px 27px;
}

.details-columns {
  grid-template-columns: 1fr;
  gap: 0;
}

.meta-row {
  grid-template-columns: 1fr;
  gap: 3px;
}

/* The exact alignment requested: every image starts at the TOP of the tags row. */

.project-preview,.preview-surface {
  grid-column: 2;
  grid-row: 2 / span 2;
  margin: 0;
  align-self: start;
  min-width: 0;
  position: relative;
}

.preview-surface {
  isolation: isolate;
  border-radius: 15px;
  min-height: 295px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 9px;
  overflow: hidden;
}

.preview-framework {
  background: radial-gradient(circle at 90% 30%,#dfeee7,transparent 55%),#f5faf7;
}

.preview-wordie {
  background: radial-gradient(circle at 30% 65%,#e0eaf8,transparent 59%),#f6f7fc;
  min-height: 325px;
}

.preview-folders {
  background: radial-gradient(circle at 80% 65%,#e2eeeb,transparent 59%),#f5faf8;
  min-height: 300px;
}

.mini-window {
  border: 1px solid #dce7e0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(28,45,35,.09);
  width: 100%;
  overflow: hidden;
  color: #263c31;
}

.mini-window-top {
  height: 31px;
  background: #f5f8f7;
  border-bottom: 1px solid #e4ece7;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}

.mini-dots {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.mini-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f1776c;
}

.mini-dots i:nth-child(2) {
  background: #e8bd64;
}

.mini-dots i:nth-child(3) {
  background: #74bd8b;
}

.mini-window-name {
  font-size: 9.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.repo-view {
  display: grid;
  grid-template-columns: 43% 57%;
  min-height: 243px;
}

.repo-tree {
  padding: 9px 4px 8px 7px;
  background: #fafdff;
  border-right: 1px solid #e8eeee;
  font: 9px/1.9 ui-monospace,SFMono-Regular,Consolas,monospace;
  color: #607468;
  white-space: nowrap;
  overflow: hidden;
}

.repo-tree>div {
  padding-left: 4px;
}

.repo-tree .tree-head {
  font-weight: 700;
  font-size: 8.5px;
  color: #33433b;
  margin-bottom: 7px;
}

.repo-tree .tree-selected {
  color: #175342;
  background: #dfeceb;
  border-radius: 4px;
}

.tree-folder {
  color: #3c5c78;
}

.readme-view {
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.file-caption {
  font: 9px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace;
  color: #77857a;
}

.readme-view strong {
  font-size: 11px;
  color: #1f2c26;
  margin: 3px 0 1px;
}

.readme-stroke {
  width: 82%;
  height: 5px;
  border-radius: 6px;
  background: #dce6df;
}

.readme-stroke.long {
  width: 100%;
}

.readme-stroke.short {
  width: 63%;
}

.readme-label {
  font-size: 9px;
  font-weight: 650;
  margin-top: 11px;
  color: #263c30;
}

.phone {
  position: absolute;
  width: 132px;
  height: 252px;
  border: 5px solid #18231e;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 14px 18px rgba(20,35,29,.16);
  padding: 19px 10px 8px;
  overflow: hidden;
  color: #283a2d;
  font-size: 11px;
}

.phone-front {
  z-index: 2;
  top: 13px;
  left: clamp(4px,10%,29px);
}

.phone-back {
  top: 44px;
  right: 2px;
  transform: scale(.94);
  z-index: 1;
}

.phone-pill {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 45px;
  height: 9px;
  background: #101715;
  border-radius: 999px;
}

.phone-title {
  text-align: center;
  font-weight: 750;
  font-size: 10px;
  margin: 2px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e8edf0;
}

.phone-small {
  text-align: center;
  color: #66786d;
  font-size: 9px;
  margin-bottom: 10px;
}

.study-word {
  text-align: center;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 750;
  margin-top: 6px;
}

.study-phonetic {
  text-align: center;
  font-size: 10px;
  margin-bottom: 14px;
  color: #738278;
}

.study-option {
  background: #f6f9fc;
  border: 1px solid #e2ebf0;
  border-radius: 7px;
  margin: 6px 0;
  text-align: center;
  padding: 7px 4px;
  font-size: 10px;
}

.study-confirm {
  background: #dcf4e6;
  color: #136742;
  border-radius: 7px;
  padding: 6px;
  margin-top: 11px;
  text-align: center;
  font-weight: 700;
  font-size: 9px;
}

.word-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #edf0ef;
  padding: 10px 0;
  gap: 6px;
  font-size: 9px;
}

.word-row em {
  font-style: normal;
  color: #728177;
}

.phone-hint {
  background: #edf5ef;
  color: #3d6950;
  border-radius: 6px;
  padding: 7px;
  margin-top: 12px;
  font-size: 9px;
}

.mockup-caption {
  position: absolute;
  bottom: 6px;
  right: 9px;
  font-size: 8px;
  color: #73877b;
  z-index: 3;
}

.folder-window {
  margin-top: 8px;
  transform: rotate(-.4deg);
}

.folder-content {
  display: grid;
  grid-template-columns: 36% 64%;
  min-height: 230px;
}

.folder-sidebar {
  padding: 13px 4px;
  background: #f8fbfb;
  border-right: 1px solid #e7edec;
  font-size: 8.5px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: #66776c;
}

.folder-sidebar>div {
  padding: 5px 2px;
  border-radius: 4px;
  white-space: nowrap;
}

.folder-sidebar .side-active {
  background: #e3f0ee;
  color: #245b49;
  font-weight: 700;
}

.folder-main {
  padding: 13px 6px;
  font-size: 9px;
  min-width: 0;
}

.folder-heading {
  font-weight: 750;
  margin-bottom: 5px;
}

.folder-path {
  border: 1px solid #e8edeb;
  border-radius: 6px;
  padding: 5px;
  font-size: 8px;
  color: #77817a;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.folder-row {
  display: flex;
  gap: 4px;
  align-items: center;
  border-bottom: 1px solid #e8eeea;
  padding: 7px 0;
  font-size: 8px;
  white-space: nowrap;
}

.folder-symbol {
  font-size: 11px;
}

.folder-count {
  margin-left: auto;
  font-size: 7px;
  color: #79887e;
}

.folder-footer {
  background: #e8f5ed;
  color: #1b6845;
  padding: 7px;
  margin-top: 13px;
  border-radius: 5px;
  display: flex;
  justify-content: space-between;
  gap: 3px;
  font-size: 8px;
}

/* The RTLabs project intentionally has no illustration; it uses two balanced text columns. */

.project-body--no-image {
  grid-template-columns: 1fr;
  row-gap: 15px;
}

.project-body--no-image .project-heading {
  grid-column: 1;
}

.project-body--no-image .project-tags {
  grid-column: 1;
}

.project-body--no-image .project-info {
  grid-column: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
}

.project-body--no-image .project-implemented {
  margin-top: 11px;
}

@media (max-width:1120px) {
  .projects {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .page-width {
    width: min(1200px,calc(100% - 48px));
  }

  .project-body {
    padding: 22px 19px;
    column-gap: 12px;
  }

  .project-heading h3 {
    font-size: 18px;
  }

  .project-tags {
    margin-left: 34px!important;
  }

  .project-tags span {
    padding: 4px 8px;
    font-size: 10px;
  }

  .preview-surface {
    min-height: 265px;
  }

  .preview-wordie {
    min-height: 315px;
  }

  .phone-front {
    left: 2px;
  }

  .phone-back {
    right: -8px;
  }
}

@media (max-width:850px) {
  .projects {
    grid-template-columns: 1fr;
  }

  .project-body {
    grid-template-columns: minmax(0,1.12fr) minmax(0,.88fr);
    column-gap: 22px;
  }

  .preview-surface {
    min-height: 295px;
  }

  .project-heading h3 {
    font-size: 21px;
  }

  .project-body--no-image .project-info {
    grid-template-columns: 1fr 1fr;
    gap: 25px;
  }

  .project-body--no-image .project-implemented {
    margin-top: 0;
  }
}

@media (max-width:560px) {
  .project-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    row-gap: 13px;
    padding: 20px;
  }

  .project-heading {
    grid-column: 1;
    grid-row: 1;
  }

  .project-heading h3 {
    font-size: 19px;
  }

  .project-tags {
    grid-column: 1;
    grid-row: 2;
    margin-left: 33px!important;
  }

  .project-info {
    grid-column: 1;
    grid-row: 3;
  }

  .preview-surface {
    grid-column: 1;
    grid-row: 4;
    min-height: 275px;
    margin-top: 4px;
  }

  .preview-wordie {
    min-height: 320px;
  }

  .project-body--no-image .project-info {
    grid-template-columns: 1fr;
  }

  .project-body--no-image .project-implemented {
    margin-top: 15px;
  }

  .project-heading .project-links .external-link {
    font-size: 11px;
  }

  .project-details>summary {
    padding: 14px 20px;
  }

  .details-inner {
    padding: 20px;
  }
}

/* Final desktop geometry: large enough for both text and a readable preview. */

@media (min-width:1121px) {
  .page-width {
    width: min(1300px,calc(100% - 72px));
  }

  .project-body {
    grid-template-columns: minmax(0,1.12fr) minmax(0,.88fr);
    column-gap: 21px;
  }

  .project-overview>p {
    font-size: 13.5px;
    line-height: 1.61;
  }

  .project-implemented li {
    font-size: 12.9px;
  }
}

/* Align the content of the screenshot itself, not only its surrounding panel. */

.preview-surface {
  padding: 0;
}

.preview-framework .mini-window,.preview-folders .mini-window {
  margin-top: 0;
}

.preview-wordie .phone-front {
  top: 0;
}

.preview-wordie .phone-back {
  top: 30px;
}

/* No image for RTLabs: description and completed work form two readable columns. */

@media (min-width:561px) {
  .project-body--no-image .project-info {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 22px;
  }

  .project-body--no-image .project-implemented {
    margin-top: 0;
  }
}

.project-body--no-image {
  grid-template-columns: minmax(0,1fr)!important;
}

.project-body--no-image .project-heading,
.project-body--no-image .project-tags,
.project-body--no-image .project-info {
  grid-column: 1;
}

/* v5: tags start at the card content edge; implementation lists move into details. */

.project-card .project-tags {
  margin-left: 0!important;
}

.project-details .details-inner>.project-implemented {
  margin: 0 0 22px;
}

/* Project details open in a wide dialog, outside the card layout. */

html {
  scrollbar-gutter: stable;
}

body.project-dialog-open {
  overflow: hidden;
}

.project-details-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  padding: 14px 23px;
  border: 0;
  border-top: 1px solid #e9eeea;
  background: #f7f9f7;
  color: #314939;
  font: inherit;
  font-size: 13px;
  font-weight: 590;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
}

.project-details-button:hover {
  background: #eef4ef;
}

.project-details-button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-dialog {
  width: min(1080px,calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  padding: 0;
  border: 1px solid #dfe7e0;
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 90px rgba(24,35,29,.22);
  overflow: auto;
  overscroll-behavior: contain;
}

.project-dialog::backdrop {
  background: rgba(24,35,29,.38);
  backdrop-filter: blur(3px);
}

.project-dialog-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.project-dialog-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -.025em;
}

.project-dialog-close {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid #dfe7e0;
  border-radius: 9px;
  background: #fff;
  color: #314939;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.project-dialog-close:hover {
  background: #edf4ef;
}

.project-dialog-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.project-dialog .details-inner {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  align-items: start;
  gap: 28px 36px;
  padding: 28px 32px 32px;
  border-top: 0;
}

.project-dialog .details-inner>.project-implemented {
  margin: 0;
}

.project-dialog .details-columns {
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: 1fr;
  gap: 4px;
  margin: 0;
}

.project-dialog .details-inner h4 {
  font-size: 14px;
}

.project-dialog .project-implemented li {
  font-size: 13.5px;
  line-height: 1.65;
}

.project-dialog .showcase-block {
  grid-column: 1 / -1;
  margin: 0;
}

.project-dialog .meta-list {
  grid-column: 1 / -1;
  margin: 0;
}

.project-dialog .meta-row {
  grid-template-columns: 160px minmax(0,1fr);
  gap: 18px;
}

.project-dialog--text .details-columns {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 36px;
}

@media (max-width:650px) {
  .project-details-button {
    padding: 14px 20px;
  }

  .project-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 14px;
  }

  .project-dialog-header {
    gap: 12px;
    padding: 18px 20px;
  }

  .project-dialog-header h2 {
    font-size: 19px;
  }

  .project-dialog-close {
    padding: 8px;
  }

  .project-dialog-close span {
    display: none;
  }

  .project-dialog .details-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 22px 20px;
  }

  .project-dialog .details-columns,.project-dialog--text .details-columns {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .project-dialog .meta-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

#skills-title {
  margin-bottom: 24px;
}

@media (max-width: 650px) {
  .role {
    margin: 8px 0 10px;
  }
}

@media (max-width: 650px) {
  .hero {
    grid-template-rows: auto 1fr auto;
    row-gap: 8px;
  }

  .hero-copy {
    display: contents;
  }

  .hero .portrait {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .hero-copy h1 {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }

  .hero .role {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    margin: 0;
  }

  .hero .bio {
    grid-column: 1 / -1;
    grid-row: 3;
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.65;
  }
}