/* ==========================================================================
   Fonts — Inter Variable (latin + latin-ext subsets)
   ========================================================================== */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  --text: #101820;
  --text-body: #151c22;
  --background: #fff;
  --link: #114b29;
  --rule: #d9dde0;
  --divider: #bdc5c5;
  --badge: #e8f0e9;
  --thumbnail-background: #f5f8f7;
  --thumbnail-border: #d9e2dd;

  font-family: "Inter Variable", Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--background);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

body {
  margin: 0;
  min-inline-size: 320px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: var(--link);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 6px;
  border-radius: 2px;
}

a:active {
  opacity: 0.7;
}

.icon {
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.portfolio {
  inline-size: min(700px, calc(100% - 48px));
  margin-inline: auto;
  padding-block: clamp(64px, 9.4vw, 128px) 72px;
}

/* ==========================================================================
   Intro — portrait, name, contact links
   ========================================================================== */

.intro {
  padding-block-end: 40px;
  border-block-end: 1px solid var(--rule);
}

.identity {
  display: flex;
  align-items: center;
  gap: 28px;
}

.portrait {
  display: block;
  inline-size: 106px;
  block-size: 106px;
  border-radius: 50%;
  object-fit: cover;
}

h1 {
  font-size: 46px;
  line-height: 1.15;
  font-weight: 740;
  letter-spacing: -0.035em;
}

.role {
  margin-block-start: 8px;
  font-size: 24px;
  line-height: 1.4;
  letter-spacing: -0.025em;
}

.contact-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-block-start: 24px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-block-size: 44px;
  font-size: 21px;
  line-height: 1.35;
  white-space: nowrap;
}

.email {
  font-weight: 620;
}

.cv {
  padding-inline: 28px;
  border-inline: 1px solid var(--divider);
  text-decoration: none;
}

.linkedin {
  gap: 10px;
  font-weight: 520;
}

.file-type {
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--badge);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 650;
}

/* ==========================================================================
   Projects
   ========================================================================== */

.projects {
  padding-block-start: 39px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

h2 {
  font-size: 30px;
  line-height: 1.3;
  font-weight: 720;
  letter-spacing: -0.03em;
}

.github {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-block-size: 44px;
  font-size: 21px;
  font-weight: 530;
}

.project-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.project-list li {
  border-block-end: 1px solid var(--rule);
}

.project-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 25px;
  align-items: center;
  column-gap: 20px;
  min-block-size: 168px;
  padding-block: 27px 29px;
  text-decoration: none;
}

.project-copy {
  min-inline-size: 0;
}

h3 {
  font-size: 27px;
  line-height: 1.3;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.project-copy p {
  margin-block-start: 4px;
  color: var(--text-body);
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: -0.03em;
}

.project-thumbnail {
  display: block;
  inline-size: 180px;
  block-size: 113px;
  object-fit: contain;
  object-position: center;
  background: var(--thumbnail-background);
  border: 1px solid var(--thumbnail-border);
  border-radius: 8px;
}

.project-arrow {
  align-self: center;
}

/* ==========================================================================
   Interaction
   ========================================================================== */

@media (hover: hover) and (pointer: fine) {
  .contact-link:hover span:not(.file-type),
  .github:hover span {
    text-decoration: underline;
    text-decoration-thickness: 2px;
  }

  .project-link:hover h3 {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 5px;
  }

  .project-link:hover .project-arrow {
    transform: translate(2px, -2px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .project-arrow {
    transition: transform 150ms ease;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 760px) {
  .portfolio {
    inline-size: min(700px, calc(100% - 40px));
  }

  h1 {
    font-size: clamp(29px, 6vw, 46px);
  }

  .role {
    font-size: clamp(16px, 3.4vw, 24px);
  }

  .contact-links {
    flex-wrap: wrap;
    gap: 8px 24px;
  }

  .contact-link {
    font-size: 18px;
  }

  .email {
    flex-basis: 100%;
  }

  .cv {
    padding-inline: 0 24px;
    border-inline-start: 0;
  }

  h2 {
    font-size: 26px;
  }

  .github {
    font-size: 18px;
  }

  h3 {
    font-size: 23px;
  }

  .project-copy p {
    font-size: 17px;
    letter-spacing: -0.015em;
  }
}

@media (max-width: 600px) {
  .project-link {
    grid-template-columns: minmax(0, 1fr) 22px;
    gap: 16px;
  }

  .project-copy {
    grid-column: 1;
    grid-row: 1;
  }

  .project-arrow {
    grid-column: 2;
    grid-row: 1;
  }

  .project-thumbnail {
    grid-column: 1 / -1;
    grid-row: 2;
    inline-size: min(180px, 100%);
    block-size: auto;
    aspect-ratio: 180 / 113;
  }
}

@media (max-width: 480px) {
  .portfolio {
    padding-block-start: 48px;
  }

  .intro {
    padding-block-end: 28px;
  }

  .identity {
    gap: 18px;
  }

  .portrait {
    inline-size: 72px;
    block-size: 72px;
  }

  h1 {
    font-size: 29px;
  }

  .role {
    font-size: 16px;
  }

  .contact-links {
    gap: 8px 20px;
    margin-block-start: 22px;
  }

  .contact-link {
    gap: 9px;
    font-size: 17px;
  }

  .contact-link .icon {
    inline-size: 22px;
  }

  .cv {
    padding-inline-end: 20px;
  }

  .file-type {
    padding: 3px 6px;
    font-size: 12px;
  }

  .projects {
    padding-block-start: 27px;
  }

  h2 {
    font-size: 23px;
  }

  .github {
    gap: 4px;
    font-size: 17px;
  }

  .github .icon {
    inline-size: 21px;
  }

  .project-list {
    margin-block-start: 9px;
  }

  .project-link {
    padding-block: 23px 25px;
  }

  h3 {
    font-size: 22px;
  }

  .project-copy p {
    margin-block-start: 6px;
    font-size: 16px;
    line-height: 1.55;
  }

  .project-arrow {
    inline-size: 22px;
  }
}
