/* Local MiSans files copied from the supplied Desktop/Misans folder. */
@font-face { font-family: MiSans; src: url("assets/fonts/MiSans-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: MiSans; src: url("assets/fonts/MiSans-Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: MiSans; src: url("assets/fonts/MiSans-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

/* Change these values to customize the entire portfolio. */
:root {
  --paper: #fff;
  --ink: #000;
  --muted: #6b6b6b;
  --placeholder: #f1f1f1;
  --page-margin: 10%;
  --heading-size: clamp(52px, 6.25vw, 100px);
  --column-offset: 390px;
  --grid-gap: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: MiSans, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
[hidden] { display: none !important; }

/* Large heading, quiet white space, fixed name and navigation control. */
.site-header { position: relative; min-height: 315px; margin: 0 var(--page-margin); padding-top: 7px; }
.site-name, .page-label { font-size: var(--heading-size); font-weight: 700; line-height: 1.12; letter-spacing: -0.045em; }
/* Match the reference: white text with difference blending inverts what is behind it. */
.site-name { position: fixed; z-index: 12; top: 7px; left: var(--page-margin); color: #fff; mix-blend-mode: difference; }
.page-label { margin: 0 0 0 var(--column-offset); }
.menu-button { position: fixed; z-index: 21; top: 24px; right: 6.8%; display: grid; align-content: center; gap: 8px; width: 64px; height: 64px; padding: 14px; background: var(--paper); border: 1px solid #e5e5e5; border-radius: 50%; list-style: none; cursor: pointer; }
.menu-button span { display: block; width: 34px; height: 3px; background: currentColor; }

/* Apple lineup-inspired category bar: local CSS, native horizontal scrolling. */
main { margin: 0 var(--page-margin) 170px; scroll-margin-top: 115px; }
.project-filters { margin-bottom: 48px; }
.project-filters h2 { margin: 0 0 16px; color: var(--muted); font-size: 16px; font-weight: 400; }
.filter-control { position: relative; width: fit-content; max-width: 100%; }
.filter-scroll { width: max-content; max-width: 100%; overflow-x: auto; border-radius: 999px; scrollbar-width: none; scroll-padding-inline: 50px; }
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-paddle { position: absolute; z-index: 1; top: 0; display: grid; place-items: center; width: 50px; height: 56px; background: #e8e8ed; }
.filter-paddle.previous { left: 0; border-radius: 999px 0 0 999px; }
.filter-paddle.next { right: 0; border-radius: 0 999px 999px 0; }
.filter-paddle span { width: 8px; height: 8px; border-top: 2px solid #6b6b6b; border-right: 2px solid #6b6b6b; transform: rotate(45deg); }
.filter-paddle.previous span { transform: rotate(-135deg); }
.filter-options { display: flex; width: max-content; padding: 6px; background: #e8e8ed; border-radius: 999px; }
.filter-options button { flex: none; min-height: 44px; padding: 10px 22px; color: #1d1d1f; border-radius: 999px; font-size: 16px; font-weight: 500; line-height: 24px; white-space: nowrap; }
.filter-options button[aria-pressed="true"] { background: #1d1d1f; color: #fff; }
.filter-options button:hover:not([aria-pressed="true"]) { color: #000; background: #dedee3; }
.filter-options button:focus-visible { outline: 2px solid #0071e3; outline-offset: 2px; }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.project-card { display: block; width: 100%; padding: 0; text-align: left; }
.image-placeholder { display: grid; place-items: center; aspect-ratio: 1.44; width: 100%; background: var(--placeholder); color: var(--muted); font-size: 15px; font-weight: 400; }
.project-card img { display: block; width: 100%; aspect-ratio: 1.44; object-fit: cover; }
.project-card:hover .image-placeholder { background: #e9e9e9; }

.site-footer { position: relative; margin: 0 var(--page-margin) 16px; padding-top: 10px; border-top: 1px solid #808080; font-size: 18px; line-height: 1.45; scroll-margin-top: 120px; overflow-wrap: anywhere; }
.site-footer h2 { margin: 0; font-size: inherit; }
.site-footer p { margin: 0; }
.site-footer small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.contact-placeholder { text-decoration: underline; text-underline-offset: 2px; }

/* The white blur covers content while the name and navigation stay sharp. */
.menu-backdrop { display: none; position: fixed; z-index: 10; inset: 0; background: rgb(255 255 255 / 65%); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
body:has(.site-navigation[open]) { overflow: hidden; }
body:has(.site-navigation[open]) .menu-backdrop { display: block; }

/* Unboxed links drop beneath the page heading on the same alignment. */
.menu-button::-webkit-details-marker { display: none; }
.site-navigation nav { --menu-top: calc(var(--heading-size) * 1.12 + 27px); position: fixed; z-index: 20; top: var(--menu-top); left: calc(var(--page-margin) + var(--column-offset)); right: var(--page-margin); display: flex; flex-direction: column; gap: 0; max-height: calc(100dvh - var(--menu-top) - 24px); margin: 0; padding: 0 0 0.15em; overflow-y: auto; border: 0; background: transparent; font-size: var(--heading-size); font-weight: 700; line-height: 1.12; letter-spacing: -0.045em; }
.site-navigation nav a { width: fit-content; }
.site-navigation nav a:hover, .site-navigation nav [aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.site-navigation[open] .menu-button span:first-child { transform: translateY(11px) rotate(45deg); }
.site-navigation[open] .menu-button span:nth-child(2) { visibility: hidden; }
.site-navigation[open] .menu-button span:last-child { transform: translateY(-11px) rotate(-45deg); }

/* Shared twelve-column grid: use the same columns for images and text. */
.layout-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--grid-gap); }
.layout-grid > * { min-width: 0; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: 1 / -1; }
.centered { grid-column: 3 / span 8; }
.content-offset { grid-column: 5 / -1; }
.project-intro { margin-bottom: 72px; }
.project-summary h1 { margin: 0 0 24px; font-size: clamp(36px, 4vw, 64px); line-height: 1.08; letter-spacing: -0.045em; overflow-wrap: anywhere; }
.project-summary p { max-width: 60ch; margin: 0; font-size: 22px; line-height: 1.5; }
.back-link, .text-link { text-decoration: underline; text-underline-offset: 4px; }
.back-link { display: inline-block; margin: 2px 0 30px; }
.metadata { margin: 0; font-size: 16px; line-height: 1.6; }
.metadata > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); padding-right: 20px; }
.metadata dt { color: var(--muted); }
.metadata dd { margin: 0; overflow-wrap: anywhere; }
.gallery-single, .gallery-row { margin-bottom: 24px; }
.media { display: flex; flex-direction: column; margin: 0; }
.media-frame { display: grid; place-items: center; width: 100%; background: var(--placeholder); color: var(--muted); font-size: 15px; }
.media img { display: block; width: 100%; object-fit: cover; }
.wide, .media img.wide { aspect-ratio: 16 / 9; }
.landscape, .media img.landscape { aspect-ratio: 1.44; }
.portrait, .media img.portrait { aspect-ratio: 3 / 4; }
.gallery-row .media-frame, .gallery-row .media img { height: clamp(240px, 32vw, 520px); aspect-ratio: auto; }
.media figcaption { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.text-section { margin: 88px 0; }
.section-label { margin: 0; font-size: 18px; font-weight: 400; line-height: 1.6; color: var(--muted); }
.reading-text { max-width: 68ch; font-size: 18px; line-height: 1.65; }
.reading-text h3 { margin: 0 0 20px; font-size: 28px; font-weight: 400; line-height: 1.2; letter-spacing: -0.025em; }
.reading-text p { margin: 0 0 24px; }
.reading-text p:last-child { margin-bottom: 0; }
.project-pagination { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: center; margin-top: 80px; padding-top: 24px; border-top: 1px solid #808080; }
.project-pagination a { min-width: 0; padding: 8px 0; }
.project-pagination a:last-child { text-align: right; }
.project-pagination span { display: block; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.project-pagination strong { display: block; font-size: 20px; font-weight: 400; overflow-wrap: anywhere; }
.project-pagination a:hover strong, .project-pagination .all-projects:hover { text-decoration: underline; text-underline-offset: 4px; }
.expertise-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px var(--grid-gap); margin: 0; padding: 0; list-style: none; font-size: 18px; line-height: 1.5; }
.contact-list { margin: 0; font-size: 22px; line-height: 1.5; }
.contact-list > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 20px; margin-bottom: 24px; }
.contact-list dt { font-size: 16px; color: var(--muted); }
.contact-list dd { margin: 0; overflow-wrap: anywhere; }
.contact-profiles { margin: 0; padding: 0; list-style: none; font-size: 18px; line-height: 2; }

.screen-reader-only, .skip-link { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 10; top: 8px; left: 8px; width: auto; height: auto; padding: 12px; background: var(--paper); clip-path: none; }

/* Landing page: introduction first, then a focused preview of the work. */
.home-page .site-header { min-height: 240px; }
.landing-intro { margin-bottom: 72px; }
.landing-intro h1 { margin: 0 0 28px; font-size: clamp(44px, 5.4vw, 80px); font-weight: 700; line-height: 1.12; letter-spacing: -0.045em; overflow-wrap: anywhere; }
.landing-description { max-width: 48ch; margin: 0; font-size: 22px; line-height: 1.6; }
.landing-links { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 28px; font-size: 18px; }
.landing-cover { margin-bottom: 100px; }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: baseline; margin-bottom: 32px; }
.section-heading h2 { margin: 0; font-size: 32px; font-weight: 500; line-height: 1.2; letter-spacing: -0.025em; }

/* Tablet: retain the two-column grid while bringing the categories inward. */
@media (min-width: 781px) and (max-width: 1150px) {
  :root { --page-margin: 6%; --column-offset: 300px; }
}

/* Phone: smaller heading, readable two-column category list, single-column projects. */
@media (max-width: 780px) {
  :root { --page-margin: 4%; --heading-size: 28px; --column-offset: 114px; }
  .site-header { min-height: 150px; padding-top: 8px; }
  .home-page .site-header { min-height: 150px; }
  .landing-intro { row-gap: 20px; margin-bottom: 40px; }
  .landing-intro h1 { margin-bottom: 20px; font-size: 42px; }
  .landing-description { font-size: 18px; }
  .landing-links { font-size: 16px; margin-top: 22px; }
  .landing-cover { margin-bottom: 56px; }
  .section-heading { gap: 16px; margin-bottom: 24px; }
  .section-heading h2 { font-size: 24px; }
  .section-heading .text-link { flex: none; font-size: 14px; }
  .site-name { top: 8px; }
  .page-label { letter-spacing: -0.035em; }
  .menu-button { top: 8px; right: var(--page-margin); width: 44px; height: 44px; gap: 5px; padding: 11px; }
  .menu-button span { width: 20px; height: 2px; }
  main { margin-bottom: 100px; scroll-margin-top: 70px; }
  .project-filters { margin-bottom: 32px; }
  .project-filters h2 { font-size: 14px; margin-bottom: 12px; }
  .filter-options button { font-size: 14px; padding-inline: 20px; }
  .project-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .image-placeholder { font-size: 14px; }
  .site-footer { font-size: 14px; line-height: 1.5; }
  .site-navigation nav { --menu-top: 64px; }
  .site-navigation[open] .menu-button span:first-child { transform: translateY(7px) rotate(45deg); }
  .site-navigation[open] .menu-button span:last-child { transform: translateY(-7px) rotate(-45deg); }
  .layout-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .col-4, .col-6, .col-8, .col-12, .centered, .content-offset { grid-column: 1 / -1; }
  .project-intro { gap: 32px; margin-bottom: 40px; }
  .project-intro > .section-label { display: none; }
  .project-meta { display: flex; flex-direction: column; }
  .project-summary { grid-row: 1; }
  .project-summary h1 { margin-bottom: 18px; font-size: 36px; }
  .project-summary p { font-size: 18px; }
  .back-link { margin: 0 0 18px; }
  .metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; font-size: 14px; }
  .metadata > div { display: block; padding-right: 0; }
  .media-frame { font-size: 14px; }
  .gallery-row .media-frame, .gallery-row .media img { height: auto; aspect-ratio: 1.44; }
  .gallery-row { row-gap: 24px; }
  .gallery-single, .gallery-row { margin-bottom: 24px; }
  .text-section { margin: 48px 0; gap: 16px; }
  .section-label { font-size: 16px; }
  .reading-text { font-size: 16px; line-height: 1.65; }
  .reading-text h3 { font-size: 24px; margin-bottom: 16px; }
  .project-pagination { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 48px; }
  .project-pagination .all-projects { grid-column: 1 / -1; grid-row: 2; text-align: center; }
  .project-pagination strong { font-size: 16px; }
  .project-pagination span { font-size: 13px; }
  .expertise-list { font-size: 16px; gap: 16px; }
  .contact-list { font-size: 18px; }
  .contact-list > div { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; }
  .contact-profiles { font-size: 16px; }

}

@media (max-width: 359px) {
  :root { --column-offset: 100px; --heading-size: 25px; }
  .filter-options button { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
