@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/gh/devicons/devicon@latest/devicon.min.css');

:root {
  --paper: #f4f1eb;
  --ink: #1c211f;
  --muted: #6c726e;
  --line: #d7d3ca;
  --accent: #b84f36;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.section-width {
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  width: min(var(--max-width), calc(100% - 48px));
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  gap: 25px;
}

.site-header nav a {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a.active,
.text-link:hover,
footer a:hover {
  color: var(--accent);
}

.intro {
  min-height: 680px;
  padding: 120px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 60px;
  align-items: center;
}

.eyebrow,
.section-number,
.project-type {
  margin: 0;
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 840px;
  margin: 22px 0;
  font-size: clamp(3rem, 6.3vw, 6.1rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.075em;
}

.intro-text {
  max-width: 570px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.intro-links {
  display: flex;
  gap: 28px;
  margin-top: 38px;
}

.text-link {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.muted-link {
  color: var(--muted);
}

.portrait {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 4 / 5;
  margin: 0 0 0 auto;
  overflow: hidden;
  background: #e8e4dc;
}
.portrait {
  width: 100%;
  max-width: 360px;
  aspect-ratio: auto;
  margin: 0 0 0 auto;
  overflow: visible;
  background: transparent;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 620px;
  object-fit: contain;
  filter: grayscale(100%);
  transition: filter 0.35s ease;
}

.portrait:hover img {
  filter: grayscale(0%);
  transform: none;
}

@media (max-width: 720px) {
  .portrait {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .portrait img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
  }
}


.section-block {
  padding: 120px 0;
  border-top: 1px solid var(--line);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) 1fr;
  gap: 100px;
}

.section-heading {
  margin-bottom: 55px;
}

h2 {
  max-width: 600px;
  margin: 12px 0 0;
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.copy {
  max-width: 600px;
  color: var(--muted);
}

.copy p {
  margin-top: 0;
  margin-bottom: 22px;
}

.skills-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.skill-row {
  min-height: 154px;
  padding: 24px;
  border: 1px solid var(--line);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.skill-row:hover {
  background: #ebe7df;
  border-color: #c5bfb4;
  transform: translateY(-2px);
}

.skill-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.skill-name {
  font-weight: 600;
}

.skill-description {
  display: block;
  margin-top: 17px;
  color: var(--muted);
  font-size: 0.9rem;
}

.skill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  border: 0;
  font-size: 2.5rem;
  line-height: 1;
}

.skill-icon i {
  line-height: 1;
}

.icon-csharp { color: #713c91; }
.icon-unity { color: #3c4140; }
.icon-godot { color: #3f78a4; }
.icon-blender { color: #bd641f; }
.icon-js { color: #9b7b12; }
.icon-sql { color: #4b6876; }
.icon-python { color: #39756f; }
.icon-git { color: #9b4430; }

.icon-uml {
  color: #6e5b94;
  font-family: 'DM Mono', monospace;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.08em;
}

.compact-section {
  padding-top: 105px;
  padding-bottom: 105px;
}

.plain-list {
  margin: 28px 0 0;
  padding-left: 18px;
  color: var(--ink);
}

.plain-list li {
  margin: 10px 0;
}

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

.project-entry {
  padding: 27px 0 38px;
  border-bottom: 1px solid var(--line);
}

.project-row {
  display: grid;
  grid-template-columns: 1.05fr 1.5fr auto;
  gap: 30px;
  align-items: center;
}

.project-row h3 {
  margin: 5px 0 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.project-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.project-row .project-type {
  font-size: 0.68rem;
}

.repo-link {
  white-space: nowrap;
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.repo-link:hover {
  color: var(--accent);
}

.project-gallery {
  position: relative;
  margin-top: 28px;
}

.gallery-window {
  overflow: hidden;
  background: #e8e4dc;
  aspect-ratio: 16 / 8.5;
}

.gallery-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.gallery-track img {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(244, 241, 235, 0.72);
  border-radius: 50%;
  background: rgba(28, 33, 31, 0.78);
  color: #f4f1eb;
  transform: translateY(-50%);
  font: 400 2rem/1 Arial, sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.gallery-arrow:hover {
  background: var(--accent);
  transform: translateY(-50%) scale(1.06);
}

.gallery-arrow:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.gallery-arrow-left { left: 16px; }
.gallery-arrow-right { right: 16px; }

.contact-section {
  padding-bottom: 145px;
}

.contact-section h2 {
  margin-bottom: 22px;
}

.contact-section > p:not(.section-number) {
  max-width: 480px;
  color: var(--muted);
}

.contact-email {
  display: inline-block;
  margin-top: 20px;
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 0 35px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
}

footer a {
  text-decoration: none;
}

.skill-row,
.project-entry,
.copy,
.contact-section {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 720px) {
  .section-width,
  .site-header-inner {
    width: min(var(--max-width), calc(100% - 32px));
  }

  .site-header-inner {
    min-height: 70px;
  }

  .site-header nav {
    display: none;
  }

  .intro {
    min-height: auto;
    padding: 84px 0;
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .intro h1 {
    font-size: clamp(2.8rem, 14vw, 5rem);
  }

  .portrait {
    max-width: none;
    width: 100%;
    margin: 0;
    aspect-ratio: 4 / 3;
  }

  .section-block {
    padding: 80px 0;
  }

  .split-section {
    grid-template-columns: 1fr;
    gap: 38px;
  }

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

  .skill-row {
    min-height: auto;
  }

  .project-row {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .project-row > p {
    grid-column: 1 / 2;
  }

  .project-row > a {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .gallery-window {
    aspect-ratio: 4 / 3;
  }

  .gallery-arrow {
    width: 38px;
    height: 38px;
  }

  .gallery-arrow-left {
    left: 10px;
  }

  .gallery-arrow-right {
    right: 10px;
  }
}
