/* Home page — uses tokens.css + layout.css variables */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.layout {
  margin: 0;
  background: var(--color-page-bg);
  color: var(--color-black);
  font-family: var(--text-body-1-family);
  font-size: var(--text-body-1-size);
  font-weight: var(--text-body-1-weight);
  line-height: var(--text-body-1-line-height);
  letter-spacing: var(--text-body-1-letter-spacing);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  font-synthesis: none;
  font-optical-sizing: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Full-bleed chrome — same horizontal inset as header (20px desktop, 16px compact) */
.site-header__bar {
  width: 100%;
  padding-inline: var(--chrome-header-padding-inline);
  box-sizing: border-box;
}

.site-footer__bar {
  width: 100%;
  padding-inline: var(--chrome-header-padding-inline);
  padding-block: var(--chrome-footer-padding-block);
  box-sizing: border-box;
}

@media (max-width: 1023px) {
  .site-header__bar {
    padding-inline: var(--layout-page-inline-mobile, 16px);
  }

  .site-footer__bar {
    padding-inline: var(--layout-page-inline-mobile, 16px);
  }
}

.site-header__inner,
.site-footer__inner {
  width: 100%;
  max-width: none;
}

/* Header — bar scrolls, center pill fixed; matches page canvas (no white strip) */
.site-header {
  background: var(--color-page-bg);
  position: relative;
  z-index: 1;
}

.site-header__inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
}

/* Logo 1:175 — Portfolio/H4 (Inter wordmark) */
.site-header__logo {
  padding-top: 2px;
  flex: 0 0 200px;
  width: 200px;
  max-width: 200px;
  font-family: var(--text-h4-family);
  font-size: var(--text-h4-size);
  font-weight: var(--text-h4-weight);
  line-height: var(--text-h4-line-height);
  letter-spacing: var(--text-h4-letter-spacing);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  color: var(--color-black);
  white-space: nowrap;
}

.site-header__logo:hover {
  text-decoration: none;
  opacity: 0.72;
}

/* Center nav — fixed; frosted glass (Apple-style backdrop blur + translucency) */
.site-header__nav--pill {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 48px;
  padding: 0 24px;
  margin: 0;
  background: var(--chrome-glass-fill);
  border: 1px solid var(--chrome-glass-border);
  border-radius: 32px;
  box-sizing: border-box;
  list-style: none;
  box-shadow: var(--chrome-glass-shadow);
  -webkit-backdrop-filter: blur(var(--chrome-glass-blur))
    saturate(var(--chrome-glass-saturate));
  backdrop-filter: blur(var(--chrome-glass-blur)) saturate(var(--chrome-glass-saturate));
}

@supports not (
  (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
) {
  .site-header__nav--pill {
    background: var(--chrome-glass-fill-fallback);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header__nav--pill {
    background: var(--chrome-glass-fill-fallback);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Tablet + mobile: dock pill nav to bottom (32px + home indicator safe area) */
@media (max-width: 1023px) {
  .site-header__nav--pill {
    top: auto;
    bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  }

  /* Reserve space so main/footer aren’t covered by the fixed pill */
  body.layout {
    padding-bottom: calc(32px + 48px + 28px + env(safe-area-inset-bottom, 0px));
  }
}

.site-header__nav--pill a {
  font-family: var(--text-chrome-nav-pill-family);
  font-size: var(--text-chrome-nav-pill-size);
  font-weight: var(--text-chrome-nav-pill-weight);
  line-height: var(--text-chrome-nav-pill-line-height);
  letter-spacing: var(--text-chrome-nav-pill-letter-spacing);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  color: var(--color-black);
  white-space: nowrap;
}

.site-header__nav--pill a:hover {
  text-decoration: none;
  opacity: 0.65;
}

/* Email + copy 1:177 — 200px, 4px gap, Portfolio/Body 1 */
.site-header__email {
  flex: 0 0 200px;
  width: 200px;
  max-width: 200px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.site-header__email-link {
  font-family: var(--text-body-1-family);
  font-size: var(--text-body-1-size);
  font-weight: var(--text-body-1-weight);
  line-height: var(--text-body-1-line-height);
  letter-spacing: var(--text-body-1-letter-spacing);
  color: var(--color-black);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header__copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  color: var(--color-icon-muted);
  cursor: pointer;
}

.site-header__copy:hover {
  opacity: 0.65;
}

.site-header__copy:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
}

.site-header__copy-icon {
  display: block;
}

@media (max-width: 900px) {
  .site-header__inner {
    flex-wrap: wrap;
    row-gap: 12px;
    padding-bottom: 12px;
  }

  .site-header__nav--pill {
    gap: 20px;
    padding: 0 18px;
    max-width: calc(100vw - 2rem);
    flex-wrap: wrap;
    justify-content: center;
    height: auto;
    min-height: 48px;
    padding-block: 10px;
  }

  .site-header__logo {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
  }

  .site-header__email {
    flex: 0 1 auto;
    width: auto;
    max-width: calc(100% - 8rem);
  }
}

/* Footer — Figma node 1:163 */
.site-footer {
  background: var(--color-grey-00);
  margin-top: auto;
}

/* Same row model as .site-header__inner: full width, space-between, edges aligned to bar */
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  box-sizing: border-box;
}

.site-footer__meta {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 4px;
  row-gap: 4px;
  font-family: var(--text-body-1-family);
  font-size: var(--text-body-1-size);
  font-weight: var(--text-body-1-weight);
  line-height: var(--text-body-1-line-height);
}

/* Figma: “Made by…” black; © grey-700 (GT America in file — SF Pro here) */
.site-footer__by {
  color: var(--color-black);
  white-space: nowrap;
}

.site-footer__year {
  color: var(--color-grey-700);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  flex: 0 0 auto;
  font-family: var(--text-body-1-family);
  font-size: var(--text-body-1-size);
  font-weight: var(--text-body-1-weight);
  line-height: var(--text-body-1-line-height);
  letter-spacing: var(--text-body-1-letter-spacing);
}

.site-footer__links a {
  color: var(--color-black);
  white-space: nowrap;
}

@media (max-width: 1023px) {
  .site-footer__bar {
    padding-block: 0;
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .site-footer__meta {
    justify-content: center;
    text-align: center;
  }

  .site-footer__links {
    justify-content: center;
    width: 100%;
  }
}

/* Sections */
.section {
  padding-block: 4rem;
}

.section:first-of-type {
  padding-top: 3rem;
}

@media (max-width: 767px) {
  .section {
    padding-block: calc(4rem * 2 / 3);
  }

  .section:first-of-type {
    padding-top: calc(3rem * 2 / 3);
  }
}

.section__title {
  margin: 0 0 3rem;
  font-family: var(--text-h1-family);
  font-size: var(--text-h1-size);
  font-weight: var(--text-h1-weight);
  line-height: var(--text-h1-line-height);
  letter-spacing: var(--text-h1-letter-spacing);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-wrap: balance;
}

/* Figma Section 1 — node 1:97 */
.section--intro {
  padding-left: 4px;
}

@media (max-width: 1023px) {
  .section--intro {
    padding-left: 0;
  }
}

.intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  max-width: 864px;
}

.intro__portrait {
  width: 96px;
  height: 96px;
  border-radius: 1000px;
  overflow: hidden;
  flex-shrink: 0;
}

.intro__portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro__copy {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.intro__lead,
.intro__sub {
  margin: 0;
  font-family: var(--text-h1-family);
  font-size: var(--text-h1-size);
  font-weight: var(--text-h1-weight);
  line-height: var(--text-h1-line-height);
  letter-spacing: var(--text-h1-letter-spacing);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

.intro__lead {
  color: var(--color-black);
}

.intro__sub {
  color: var(--color-grey-700);
}

@media (max-width: 640px) {
  .intro__lead,
  .intro__sub {
    font-size: clamp(1.375rem, 5.2vw, 2.5rem);
    line-height: 1.2;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Works — Figma node 1:103 */
.section--works .section__title {
  margin-bottom: 2rem;
}

.works-grid {
  align-items: start;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  min-width: 0;
  padding: 32px;
  box-sizing: border-box;
  background: var(--color-white);
  border-radius: 32px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 0.3s cubic-bezier(0, 0, 0.5, 1),
    transform 0.3s cubic-bezier(0, 0, 0.5, 1);
}

.project-card--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.project-card--link:hover {
  text-decoration: none;
}

@media (hover: hover) {
  .project-card--link:hover {
    box-shadow: var(--shadow-card-hover);
    transform: scale3d(1.01, 1.01, 1.01);
  }
}

.project-card--link:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .project-card {
    transition: none;
  }

  @media (hover: hover) {
    .project-card--link:hover {
      transform: none;
    }
  }
}

/* Image zone: fixed 520:421 so shape scales with card width on any viewport */
.project-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 520 / 421;
  flex-shrink: 0;
  background: transparent;
}

.project-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  flex-shrink: 0;
}

.project-card__text {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 16px;
  align-items: stretch;
  text-align: left;
}

.project-card__title {
  margin: 0;
  font-family: var(--text-h3-family);
  font-size: var(--text-h3-size);
  font-weight: var(--text-h3-weight);
  line-height: var(--text-h3-line-height);
  letter-spacing: var(--text-h3-letter-spacing);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  color: var(--color-black);
}

.project-card__meta {
  margin: 0;
  font-family: var(--text-body-1-family);
  font-size: var(--text-body-1-size);
  font-weight: var(--text-body-1-weight);
  line-height: var(--text-body-1-line-height);
  letter-spacing: var(--text-body-1-letter-spacing);
  color: var(--color-grey-700);
}

.project-card__pill {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 48px;
  padding: 0 20px;
  border: none;
  border-radius: 32px;
  font-family: var(--text-body-1-family);
  font-size: var(--text-body-1-size);
  font-weight: var(--text-body-1-weight);
  line-height: var(--text-body-1-line-height);
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.project-card__pill--muted {
  background: var(--color-grey-00);
  color: var(--color-black);
}

.project-card__lock {
  flex-shrink: 0;
  color: var(--color-icon-muted);
}

@media (max-width: 640px) {
  .project-card__footer {
    flex-wrap: wrap;
  }

  .project-card__text {
    padding-right: 0;
    flex: 1 1 100%;
  }

  .project-card__pill {
    margin-top: 4px;
  }
}

/* Highlights list */
.highlights__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.highlights__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 2rem;
  align-items: start;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--color-grey-400);
}

.highlights__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  text-align: right;
  min-width: 3.5rem;
}

.highlights__item:first-child {
  padding-top: 0;
}

.highlights__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.highlights__primary {
  margin: 0;
  font-family: var(--text-h4-family);
  font-size: var(--text-h4-size);
  font-weight: var(--text-h4-weight);
  line-height: var(--text-h4-line-height);
  letter-spacing: var(--text-h4-letter-spacing);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  color: var(--color-black);
}

/* Title row = link + external arrow (Figma: heading + ArrowOutside) */
.highlights__heading-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  font-family: var(--text-h4-family);
  font-size: var(--text-h4-size);
  font-weight: var(--text-h4-weight);
  line-height: var(--text-h4-line-height);
  letter-spacing: var(--text-h4-letter-spacing);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  color: var(--color-black);
  text-decoration: none;
}

.highlights__heading-link:hover {
  text-decoration: none;
  opacity: 0.72;
}

.highlights__heading-link:hover .highlights__arrow {
  color: var(--color-grey-700);
}

.highlights__heading-text {
  min-width: 0;
}

.highlights__arrow {
  flex-shrink: 0;
  color: var(--color-icon-muted);
}

.highlights__secondary {
  margin: 0.5rem 0 0;
  color: var(--color-grey-700);
  font-size: var(--text-body-1-size);
  line-height: var(--text-prose-line-height);
}

.highlights__year {
  margin: 0;
  color: var(--color-grey-700);
  font-size: var(--text-body-1-size);
  line-height: var(--text-body-1-line-height);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .highlights__item {
    grid-template-columns: 1fr;
  }

  .highlights__aside {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    text-align: left;
  }
}

/* Inline SVG icons: stroke/fill currentColor — pair with token for gray glyphs */
.u-icon-muted {
  color: var(--color-icon-muted);
}
