@font-face {
  font-family: Onest;
  src: url("fonts/onest-cyrillic-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Onest;
  src: url("fonts/onest-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2191, U+2193, U+2212;
}

.home-mode, .case-mode, .workflow-mode, .stack-mode, .journey-mode, .resume-mode {
  --paper: #f5f5f2;
  --ink: #111;
  --muted: #585857;
  --blue: #2443ed;
  --line: #c9c9c4;
  --home-ease: cubic-bezier(.16, 1, .3, 1);
  font-family: Onest, system-ui, sans-serif;
}

.home-mode .shell { width: min(100% - clamp(36px, 7vw, 112px), 1320px); }
.home-mode .top { min-height: clamp(76px, 7.3vw, 102px); padding: 12px 0; border-bottom: 1px solid var(--line); }
.home-mode .brand { white-space: nowrap; font-size: clamp(1.7rem, 3vw, 2.55rem); }
.home-mode .top nav { flex-wrap: nowrap; gap: clamp(13px, 2.8vw, 41px); }
.home-mode .top nav a {
  position: relative; display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ink); font-size: clamp(.8rem, 1.15vw, 1rem); font-weight: 560; text-decoration: none; white-space: nowrap;
}
.home-nav-only, .home-mode .inner-nav-only { display: none; }
.home-mode .top nav .home-nav-only { display: inline; }
.home-mode .top nav a.home-nav-only { display: inline-flex; }
.home-mode .top nav a::after, .project-name::after {
  position: absolute; inset: auto 0 7px; height: 1px; background: var(--blue);
  content: ""; transform: scaleX(0); transform-origin: left center;
}

.home-view { padding-block: clamp(24px, 3.55vw, 54px) clamp(38px, 5vw, 80px); }
.home-title {
  margin: 0 0 clamp(20px, 2.4vw, 35px);
  font-size: clamp(2.6rem, 11vw, 10.25rem);
  font-weight: 900; line-height: .87; letter-spacing: -.058em; text-transform: uppercase;
}
.name-mask { display: block; padding-block: .13em .08em; margin-block: -.13em -.08em; overflow: clip; }
.name-line { display: inline-block; color: var(--ink); white-space: nowrap; }
.name-line .name-dot { display: inline-block; margin-left: .035em; color: var(--blue); }

.home-mast { margin-bottom: clamp(22px, 3.2vw, 46px); }
@media (min-width: 1050px) {
  .home-mast { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
  .home-mast .home-title { margin-bottom: 0; }
  .home-mast .name-mask { padding-right: 22px; }
  .home-mast .signature-note { flex: 0 1 18rem; }
}
.home-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr); gap: clamp(24px, 5vw, 76px); align-items: start; }
.home-copy { padding-top: clamp(2px, .7vw, 10px); }
.home-role, .project-label, .home-portrait figcaption, .reason-tab > span {
  font-size: clamp(.7rem, 1vw, .85rem); font-weight: 640; letter-spacing: .045em; text-transform: uppercase;
}
.home-role { margin-bottom: clamp(12px, 1.8vw, 25px); color: var(--blue); }
.home-statement {
  max-width: 14.5em; margin-bottom: 12px; font-size: clamp(1.47rem, 3.2vw, 3.15rem);
  line-height: 1.07; letter-spacing: -.045em; font-weight: 730; text-wrap: balance;
}
.home-description {
  max-width: 43ch; margin: 0; color: var(--muted); font-size: clamp(.98rem, 1.37vw, 1.22rem); line-height: 1.5;
}

.project-index {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px;
  width: min(100%, 41rem); margin-top: clamp(26px, 3vw, 44px); padding-bottom: clamp(12px, 1.25vw, 18px);
  border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; touch-action: manipulation;
}
.project-meta {
  grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding-bottom: 7px; margin-bottom: clamp(12px, 1.4vw, 20px); border-bottom: 1px solid var(--line);
}
.project-label { color: var(--blue); }
.project-year, .project-disciplines { color: var(--muted); font-size: clamp(.67rem, .84vw, .76rem); font-weight: 580; letter-spacing: .07em; }
.project-year { font-variant-numeric: tabular-nums; }
.project-name {
  grid-column: 1; position: relative; justify-self: start;
  font-size: clamp(2.4rem, 4.65vw, 4.5rem); font-weight: 815; line-height: .96; letter-spacing: -.062em; white-space: nowrap;
}
.project-name::after { bottom: -3px; height: 2px; }
.project-action { grid-column: 1; margin-top: 8px; color: var(--ink); font-size: clamp(.9rem, 1.15vw, 1.05rem); }
.project-disciplines { grid-column: 1 / -1; margin-top: clamp(15px, 1.5vw, 22px); text-transform: uppercase; }
.project-arrow {
  grid-area: 2 / 2 / span 2; display: grid; place-items: center;
  width: clamp(50px, 5.1vw, 74px); aspect-ratio: 1; border: 1px solid currentColor; border-radius: 50%;
}
.project-arrow svg { width: 43%; height: auto; }
.project-index:is(:focus-visible, :active) .project-arrow { color: white; border-color: var(--blue); background: var(--blue); }
.project-index:is(:focus-visible, :active) .project-name::after, .home-mode .top nav a:focus-visible::after { transform: scaleX(1); }
.home-mode :focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

.home-portrait { width: 100%; max-width: 465px; margin: 0; justify-self: end; }
.home-portrait img { transition: transform 480ms var(--home-ease); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .home-portrait:hover img { transform: scale(1.018); }
}
.portrait-frame { aspect-ratio: 4 / 4.65; overflow: hidden; background: #d7d7d1; }
.home-portrait img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 16%; filter: grayscale(1);
}
.home-portrait figcaption { margin-top: 8px; color: var(--muted); }

.home-reasons { margin-top: clamp(24px, 3.15vw, 54px); }
.reason-tabs { --active-index: 0; position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.reason-indicator { position: absolute; top: -1px; left: 0; width: calc(100% / 3); height: 2px; background: var(--blue); transform: translateX(calc(var(--active-index) * 100%)); pointer-events: none; }
.reason-tab {
  display: grid; justify-items: start; gap: 5px; min-height: 56px; padding: 11px 6px 12px 0; border: 0;
  text-align: left; background: transparent; color: var(--ink); font-size: clamp(.82rem, 1.5vw, 1.22rem); font-weight: 685;
}
.reason-tab > span, .reason-tab[aria-selected="true"] { color: var(--blue); }
.reason-tab:focus-visible { outline-offset: -2px; }
.reason-panels { display: grid; }
.reason-panels > [role="tabpanel"] { grid-area: 1 / 1; min-width: 0; padding-top: 9px; }
/* Reserve space for the longest panel so switching does not move the footer. */
.reason-panels > [role="tabpanel"][hidden] { display: block !important; visibility: hidden; }
.reason-panels p { min-height: 3em; max-width: 57ch; margin: 0; color: var(--muted); font-size: clamp(.94rem, 1.32vw, 1.13rem); }
.home-mode .footer { border-top: 1px solid var(--line); }

@media (hover: hover) {
  .home-mode .top nav a:hover::after, .project-index:hover .project-name::after { transform: scaleX(1); }
  .project-index:hover .project-arrow { color: white; border-color: var(--blue); background: var(--blue); }
  .reason-tab:hover { color: var(--blue); }
}

@media (max-width: 620px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  .home-title { font-size: clamp(2.45rem, 12.4vw, 4.4rem); }
  .home-portrait { width: 100%; justify-self: start; }
  .portrait-frame { aspect-ratio: 4 / 4.15; }
}

@media (prefers-reduced-motion: no-preference) {
  .home-mode .top nav a::after, .project-name::after { transition: transform 230ms var(--home-ease); }
  .project-arrow { transition: background-color 200ms var(--home-ease), color 200ms var(--home-ease), border-color 200ms var(--home-ease); }
  .project-arrow svg { transition: transform 240ms var(--home-ease); }
  .project-index:focus-visible svg { transform: translate(2px, -2px); }
  .reason-indicator { transition: transform 250ms var(--home-ease); }
  .reason-tabs:focus-within .reason-indicator { transition-duration: 170ms; }

  [data-home-intro] .name-line { animation: home-name 800ms var(--home-ease) both; }
  [data-home-intro] .name-mask + .name-mask .name-line { animation-delay: 120ms; }
  [data-home-intro] .portrait-frame { animation: home-portrait 900ms var(--home-ease) 300ms both; }
  [data-home-intro] .home-portrait figcaption { animation: home-rise 400ms var(--home-ease) 540ms both; }
  [data-home-intro] .home-intro { animation: home-rise 600ms var(--home-ease) 500ms both; }
  [data-home-intro] .project-index { animation: home-rise 400ms var(--home-ease) 650ms both; }
  [data-home-intro] .home-reasons { animation: home-rise 400ms var(--home-ease) 750ms both; }
  [data-home-intro] :is(.project-index:focus-visible, .home-reasons:focus-within) { animation: none; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .project-arrow { translate: var(--magnetic-x, 0px) var(--magnetic-y, 0px); transition: translate 240ms var(--home-ease), background-color 200ms var(--home-ease), color 200ms var(--home-ease), border-color 200ms var(--home-ease); }
  .project-index:hover svg { transform: translate(2px, -2px); }
}

@keyframes home-name { from { transform: translateY(110%); } to { transform: translateY(0); } }
@keyframes home-portrait { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes home-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
