/* ==========================================================================
   Christian Hart — Portfolio
   Design tokens are modeled after a modern editorial photography-portfolio
   aesthetic: huge viewport-scaled type, a 12-col grid, a fixed hairline
   header, and a frosted "glass" floating nav pill.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Inter:wght@400;500;600&display=swap');

:root {
  /* ---- color ---- */
  --color-bg: #fbfaf8;
  --color-text: #0d0d0c;
  --color-text-70: rgba(13, 13, 12, .68);
  --color-text-45: rgba(13, 13, 12, .45);
  --color-border: rgba(13, 13, 12, .12);
  --color-white: #fff;

  /* the floating nav is a dark "liquid glass" pill regardless of page theme */
  --nav-glass: rgba(14, 14, 13, .78);
  --nav-content: #fdfdfc;
  --nav-light: hsla(0, 0%, 100%, .5);
  --nav-dark: rgba(0, 0, 0, .5);
  --nav-reflex-light: .75;
  --nav-reflex-dark: .75;
  --nav-radius: clamp(14px, 2vw, 22px);
  --nav-height: clamp(52px, 8svh, 64px);
  --nav-padding: 6px;
  --nav-bottom: clamp(16px, 4svh, 32px);
  --nav-saturation: 180%;

  /* ---- motion ---- */
  --ease-out: cubic-bezier(.104, .204, .492, 1);
  --ease-hover: cubic-bezier(.306, .968, .632, 1);
  --dur-fast: .35s;
  --dur-page: .6s;

  /* ---- grid ---- */
  --grid-margin: 60px;
  --grid-gap: 24px;
  --header-height: clamp(4.5rem, 11svh, 6.5rem);

  /* ---- type ---- */
  --font-serif: 'Fraunces', 'Iowan Old Style', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --fs-2xs: .75rem;
  --fs-xs: .8125rem;
  --fs-s: .95rem;
  --fs-m: clamp(1.05rem, .85vw + .85rem, 1.35rem);
  --fs-l: clamp(1.5rem, 1.6vw + 1rem, 2.25rem);
  --fs-xl: clamp(2.25rem, 3.4vw + 1rem, 4rem);
  --fs-2xl: clamp(3rem, 5.6vw + 1rem, 6.5rem);
  --fs-hero: clamp(2.6rem, 5.6vw + 1.4rem, 8.25rem);

  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 22px;
}

@media (max-width: 52.125em) {
  :root {
    --grid-margin: 24px;
    --grid-gap: 16px;
    --header-height: clamp(3.75rem, 10svh, 5rem);
  }
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  width: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-s);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body.--is-loading { overflow: hidden; height: 100svh; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }

::selection { background: var(--color-text); color: var(--color-bg); }

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

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.wrap {
  padding-left: var(--grid-margin);
  padding-right: var(--grid-margin);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
}

@media (max-width: 52.125em) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

main.view {
  min-height: 100svh;
  padding-top: var(--header-height);
}

/* ==========================================================================
   Loading screen
   ========================================================================== */

.loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--grid-margin);
  transition: opacity .7s var(--ease-out), visibility .7s var(--ease-out);
}

.loader__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.loader__name { font-size: var(--fs-l); }

.loader__count {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: var(--fs-m);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-45);
}

.loader__bar {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin-top: 18px;
  position: relative;
  overflow: hidden;
}

.loader__bar span {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--color-text);
  transform-origin: 0 50%;
  transition: width .25s linear;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .loader { transition: opacity .2s linear; }
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  z-index: 60;
  pointer-events: none;
  transition: translate var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

.site-header[data-hidden="true"] {
  translate: 0 -100%;
  opacity: 0;
}

.site-header__inner {
  height: 100%;
  padding: 0 var(--grid-margin);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: .35em;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-m);
  position: relative;
  padding: .2em 0;
}

.brand__name { position: relative; display: inline-block; }

.brand__underline {
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: currentColor;
  scale: 0 1;
  transform-origin: 0 50%;
  transition: scale var(--dur-fast) var(--ease-out);
}

.brand:hover .brand__underline {
  scale: 1 1;
  transition: scale var(--dur-fast) var(--ease-hover);
}

.header__meta {
  pointer-events: auto;
  font-size: var(--fs-xs);
  color: var(--color-text-45);
  letter-spacing: .01em;
}

@media (max-width: 52.125em) {
  .header__meta { display: none; }
}

/* ==========================================================================
   Floating glass nav
   ========================================================================== */

.float-nav {
  position: fixed;
  left: 0; right: 0;
  bottom: var(--nav-bottom);
  z-index: 70;
  width: fit-content;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: var(--nav-padding);
  height: var(--nav-height);
  border-radius: var(--nav-radius);
  background-color: color-mix(in srgb, var(--nav-glass) 62%, transparent);
  backdrop-filter: blur(14px) saturate(var(--nav-saturation));
  -webkit-backdrop-filter: blur(14px) saturate(var(--nav-saturation));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--nav-light) calc(var(--nav-reflex-light) * 10%), transparent),
    inset 1.8px 3px 0 -2px color-mix(in srgb, var(--nav-light) calc(var(--nav-reflex-light) * 90%), transparent),
    inset -2px -2px 0 -2px color-mix(in srgb, var(--nav-light) calc(var(--nav-reflex-light) * 80%), transparent),
    inset -.3px -1px 4px color-mix(in srgb, var(--nav-dark) calc(var(--nav-reflex-dark) * 12%), transparent),
    0 6px 16px color-mix(in srgb, var(--nav-dark) calc(var(--nav-reflex-dark) * 12%), transparent),
    0 6px 20px rgba(0, 0, 0, .18);
  transition: opacity .5s var(--ease-out), translate .5s var(--ease-out);
}

.float-nav[data-hidden="true"] {
  opacity: 0;
  translate: 0 12px;
  pointer-events: none;
}

.float-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 clamp(14px, 2vw, 22px);
  border-radius: calc(var(--nav-radius) - 4px);
  color: color-mix(in srgb, var(--nav-content) 68%, transparent);
  font-size: var(--fs-xs);
  letter-spacing: .01em;
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

.float-nav__link:hover { color: var(--nav-content); }

.float-nav__link[aria-current="page"] {
  color: var(--nav-content);
  background: rgba(255, 255, 255, .12);
}

/* ==========================================================================
   Custom cursor
   ========================================================================== */

.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--color-text);
  pointer-events: none;
  z-index: 200;
  mix-blend-mode: difference;
  transition: width .25s var(--ease-out), height .25s var(--ease-out), margin .25s var(--ease-out), opacity .2s;
  will-change: transform;
}

.cursor-dot[data-hover="true"] {
  width: 56px; height: 56px;
  margin: -28px 0 0 -28px;
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot { display: none; }
}

/* ==========================================================================
   Hero (home)
   ========================================================================== */

.hero {
  min-height: calc(100svh - var(--header-height));
  display: flex;
  align-items: center;
  padding: 0 var(--grid-margin) 8vh;
}

.hero__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-hero);
  line-height: 1.02;
  letter-spacing: -.01em;
  max-width: 15ch;
}

.hero__line { overflow: hidden; display: block; }

.hero__word { display: inline-block; }

.js .hero__word {
  translate: 0 105%;
  transition: translate .9s var(--ease-out);
}

.hero__title em {
  font-style: italic;
  color: var(--color-text-70);
}

.js .hero.is-in .hero__word { translate: 0 0; }

.hero__word:nth-child(1) { transition-delay: .05s; }
.hero__word:nth-child(2) { transition-delay: .11s; }
.hero__word:nth-child(3) { transition-delay: .17s; }
.hero__word:nth-child(4) { transition-delay: .23s; }
.hero__word:nth-child(5) { transition-delay: .29s; }
.hero__word:nth-child(6) { transition-delay: .35s; }
.hero__word:nth-child(7) { transition-delay: .41s; }
.hero__word:nth-child(8) { transition-delay: .47s; }

.hero__scroll {
  position: absolute;
  bottom: max(3vh, 24px);
  left: var(--grid-margin);
  font-size: var(--fs-2xs);
  color: var(--color-text-45);
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero__scroll-line {
  width: 26px; height: 1px;
  background: var(--color-text-45);
  position: relative;
  overflow: hidden;
}

.hero__scroll-line::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--color-text);
  animation: scrollline 1.8s var(--ease-out) infinite;
}

@keyframes scrollline {
  0% { translate: -100% 0; }
  50% { translate: 0 0; }
  100% { translate: 100% 0; }
}

/* ==========================================================================
   Section heading pattern
   ========================================================================== */

.page-head {
  padding: 6vh var(--grid-margin) 4vh;
}

.page-head__eyebrow {
  font-size: var(--fs-2xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-45);
  margin-bottom: 14px;
}

.page-head__title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-2xl);
  line-height: 1;
}

/* ==========================================================================
   Photo grid + distortion tiles
   ========================================================================== */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
  padding: 0 var(--grid-margin) 10vh;
}

@media (max-width: 52.125em) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 32em) {
  .photo-grid { grid-template-columns: 1fr; }
}

.tile {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-s);
  background: var(--color-border);
  cursor: pointer;
}

.tile--wide { aspect-ratio: 3 / 2; }

.tile img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: scale .6s var(--ease-out);
}

.tile canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}

.no-touch .tile:hover img { scale: 1.03; }

.tile__meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-2xs);
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, .45), transparent);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.no-touch .tile:hover .tile__meta { opacity: 1; }

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(10, 10, 9, .96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease-out);
}

.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox__img {
  max-width: min(92vw, 1400px);
  max-height: 86svh;
  object-fit: contain;
  scale: .97;
  transition: scale .4s var(--ease-out);
}

.lightbox.is-open .lightbox__img { scale: 1; }

.lightbox__btn {
  position: absolute;
  color: #fff;
  opacity: .7;
  transition: opacity .2s;
  padding: 12px;
}

.lightbox__btn:hover { opacity: 1; }
.lightbox__close { top: 20px; right: max(20px, var(--grid-margin)); }
.lightbox__prev { left: max(10px, calc(var(--grid-margin) / 2)); top: 50%; translate: 0 -50%; }
.lightbox__next { right: max(10px, calc(var(--grid-margin) / 2)); top: 50%; translate: 0 -50%; }

.lightbox__count {
  position: absolute;
  bottom: 24px; left: 50%;
  translate: -50% 0;
  color: rgba(255, 255, 255, .6);
  font-size: var(--fs-2xs);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Projects
   ========================================================================== */

.project-list {
  padding: 0 var(--grid-margin) 12vh;
  display: flex;
  flex-direction: column;
}

.project-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: 5vh 0;
  border-top: 1px solid var(--color-border);
}

.project-list .project-card:last-child { border-bottom: 1px solid var(--color-border); }

@media (max-width: 52.125em) {
  .project-card { grid-template-columns: 1fr; gap: 20px; }
}

.project-card--featured {
  grid-template-columns: 1fr;
  border-top: none;
  padding-top: 0;
  gap: clamp(24px, 4vw, 44px);
}

.project-card--featured .project-card__media { aspect-ratio: 16 / 9; }
.project-card--featured .project-card__body { max-width: 64ch; }
.project-card--featured .project-card__title { font-size: var(--fs-2xl); }
.project-card--featured .project-card__index { color: var(--color-text); font-style: italic; font-family: var(--font-serif); }

.project-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-m);
  background: linear-gradient(135deg, #efece6, #dcd7cc);
}

.project-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project-card__media canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.project-card__media--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-m);
  color: var(--color-text-45);
  text-align: center;
  padding: 2em;
}

.project-card__body { max-width: 42ch; }

.project-card__index {
  font-size: var(--fs-2xs);
  color: var(--color-text-45);
  margin-bottom: 10px;
}

.project-card__title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-xl);
  line-height: 1.05;
  margin-bottom: 14px;
}

.project-card__desc { color: var(--color-text-70); margin-bottom: 18px; }

.project-card__tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 22px;
}

.project-card__tags li {
  font-size: var(--fs-2xs);
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-70);
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-s);
  position: relative;
  padding-bottom: 4px;
}

.project-card__link::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  scale: 1 1;
  transform-origin: 0 50%;
  transition: scale .3s var(--ease-hover);
}

.project-card__link:hover::after { scale: 0 1; transform-origin: 100% 50%; }

.project-card__link svg { transition: translate .3s var(--ease-out); }
.project-card__link:hover svg { translate: 3px -3px; }

/* ==========================================================================
   About
   ========================================================================== */

.about {
  padding: 6vh var(--grid-margin) 12vh;
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: clamp(32px, 6vw, 90px);
}

@media (max-width: 52.125em) {
  .about { grid-template-columns: 1fr; }
}

.about__portrait {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-m);
}

.about__portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.about__name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-2xl);
  line-height: 1;
  margin-bottom: 28px;
}

.about__bio { max-width: 62ch; }
.about__bio p { color: var(--color-text-70); margin-bottom: 1.1em; }

.contact-list { margin-top: 4vh; border-top: 1px solid var(--color-border); }

.contact-list__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}

@media (max-width: 30em) {
  .contact-list__row { flex-direction: column; align-items: flex-start; gap: 6px; }
}

.contact-list__label { color: var(--color-text-45); font-size: var(--fs-2xs); letter-spacing: .04em; text-transform: uppercase; }

.contact-list__value {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-m);
  position: relative;
}

a.contact-list__value {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .3s var(--ease-hover);
}

a.contact-list__value:hover { background-size: 100% 1px; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding: 5vh var(--grid-margin) 16vh;
  display: flex;
  justify-content: space-between;
  color: var(--color-text-45);
  font-size: var(--fs-2xs);
  border-top: 1px solid var(--color-border);
}

.site-footer a:hover { color: var(--color-text); }

/* ==========================================================================
   View-transition page fades (progressive enhancement)
   ========================================================================== */

::view-transition-old(root) { animation: page-out .45s var(--ease-out) forwards; }
::view-transition-new(root) { animation: page-in .5s var(--ease-out) forwards; }

@keyframes page-out { to { opacity: 0; translate: 0 -12px; } }
@keyframes page-in { from { opacity: 0; translate: 0 12px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
