/* kristahaldenbyart.com
   White ground. One accent colour per visit, taken from the piece that greeted you.
   Display: Bodoni Moda. UI: Karla. */

:root {
  --paper: #ffffff;
  --ink: #161616;
  --mute: #8c8c8c;
  --hair: #e6e6e6;
  --accent: #161616;
  --gutter: clamp(20px, 4vw, 56px);
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --ui: "Karla", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --intro-seconds: 9s;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
img { display: block; max-width: 100%; }

/* ---------------------------------------------------------------- header */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--gutter);
}
.wordmark {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.site-nav { display: flex; gap: 28px; font-family: var(--display); font-size: 17px; }
.site-nav a { transition: color 0.25s var(--ease); }
.site-nav a:hover, .site-nav a[aria-current="page"] { font-style: italic; }
.site-nav a[aria-current="page"] { color: var(--accent); }

.site-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 40px var(--gutter) 28px;
  font-size: 12px;
  color: var(--mute);
}
.site-footer a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- intro */

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 6vh var(--gutter) 12vh;
  transition: opacity 0.5s var(--ease);
  user-select: none;
  -webkit-user-select: none;
}
.intro.is-leaving { opacity: 0; pointer-events: none; }
.intro-image {
  max-height: 74vh;
  max-width: min(86vw, 640px);
  width: auto;
  height: auto;
  object-fit: contain;
  animation: settle 1.8s var(--ease) both;
}
@keyframes settle {
  from { opacity: 0; transform: scale(1.035) translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.intro-text {
  position: absolute;
  left: var(--gutter);
  bottom: calc(var(--gutter) + 6px);
  margin: 0;
  max-width: 24em;
  font-family: var(--display);
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.35;
  color: var(--accent);
  animation: rise 1.2s 0.6s var(--ease) both;
}
.intro-hint { font-style: italic; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.intro-line {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
  animation: sweep var(--intro-seconds) linear 0.4s forwards;
}
@keyframes sweep { to { transform: scaleX(1); } }

/* ---------------------------------------------------------------- holding page (home only) */

.is-holding { min-height: 100vh; min-height: 100svh; }
.hold {
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 10px 10px 14px;
}
.hold-image {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;          /* portrait screens: fill and crop */
  object-position: 50% 45%;
  animation: settle 1.6s var(--ease) both;
}
.hold-caption {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 20px;
  flex-wrap: wrap;
  font-family: var(--display);
  font-size: clamp(15px, 1.4vw, 19px);
  line-height: 1.3;
  color: var(--accent);
  animation: rise 1s 0.5s var(--ease) both;
}
.hold-email { font-style: italic; }
.hold-email:hover { color: var(--ink); }
@media (min-aspect-ratio: 1/1) {
  /* landscape / desktop: show the whole image, as tall as the screen allows */
  .hold { padding: 16px var(--gutter) 18px; }
  .hold-image { object-fit: contain; object-position: 50% 50%; }
  .hold-caption { justify-content: center; gap: 12px 40px; }
}

/* ---------------------------------------------------------------- home menu */

.home {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px var(--gutter) 28px;
}
.home-name {
  margin: 0;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
}
.home-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05em;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(44px, 9.5vw, 128px);
  line-height: 1.02;
  letter-spacing: -0.005em;
  margin: 4vh 0;
}
.home-menu a {
  position: relative;
  transition: color 0.3s var(--ease), padding-left 0.45s var(--ease);
}
.home-menu a:hover, .home-menu a:focus-visible { font-style: italic; color: var(--accent); padding-left: 0.12em; }
.home-foot { margin: 0; font-size: 12px; color: var(--mute); }
.home-foot a:hover { color: var(--accent); }

/* Reveal the menu when the intro leaves */
.is-home .home { transition: opacity 0.8s 0.1s var(--ease); }
.is-home.has-intro .home { opacity: 0; }
.is-home.is-entered .home { opacity: 1; }

/* ---------------------------------------------------------------- portfolio grid */

.portfolio { padding: 2vh var(--gutter) 4vh; }
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(20px, 4vw, 64px);
  row-gap: clamp(36px, 6vw, 96px);
}
.grid-item { display: block; }
.grid-item img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  transition: transform 0.7s var(--ease), opacity 0.4s var(--ease);
}
.grid-item:hover img { transform: scale(1.015); }
.grid-item:focus-visible { outline: 1px solid var(--accent-item, var(--accent)); outline-offset: 8px; }
.empty { font-family: var(--display); font-size: 20px; color: var(--mute); }

/* ---------------------------------------------------------------- work page */

.work { padding: 2vh var(--gutter) 6vh; display: flex; flex-direction: column; align-items: center; }
.work-figure { margin: 0; width: 100%; display: flex; flex-direction: column; align-items: center; }
.work-figure img {
  max-height: 78vh;
  max-width: min(100%, 1100px);
  width: auto;
  height: auto;
  object-fit: contain;
}
.work-caption {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 28px;
  margin-top: 28px;
}
.work-title {
  margin: 0;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 400;
  color: var(--accent);
}
.work-meta { margin: 0; color: var(--mute); font-size: 13px; }
.work-meta .sep { margin: 0 0.6em; }
.work-desc { flex-basis: 100%; margin: 6px 0 0; max-width: 46em; }
.work-nav {
  width: 100%;
  max-width: 1100px;
  display: flex;
  justify-content: space-between;
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
  font-family: var(--display);
  font-size: 17px;
}
.work-nav a:hover { font-style: italic; color: var(--accent); }

/* ---------------------------------------------------------------- prose pages */

.prose { padding: 8vh var(--gutter) 6vh; max-width: 40em; }
.page-title {
  margin: 0 0 32px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
  color: var(--accent);
}
.prose p { margin: 0 0 1.2em; font-size: 17px; }
.prose a:not(.contact-email) { border-bottom: 1px solid var(--hair); transition: border-color 0.25s; }
.prose a:not(.contact-email):hover { border-color: var(--accent); }
.contact-email {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--display);
  font-size: clamp(22px, 3.6vw, 40px);
  line-height: 1.1;
  word-break: break-all;
  transition: color 0.3s var(--ease);
}
.contact-email:hover { font-style: italic; color: var(--accent); }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 820px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .site-header { padding: 18px var(--gutter); }
  .site-nav { gap: 18px; font-size: 16px; }
  .wordmark { font-size: 17px; }
  .intro { padding: 4vh var(--gutter) 16vh; }
  .intro-image { max-height: 64vh; }
  .intro-text { max-width: calc(100% - 2 * var(--gutter)); }
  .work-figure img { max-height: 66vh; }
  .work-nav { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .intro-image, .intro-text, .hold-image, .hold-caption { animation: none; }
  .intro-line { animation-duration: 0.01s; animation-delay: var(--intro-seconds); }
  .home-menu a, .grid-item img { transition: none; }
}
