:root {
  --sidebar: 17rem;
  --black: #050505;
  --text: #111;
  --muted: #686868;
  --line: #ececea;
  --soft: #f8f8f5;
  --soft-2: #fafaf8;
  --yellow: #efd34f;
  --red: #a31a2c;
  --blue: #0000ee;
  --body: "Roboto", Arial, sans-serif;
  --display: "Josefin Sans", Arial, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding-top: 56px;
  color: var(--text);
  background: #fff;
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
a:hover, a:focus { color: var(--blue); }
p { max-width: 74ch; }
::selection { background: var(--yellow); color: #000; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 9999;
  padding: 8px 11px;
  color: #fff;
  background: #000;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  background: var(--black);
}
.profile-link { display: none; }
.nav-toggle {
  margin-left: auto;
  border: 0;
  padding: 9px 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
  font: inherit;
}
.nav-toggle-lines {
  display: inline-block;
  width: 18px;
  height: 12px;
  margin-left: 8px;
  position: relative;
  border-top: 2px solid #fff;
  border-bottom: 2px solid #fff;
}
.nav-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  border-top: 2px solid #fff;
}
.nav-menu {
  display: none;
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  padding: 18px 20px 22px;
  background: var(--black);
}
.nav-menu.open { display: block; }
.nav-link {
  display: block;
  padding: 9px 0;
  color: rgba(255,255,255,.64);
  text-decoration: none;
  text-transform: uppercase;
  font-size: .77rem;
  font-weight: 400;
  letter-spacing: .055em;
  transition: color 180ms var(--ease);
}
.nav-link:hover { color: #fff; }
.nav-link.active { color: var(--yellow); }

.resume-section {
  padding: clamp(74px, 10vw, 112px) clamp(22px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 56px;
}
.section-inner {
  width: min(100%, 1130px);
  margin: 0 auto;
}
.section-heading {
  margin-bottom: clamp(42px, 6vw, 64px);
}
.section-eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-family: var(--body);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.section-heading h2 {
  margin: 0;
  color: #000;
  font-size: clamp(1.9rem, 1.72rem + .45vw, 2.25rem);
  line-height: 1.08;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -.02em;
}
.section-description {
  margin: 13px 0 0;
  max-width: 600px;
  color: var(--muted);
  font-family: var(--body);
  font-size: .95rem;
  line-height: 1.65;
}

/* About */
.about-section {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  background: #fff;
}
.intro-grid {
  display: block;
  max-width: 800px;
}
.hello {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 1rem;
}
.intro-text h1 {
  margin: 0;
  font-size: clamp(2.65rem, 8vw, 3.45rem);
  line-height: .98;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -.035em;
}
.position {
  margin: 14px 0 21px;
  font-size: 1.15rem;
  font-weight: 600;
}
.intro-copy {
  margin: 0 0 24px;
  max-width: 720px;
  color: #333;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.72;
}
.intro-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}
.intro-links a,
.project-link {
  position: relative;
  display: inline-block;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size 200ms var(--ease), color 180ms var(--ease);
}
.intro-links a:hover,
.intro-links a:focus-visible,
.project-link:hover,
.project-link:focus-visible {
  background-size: 100% 1px;
}
.intro-links span { margin-left: 4px; }

.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: clamp(58px, 8vw, 82px);
}
.summary-item {
  position: relative;
  min-height: 90px;
  padding-top: 14px;
}
.summary-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 3px;
  background: var(--yellow);
}
.summary-value {
  display: block;
  margin-bottom: 4px;
  font-size: 1.35rem;
  font-weight: 700;
}
.summary-label {
  display: block;
  color: var(--muted);
  font-family: var(--body);
  font-size: .84rem;
}

/* Experience */
.experience-list { max-width: 980px; }
.experience-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 17px;
  position: relative;
  padding: 0 0 clamp(58px, 8vw, 80px);
}
.experience-item:last-child { padding-bottom: 0; }
.experience-date {
  display: block;
  color: var(--muted);
  font-family: var(--body);
  font-size: .8rem;
}
.experience-date span {
  display: inline-block;
  white-space: nowrap;
}
.experience-body {
  max-width: 770px;
  position: relative;
}
.experience-item.current .experience-body {
  padding: 0;
  margin: 0;
}
.role-line {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 15px;
}
.role-line h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.35;
  text-transform: uppercase;
}
.company {
  margin: 3px 0 0;
  color: var(--red);
  font-size: .88rem;
  font-weight: 600;
}
.current-pill {
  flex: 0 0 auto;
  padding: 4px 7px;
  color: #000;
  background: var(--yellow);
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .055em;
}
.role-summary {
  margin: 0 0 24px;
  color: #333;
  font-family: var(--body);
  line-height: 1.72;
}
.experience-focus {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
  margin: 0 0 24px;
}
.experience-focus > div {
  padding: 17px 18px;
  background: var(--soft);
}
.focus-label {
  display: block;
  margin-bottom: 5px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.experience-focus p {
  margin: 0;
  color: #444;
  font-family: var(--body);
  font-size: .88rem;
  line-height: 1.55;
}
.impact-list {
  margin: 0;
  padding-left: 20px;
  color: #333;
  font-family: var(--body);
  font-size: .93rem;
}
.impact-list li + li { margin-top: 7px; }
.collaboration-note {
  margin-top: 24px;
  max-width: 650px;
  padding: 15px 17px;
  background: var(--soft);
}
.collaboration-note > span {
  display: block;
  margin-bottom: 4px;
  color: #555;
  font-family: var(--body);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.collaboration-note p {
  margin: 0;
  color: #474747;
  font-family: var(--body);
  font-size: .86rem;
  line-height: 1.55;
}
.client-facing-note { background: #fbfbf8; }

/* Projects */
.projects-section { background: var(--soft-2); }
.project-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
.project-feature {
  position: relative;
  min-height: 270px;
  padding: clamp(24px, 4vw, 34px);
  background: #fff;
  box-shadow: 0 8px 28px rgba(0,0,0,.035);
  overflow: hidden;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.project-feature-wide { min-height: 330px; }
.project-number {
  position: absolute;
  top: 20px;
  right: 23px;
  color: #d5d5d1;
  font-size: 1.05rem;
  font-weight: 700;
}
.project-copy { max-width: 670px; }
.project-kicker {
  margin-bottom: 17px;
  color: var(--muted);
  font-family: var(--body);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .055em;
}
.project-feature h3 {
  margin: 0 0 14px;
  max-width: 580px;
  font-size: clamp(1.22rem, 1.13rem + .25vw, 1.48rem);
  line-height: 1.3;
  text-transform: uppercase;
}
.project-feature p {
  margin: 0 0 20px;
  max-width: 650px;
  color: #383838;
  font-family: var(--body);
  font-size: .94rem;
  line-height: 1.68;
}
.project-tech {
  color: #777;
  font-family: var(--body);
  font-size: .78rem;
}
.project-proof {
  margin-top: 35px;
  max-width: 240px;
  padding-top: 14px;
  position: relative;
}
.project-proof::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 3px;
  background: var(--yellow);
}
.project-proof strong {
  display: block;
  font-size: .82rem;
  text-transform: uppercase;
}
.project-proof span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--body);
  font-size: .8rem;
}
.mane-project {
  background: #111;
  color: #fff;
}
.mane-project p { color: #d0d0d0; }
.mane-project .project-kicker,
.mane-project .project-tech { color: #9c9c9c; }
.mane-project .project-number { color: #343434; }
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  color: var(--yellow);
}
.live-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
}
.project-link {
  margin-top: 18px;
  color: #fff;
  font-size: .83rem;
}
.project-link:hover { color: var(--yellow); }

@media (hover:hover) {
  .project-feature:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 34px rgba(0,0,0,.055);
  }
}

/* Technical focus */
.technical-focus {
  display: grid;
  grid-template-columns: 1fr;
  gap: 54px;
}
.technical-core { max-width: 600px; }
.skills-caption {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--body);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.technical-core h3 {
  margin: 0 0 13px;
  font-size: clamp(1.75rem, 1.55rem + .45vw, 2.2rem);
  line-height: 1;
}
.technical-core p {
  margin: 0;
  color: #3f3f3f;
  font-family: var(--body);
  line-height: 1.7;
}
.technical-map { display: grid; }
.technical-row {
  display: grid;
  grid-template-columns: 160px minmax(0,1fr);
  gap: 24px;
  padding: 20px 0;
}
.technical-row + .technical-row { border-top: 1px solid var(--line); }
.technical-row > h3 {
  margin: 2px 0 0;
  color: #555;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.technical-row strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--body);
  font-size: .92rem;
  font-weight: 500;
}
.technical-row p {
  margin: 0;
  color: var(--muted);
  font-family: var(--body);
  font-size: .86rem;
  line-height: 1.55;
}

/* Compact sections */
.compact-section {
  min-height: auto !important;
  padding-top: clamp(68px, 8vw, 90px);
  padding-bottom: clamp(68px, 8vw, 90px);
}
.compact-heading { margin-bottom: 34px; }
.education-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.education-row h3 {
  margin: 0 0 5px;
  font-size: 1rem;
  text-transform: uppercase;
}
.education-row p {
  margin: 0;
  color: #444;
  font-family: var(--body);
}
.education-row > span {
  color: var(--muted);
  font-family: var(--body);
  font-size: .84rem;
}
.interest-section { background: var(--soft-2); }
.interest-layout {
  max-width: 640px;
}
.interest-layout p {
  margin: 0;
  color: #383838;
  font-family: var(--body);
  line-height: 1.75;
}

/* Contact */
.contact-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
}
.contact-list { max-width: 820px; }
.contact-list a {
  display: grid;
  grid-template-columns: 90px 1fr 22px;
  gap: 18px;
  align-items: center;
  min-height: 74px;
  padding: 0 8px;
  color: #111;
  text-decoration: none;
}
.contact-list a + a { border-top: 1px solid var(--line); }
.contact-list span {
  color: var(--muted);
  font-family: var(--body);
  font-size: .76rem;
  text-transform: uppercase;
}
.contact-list strong {
  min-width: 0;
  font-family: var(--body);
  font-size: .92rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.contact-list a {
  transition: opacity 180ms var(--ease);
}
.contact-list a:hover,
.contact-list a:focus-visible {
  color: #000;
  opacity: .68;
}
.contact-list b {
  font-size: .95rem;
  transition: transform 180ms var(--ease);
}
.contact-list a:hover b,
.contact-list a:focus-visible b {
  transform: translate(2px, -2px);
}

/* Gentle reveal: enabled by JS only */
.motion-ready .reveal-item {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 360ms var(--ease), transform 360ms var(--ease);
}
.motion-ready .reveal-item.in-view {
  opacity: 1;
  transform: none;
}

@media (min-width: 650px) {
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
  }
  .experience-focus { grid-template-columns: repeat(2, 1fr); }
  .project-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .project-feature-wide { grid-column: 1 / -1; }
  .education-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
  }
}

@media (min-width: 768px) {
  .experience-item {
    grid-template-columns: 165px minmax(0,1fr);
    gap: 42px;
  }
  .technical-focus {
    grid-template-columns: minmax(240px,.72fr) minmax(0,1.28fr);
    gap: 72px;
    align-items: start;
  }
}

@media (min-width: 992px) {
  body {
    padding-top: 0;
    padding-left: var(--sidebar);
  }
  .side-nav {
    width: var(--sidebar);
    height: 100vh;
    min-height: 100vh;
    flex-direction: column;
    text-align: center;
    padding: 0;
  }
  .profile-link {
    display: flex;
    margin: auto auto 24px;
    padding: 8px;
  }
  .profile-image {
    display: block;
    width: 10rem;
    height: 10rem;
    aspect-ratio: 1;
    border: .35rem solid #fff;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 42%;
    box-shadow: 0 2px 8px rgba(0,0,0,.14);
  }
  .nav-toggle { display: none; }
  .nav-menu {
    display: flex;
    position: static;
    flex-direction: column;
    width: 100%;
    margin-bottom: auto;
    padding: 0 0 10px;
    background: transparent;
  }
  .nav-link {
    padding: 7px 16px;
    font-size: .84rem;
    letter-spacing: .045em;
  }
  .resume-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 5rem clamp(42px, 6vw, 78px);
    scroll-margin-top: 0;
  }
  .projects-section,
  #skills {
    min-height: auto;
    padding-top: 7rem;
    padding-bottom: 7rem;
  }
  .compact-section { display: block; }
}

@media (max-width: 560px) {
  .technical-row {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 18px 0;
  }
}

@media (max-width: 430px) {
  .resume-section { padding-inline: 20px; }
  .intro-text h1 { font-size: 2.5rem; }
  .contact-list a {
    grid-template-columns: 70px 1fr 16px;
    gap: 10px;
  }
  .experience-item.current .experience-body {
    padding: 0;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .motion-ready .reveal-item {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* -------------------------------------------------
   Interaction polish
   ------------------------------------------------- */

.nav-link {
  transition:
    color 180ms var(--ease),
    opacity 180ms var(--ease);
}

.nav-link:not(.active):hover {
  opacity: .92;
}

/* Hero loads in with a restrained stagger. */
.page-loading .hello,
.page-loading .intro-text h1,
.page-loading .position,
.page-loading .intro-copy,
.page-loading .intro-links,
.page-loading .summary-item {
  opacity: 0;
  transform: translateY(8px);
}

.page-ready .hello,
.page-ready .intro-text h1,
.page-ready .position,
.page-ready .intro-copy,
.page-ready .intro-links,
.page-ready .summary-item {
  opacity: 1;
  transform: none;
  transition:
    opacity 420ms var(--ease),
    transform 420ms var(--ease);
}

.page-ready .hello { transition-delay: 30ms; }
.page-ready .intro-text h1 { transition-delay: 80ms; }
.page-ready .position { transition-delay: 130ms; }
.page-ready .intro-copy { transition-delay: 180ms; }
.page-ready .intro-links { transition-delay: 230ms; }
.page-ready .summary-item:nth-child(1) { transition-delay: 280ms; }
.page-ready .summary-item:nth-child(2) { transition-delay: 330ms; }
.page-ready .summary-item:nth-child(3) { transition-delay: 380ms; }

/* Scroll reveal. Kept tiny on purpose. */
.reveal-ready {
  opacity: 0;
  transform: translateY(10px);
}

.reveal-ready.revealed {
  opacity: 1;
  transform: none;
  transition:
    opacity 420ms var(--ease),
    transform 420ms var(--ease);
}

/* Projects feel responsive without looking like product cards. */
.project-feature {
  border: 1px solid transparent;
  transition:
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease),
    border-color 180ms var(--ease);
}

@media (hover:hover) {
  .project-feature:hover {
    transform: translateY(-2px);
    border-color: #e8e8e5;
    box-shadow: 0 13px 34px rgba(0,0,0,.05);
  }

  .mane-project:hover {
    border-color: #242424;
  }
}

/* Summary blocks get a very small response to hover. */
@media (hover:hover) {
  .summary-item {
    transition: transform 180ms var(--ease);
  }
  .summary-item:hover {
    transform: translateY(-1px);
  }
}

/* Contact: no underline animation, only a directional cue. */
.contact-list a {
  transition: opacity 180ms var(--ease);
}

.contact-list a b {
  transition: transform 180ms var(--ease);
}

@media (hover:hover) {
  .contact-list a:hover {
    opacity: .72;
  }

  .contact-list a:hover b {
    transform: translate(3px, -3px);
  }
}

/* Current marker responds very subtly rather than animating continuously. */
.current-pill {
  transition: transform 180ms var(--ease);
}
@media (hover:hover) {
  .experience-item.current:hover .current-pill {
    transform: translateY(-1px);
  }
}

/* Make the desktop sidebar feel less cramped. */
@media (min-width: 992px) {
  .profile-link {
    margin-bottom: 30px;
  }

  .nav-link {
    font-size: .86rem;
    padding-top: 7px;
    padding-bottom: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-loading .hello,
  .page-loading .intro-text h1,
  .page-loading .position,
  .page-loading .intro-copy,
  .page-loading .intro-links,
  .page-loading .summary-item,
  .reveal-ready {
    opacity: 1 !important;
    transform: none !important;
  }
}
