:root {
  --ink: #16171c;
  --muted: #646873;
  --quiet: #8b8f98;
  --paper: #fafaf7;
  --panel: #f1f1ed;
  --card: #ffffff;
  --line: #dedfdb;
  --blue: #3047ff;
  --blue-soft: #eaedff;
  --mono: "DM Mono", "Courier New", monospace;
  --sans: "Inter", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--blue); color: #fff; }

.skip-link { position: fixed; top: 12px; left: 12px; z-index: 1000; padding: 10px 14px; background: var(--ink); color: #fff; font-size: .75rem; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

.portfolio-shell { display: grid; min-height: 100vh; grid-template-columns: clamp(310px, 28vw, 420px) minmax(0, 1fr); }
.profile-panel { position: relative; z-index: 2; border-right: 1px solid var(--line); background: var(--panel); }
.profile-inner { position: sticky; top: 0; display: flex; min-height: 100vh; flex-direction: column; padding: clamp(44px, 6vh, 72px) clamp(30px, 4vw, 58px) 34px; }
.portrait-link { width: fit-content; }
.profile-photo { width: 138px; height: 138px; border: 1px solid #c9cac5; border-radius: 50%; object-fit: cover; object-position: center 62%; }
.profile-heading { margin-top: 27px; }
.availability { display: flex; align-items: center; gap: 8px; margin: 0 0 13px; color: var(--muted); font-family: var(--mono); font-size: .63rem; letter-spacing: .04em; text-transform: uppercase; }
.availability span { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.profile-heading h1 { margin: 0; font-size: clamp(2rem, 3vw, 2.65rem); letter-spacing: -.055em; line-height: 1.05; }
.profile-heading > p:not(.availability) { margin: 9px 0 2px; font-size: .94rem; font-weight: 600; }
.profile-heading > p span { color: var(--blue); }
.profile-heading small { color: var(--muted); font-size: .78rem; }

.social-links { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.social-links a:not(.email-link) { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #cfd0cb; border-radius: 50%; color: #50545c; font-size: .9rem; transition: border-color 160ms ease, color 160ms ease, transform 160ms ease; }
.social-links a:not(.email-link):hover { border-color: var(--blue); color: var(--blue); transform: translateY(-2px); }
.email-link { padding: 6px 12px; border: 1px solid #b9bbc1; border-radius: 999px; color: #50545c; font-size: .72rem; font-weight: 500; }
.email-link:hover { border-color: var(--blue); color: var(--blue); }

.profile-section { padding-top: 23px; margin-top: 28px; border-top: 1px solid #d4d5d0; }
.side-label, .section-label { margin: 0 0 13px; color: #747881; font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; }
.profile-section > p:not(.side-label) { margin: 0; color: #3f434b; font-size: .8rem; line-height: 1.65; }
.profile-section > p + p { margin-top: 8px; }
.skill-list, .tag-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 0; list-style: none; }
.skill-list li, .tag-list li { padding: 5px 10px; border-radius: 999px; background: #e3e4df; color: #3e424b; font-family: var(--mono); font-size: .61rem; }
.profile-proof { display: grid; gap: 12px; margin-top: auto; padding-top: 30px; }
.profile-proof > .side-label { margin: 0 0 2px; }
.profile-proof div { display: grid; grid-template-columns: 82px 1fr; gap: 11px; align-items: center; }
.profile-proof strong { color: var(--blue); font-family: var(--mono); font-size: .77rem; }
.profile-proof span { color: #696d74; font-size: .68rem; line-height: 1.4; }

.portfolio-main { min-width: 0; padding: 0 clamp(34px, 5vw, 84px); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; height: 78px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(250, 250, 247, .92); backdrop-filter: blur(14px); }
.wordmark { font-size: 1rem; font-weight: 700; letter-spacing: -.04em; }
.wordmark span { color: var(--blue); }
.topbar nav { display: flex; gap: clamp(18px, 2.5vw, 35px); }
.topbar nav a { color: #5c6069; font-family: var(--mono); font-size: .61rem; text-transform: uppercase; }
.topbar nav a:hover { color: var(--blue); }

.intro-block { display: flex; min-height: 520px; max-width: 890px; flex-direction: column; justify-content: center; padding: 75px 0; }
.intro-block h2, .section-heading h2, .contact-card h2 { margin: 0; font-size: clamp(2.7rem, 5.3vw, 5.8rem); letter-spacing: -.07em; line-height: .98; }
.intro-block h2 span { color: #7c8088; font-weight: 500; }
.intro-block > p:not(.section-label) { max-width: 620px; margin: 28px 0 22px; color: var(--muted); font-size: 1rem; }
.text-link { display: inline-flex; width: fit-content; align-items: center; gap: 8px; color: var(--blue); font-size: .77rem; font-weight: 600; }
.text-link span { transition: transform 160ms ease; }
.text-link:hover span { transform: translateX(4px); }
.intro-block .text-link:hover span { transform: translateY(4px); }

.content-section { padding: 95px 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 44px; }
.section-heading h2 { font-size: clamp(2.2rem, 3.8vw, 4.2rem); }
.section-heading > p { max-width: 360px; margin: 0; color: var(--muted); font-size: .8rem; }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 60px 28px; }
.project-card { min-width: 0; }
.project-image { position: relative; display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #e8e8e4; }
.project-image::after { position: absolute; inset: 0; background: rgba(22, 23, 28, .04); content: ""; transition: background 200ms ease; }
.project-image img { width: 100%; aspect-ratio: 16 / 8.9; object-fit: cover; transition: transform 350ms ease; }
.project-image:hover img { transform: scale(1.025); }
.project-image:hover::after { background: transparent; }
.open-mark { position: absolute; z-index: 2; display: grid; place-items: center; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); }
.open-mark { right: 13px; bottom: 13px; width: 36px; height: 36px; border-radius: 50%; color: var(--blue); font-size: .95rem; }
.project-copy { padding: 18px 2px 0; }
.project-type { margin: 0 0 8px; color: #767a83; font-family: var(--mono); font-size: .61rem; text-transform: uppercase; }
.project-copy h3 { margin: 0; font-size: clamp(1.25rem, 2vw, 1.7rem); letter-spacing: -.04em; line-height: 1.2; }
.project-copy h3 a:hover { color: var(--blue); }
.tag-list { margin-top: 13px; }
.tag-list li { background: var(--blue-soft); color: var(--blue); }
.project-copy > p:not(.project-type) { margin: 15px 0 12px; color: var(--muted); font-size: .79rem; line-height: 1.65; }

.timeline { border-top: 1px solid var(--line); }
.timeline-row { display: grid; grid-template-columns: 90px minmax(190px, .75fr) minmax(280px, 1.35fr); gap: 30px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.timeline-date { margin: 2px 0 0; color: var(--blue); font-family: var(--mono); font-size: .69rem; }
.timeline-row h3 { margin: 0; font-size: 1rem; letter-spacing: -.025em; }
.company { margin: 4px 0 0; color: var(--muted); font-size: .72rem; }
.timeline-row > p:last-child { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.7; }

.education-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.education-card { position: relative; min-height: 225px; padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.education-year { margin: 0 0 36px; color: var(--muted); font-family: var(--mono); font-size: .65rem; }
.education-card h3 { max-width: 320px; margin: 0 0 9px; font-size: 1.22rem; letter-spacing: -.035em; }
.education-card p:not(.education-year), .education-card small { margin: 0; color: var(--muted); font-size: .76rem; }

.archive-list { border-top: 1px solid var(--line); }
.archive-list a { display: grid; grid-template-columns: 55px minmax(260px, 1fr) minmax(180px, .7fr) 24px; gap: 20px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); transition: color 160ms ease, padding 160ms ease; }
.archive-list a:hover { padding-left: 7px; color: var(--blue); }
.archive-list span, .archive-list em { color: var(--quiet); font-family: var(--mono); font-size: .61rem; font-style: normal; }
.archive-list strong { font-size: .82rem; font-weight: 600; }
.archive-list i { color: var(--blue); font-style: normal; }

.contact-card { position: relative; padding: clamp(48px, 7vw, 90px); margin: 80px 0; overflow: hidden; border-radius: 20px; background: var(--ink); color: #fff; }
.contact-card::after { position: absolute; right: -90px; bottom: -150px; width: 360px; height: 360px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018); content: ""; }
.contact-card .section-label { color: #aeb2bd; }
.contact-card h2 { position: relative; z-index: 1; max-width: 760px; font-size: clamp(2.5rem, 4.6vw, 5rem); }
.contact-card > p:not(.section-label) { position: relative; z-index: 1; max-width: 600px; margin: 24px 0 28px; color: #b9bdc6; font-size: .88rem; }
.contact-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 12px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 11px 16px; border-radius: 8px; font-size: .73rem; font-weight: 600; }
.primary-button { background: var(--blue); color: #fff; }
.primary-button:hover { background: #4357ff; }
.secondary-button { border: 1px solid #474a52; color: #d5d7dc; }
.secondary-button:hover { border-color: #777b85; color: #fff; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--quiet); font-family: var(--mono); font-size: .6rem; }
.site-footer p { margin: 0; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 520ms ease, transform 520ms ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .project-image img, .text-link span { transition: none; }
}

@media (max-width: 980px) {
  .portfolio-shell { grid-template-columns: 1fr; }
  .profile-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .profile-inner { position: static; min-height: auto; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0 28px; padding: 38px clamp(24px, 6vw, 60px); }
  .profile-photo { width: 120px; height: 120px; }
  .profile-heading { margin-top: 6px; }
  .social-links { grid-column: 2; margin-top: 16px; }
  .profile-section { grid-column: 1 / -1; }
  .profile-proof { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); margin-top: 0; }
  .profile-proof > .side-label { grid-column: 1 / -1; }
  .portfolio-main { padding: 0 clamp(24px, 6vw, 60px); }
}

@media (max-width: 700px) {
  .profile-inner { grid-template-columns: 86px minmax(0, 1fr); gap: 0 20px; padding: 28px 20px 30px; }
  .profile-photo { width: 86px; height: 86px; }
  .profile-heading h1 { font-size: 1.65rem; }
  .profile-heading > p:not(.availability) { font-size: .78rem; }
  .availability { font-size: .53rem; }
  .social-links { grid-column: 1 / -1; }
  .profile-proof { grid-template-columns: 1fr; }
  .portfolio-main { padding: 0 20px; }
  .topbar { height: 66px; }
  .topbar nav { gap: 15px; }
  .topbar nav a:nth-child(3), .topbar nav a:nth-child(4) { display: none; }
  .intro-block { min-height: 440px; padding: 55px 0; }
  .intro-block h2 { font-size: clamp(2.65rem, 13vw, 4rem); }
  .content-section { padding: 70px 0; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 18px; }
  .project-grid, .education-grid { grid-template-columns: 1fr; }
  .project-grid { gap: 48px; }
  .timeline-row { grid-template-columns: 65px 1fr; gap: 10px 18px; }
  .timeline-row > p:last-child { grid-column: 2; }
  .archive-list a { grid-template-columns: 38px minmax(0, 1fr) 20px; gap: 10px; }
  .archive-list em { display: none; }
  .contact-card { padding: 42px 26px; margin: 60px 0; border-radius: 15px; }
  .site-footer { display: block; }
  .site-footer p + p { margin-top: 5px; }
}
