/* ---------------------------------------------------------------------- */
/* Tokens                                                                  */
/* ---------------------------------------------------------------------- */

:root {
  --bg: oklch(0.985 0.005 90);
  --fg: #1a1a1a;
  --muted: #555555;
  --faint: #999999;
  --border: #e6e2da;
  --accent: oklch(0.55 0.15 60);
  --accent-hover: oklch(0.48 0.15 60);
  --logo: oklch(0.75 0.15 75);
  --toggle-fill: oklch(0.75 0.15 75);
  --glow-color: oklch(0.85 0.12 75 / 0.4);
  --img-slot-bg: #eee9e0;
  --img-slot-fg: #8a8275;
  --img-slot-border: #ddd5c6;
}

:root[data-theme='dark'] {
  --bg: oklch(0.2 0.012 80);
  --fg: #f2ede4;
  --muted: #c9c1b3;
  --faint: #8f887c;
  --border: #3c372e;
  --toggle-fill: #f0ead9;
  --img-slot-bg: #2c2820;
  --img-slot-fg: #8f887c;
  --img-slot-border: #453f33;
}

/* ---------------------------------------------------------------------- */
/* Reset / base                                                            */
/* ---------------------------------------------------------------------- */

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

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Georgia, 'Times New Roman', serif;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

em {
  font-style: italic;
}

/* ---------------------------------------------------------------------- */
/* Keyframes                                                               */
/* ---------------------------------------------------------------------- */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes underlineSlice {
  0% {
    background-position: 0% 100%;
    background-size: 0% 1px;
  }
  15% {
    background-position: 0% 100%;
    background-size: 100% 1px;
  }
  15.01% {
    background-position: 100% 100%;
    background-size: 100% 1px;
  }
  55% {
    background-position: 100% 100%;
    background-size: 0% 1px;
  }
  55.01% {
    background-position: 0% 100%;
    background-size: 0% 1px;
  }
  100% {
    background-position: 0% 100%;
    background-size: 100% 1px;
  }
}

.fade-up {
  opacity: 0;
  animation: fadeUp 0.7s ease both;
}

/* ---------------------------------------------------------------------- */
/* View transitions -- native crossfade between page navigations           */
/* (Chromium 126+; unsupported browsers just navigate normally, no JS or   */
/* fallback needed). Duration/easing tuned to match the site's other       */
/* interaction timings rather than the browser's terser 0.25s default.     */
/* ---------------------------------------------------------------------- */

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
  animation-timing-function: ease;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* The nav is pulled out of the root crossfade into its own named group (see
   `.nav { view-transition-name: site-nav }`) so it doesn't blend/flicker on
   every navigation -- its content barely changes page to page, so the only
   visible effect of animating it was a distracting flash. No animation on
   the group (position/size) or the old/new snapshots (opacity): it just
   swaps to the new state instantly instead of crossfading. */

::view-transition-group(site-nav) {
  animation: none;
}

::view-transition-old(site-nav) {
  animation: none;
  opacity: 0;
}

::view-transition-new(site-nav) {
  animation: none;
  opacity: 1;
}

/* ---------------------------------------------------------------------- */
/* Layout shell                                                            */
/* ---------------------------------------------------------------------- */

.page {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------------- */
/* Cursor glow (global)                                                    */
/* ---------------------------------------------------------------------- */

.glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-color), transparent 70%);
  filter: blur(14px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 0;
  will-change: transform;
}

.glow.is-visible {
  opacity: 1;
}

/* ---------------------------------------------------------------------- */
/* Nav                                                                     */
/* ---------------------------------------------------------------------- */

.nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 44px 72px 0;
  view-transition-name: site-nav;
}

.nav__group {
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  width: 20px;
  height: 20px;
  flex: none;
  background: var(--logo);
  transform: rotate(45deg);
  border-radius: 3px;
}

.nav-link {
  text-decoration: none;
  color: var(--fg);
  font: 18px/1 Georgia, serif;
  display: inline-block;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 2px;
}

.nav-link:hover {
  color: var(--fg);
  animation: underlineSlice 0.6s ease forwards;
}

.nav-link.is-active {
  background-image: none;
  border-bottom: 1px solid var(--fg);
}

.toggle-dark {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  padding: 0;
  flex: none;
}

.toggle-dark__base,
.toggle-dark__cutout {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.toggle-dark__base {
  background: var(--toggle-fill);
}

.toggle-dark__cutout {
  background: var(--bg);
  transform: translate(20px, 20px);
  transition: transform 0.3s ease, background 0.3s ease;
}

:root[data-theme='dark'] .toggle-dark__cutout {
  transform: translate(5px, -5px);
}

/* ---------------------------------------------------------------------- */
/* Eyebrow labels                                                          */
/* ---------------------------------------------------------------------- */

.eyebrow {
  margin: 0 0 14px;
  font: 15px/1 Georgia, serif;
  color: var(--faint);
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------------- */
/* Homepage                                                                 */
/* ---------------------------------------------------------------------- */

.intro {
  padding: 88px 72px 0;
  max-width: 620px;
}

.hero {
  margin: 0 0 40px;
  font: 18px/1.6 Georgia, serif;
  color: var(--fg);
}

.hero__name {
  cursor: default;
  text-decoration: underline dotted;
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.hero__name:hover {
  text-decoration-color: var(--accent);
}

.work-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
  padding: 8px 0;
}

.work-list__item {
  position: relative;
  z-index: 1;
  text-decoration: none;
  color: var(--fg);
  font: 18px/1.6 Georgia, serif;
  display: block;
}

span.work-list__item {
  cursor: default;
}

.work-list__meta {
  color: var(--faint);
  font-size: 13px;
}

.preview {
  position: fixed;
  left: 0;
  top: 0;
  width: 220px;
  height: 150px;
  border-radius: 6px;
  overflow: hidden;
  pointer-events: none;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 3;
  will-change: transform;
}

.preview.is-visible {
  opacity: 1;
}

.preview__slot {
  width: 100%;
  height: 100%;
  display: none;
}

.preview__slot.is-current {
  display: block;
}

.resume {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 40px;
}

.resume__row {
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font: 18px/1.6 Georgia, serif;
  color: var(--fg);
  padding: 6px 0;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.resume__meta {
  color: var(--faint);
  font-size: 13px;
}

.resume__glyph {
  color: var(--faint);
  font-size: 18px;
  flex: none;
}

.resume__body {
  margin: 0 0 10px 28px;
  padding: 0;
  font: 13px/1.7 Georgia, serif;
  color: var(--muted);
  animation: fadeUp 0.35s ease both;
}

.contact {
  margin: 0;
  font: 18px/1.6 Georgia, serif;
  color: var(--fg);
}

.contact a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                   */
/* ---------------------------------------------------------------------- */

.footer {
  padding: 56px 72px 44px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__group {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.footer__back {
  text-decoration: none;
  color: var(--faint);
  font: 16px/1 Georgia, serif;
}

.footer__copy {
  font: 15px/1 Georgia, serif;
  color: var(--faint);
}

.footer__info {
  font: 19px/1.6 Georgia, serif;
  color: var(--fg);
}

.footer__info a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.footer__social {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__social-link {
  display: inline-flex;
  color: var(--faint);
  transition: color 0.15s ease;
}

.footer__social-link:hover {
  color: var(--accent);
}

.footer__social-link svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ---------------------------------------------------------------------- */
/* Work index                                                              */
/* ---------------------------------------------------------------------- */

.work-header {
  padding: 80px 72px 56px;
  max-width: 700px;
}

.work-header h1,
.blog-header h1 {
  margin: 0;
  font: normal 44px/1.25 Georgia, serif;
  letter-spacing: -0.01em;
}

.work-cards {
  display: flex;
  flex-direction: column;
  gap: 88px;
  padding: 0 72px 96px;
}

.work-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.work-card__frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.35s ease;
}

.work-card:hover .work-card__frame {
  transform: scale(1.015);
}

.work-card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 20px;
  gap: 24px;
  flex-wrap: wrap;
}

.work-card__title {
  margin: 0;
  font: normal 30px/1.3 Georgia, serif;
}

.work-card--muted .work-card__title {
  color: var(--muted);
}

.work-card__meta {
  font: 16px/1.5 Georgia, serif;
  color: var(--faint);
}

.work-card__desc {
  margin: 8px 0 0;
  font: 15px/1.6 Georgia, serif;
  color: var(--muted);
  max-width: 640px;
}

.work-card--muted .work-card__desc {
  color: var(--faint);
}

.work-other {
  padding: 0 72px 40px;
  max-width: 700px;
}

.work-other__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.work-other__list p {
  margin: 0;
  font: 16px/1.6 Georgia, serif;
  color: var(--muted);
}

/* ---------------------------------------------------------------------- */
/* Case study                                                              */
/* ---------------------------------------------------------------------- */

.case-header {
  padding: 80px 72px 0;
  max-width: 700px;
}

.case-header h1 {
  margin: 0 0 18px;
  font: normal 44px/1.2 Georgia, serif;
  letter-spacing: -0.01em;
}

.case-header .dek {
  margin: 0;
  font: 18px/1.55 Georgia, serif;
  color: var(--muted);
}

.case-cover-wrap {
  margin-top: 48px;
}

.case-cover {
  width: 100%;
  aspect-ratio: 21 / 9;
}

.case-meta {
  padding: 40px 72px;
  max-width: 820px;
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.case-collaborators {
  padding: 32px 72px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.case-collaborators__heading {
  margin: 0 0 10px;
  font: italic 20px/1.4 Georgia, serif;
  color: var(--fg);
}

.case-collaborators__names {
  margin: 0;
  font: italic 15px/1.6 Georgia, serif;
  color: var(--muted);
}

.case-meta__label {
  margin: 0 0 6px;
  font: 13px/1 Georgia, serif;
  color: var(--faint);
  letter-spacing: 0.03em;
}

.case-meta__value {
  margin: 0;
  font: 18px/1.4 Georgia, serif;
  color: var(--muted);
}

.case-article {
  padding: 56px 72px;
  max-width: 700px;
}

/* Kirby blocks render as a flat sequence of elements (p, figure, ul/ol, our
   custom .eyebrow/.case-video blocks) -- space them by margin, not a parent
   gap, since a section label needs more breathing room above it than a
   paragraph following another paragraph. */

.case-article > * {
  margin: 0 0 16px;
}

.case-article > *:last-child {
  margin-bottom: 0;
}

.case-article p,
.case-article li {
  font: 15px/1.7 Georgia, serif;
  color: var(--muted);
}

.case-article .eyebrow {
  margin-top: 48px;
}

.case-article .eyebrow:first-child {
  margin-top: 0;
}

.case-article figure {
  margin: 16px 0;
}

.case-article figure img {
  display: block;
  width: 100%;
  border-radius: 4px;
}

.case-article figcaption {
  margin-top: 12px;
  font: 15px/1.7 Georgia, serif;
  color: var(--muted);
}

.case-article ul,
.case-article ol {
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.case-article h2,
.case-article h3,
.case-article h4 {
  margin: 0;
  font: normal 24px/1.3 Georgia, serif;
  color: var(--fg);
}

.case-article blockquote {
  margin: 0;
  padding: 2px 0 2px 20px;
  border-left: 2px solid var(--border);
  font: italic 20px/1.6 Georgia, serif;
  color: var(--fg);
}

.case-article blockquote footer {
  margin-top: 8px;
  font: 14px/1.4 Georgia, serif;
  font-style: normal;
  color: var(--faint);
}

.case-article ul li::before,
.case-article ol li::before {
  content: '→ ';
}

.case-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  background: var(--img-slot-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.case-video--real {
  background: transparent;
}

.case-video video {
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

.case-video__play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent var(--img-slot-fg);
}

.case-video__label {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font: 12px/1 ui-monospace, monospace;
  color: var(--img-slot-fg);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------------- */
/* Blog                                                                    */
/* ---------------------------------------------------------------------- */

.blog-header {
  padding: 80px 72px 32px;
  max-width: 700px;
}

.blog-filter {
  display: flex;
  gap: 24px;
  padding: 0 72px 48px;
}

.blog-filter__item {
  appearance: none;
  cursor: pointer;
  font: 20px/1 Georgia, serif;
  color: var(--faint);
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  margin: 0;
  padding: 0 0 3px;
  font-family: inherit;
}

.blog-filter__item.is-active {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

.blog-list {
  display: flex;
  flex-direction: column;
  padding: 0 72px 96px;
  max-width: 760px;
}

.blog-post {
  text-decoration: none;
  color: inherit;
  display: block;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  animation: fadeUp 0.5s ease both;
}

.blog-post[hidden] {
  display: none;
}

.blog-list--bottom-border {
  border-bottom: 1px solid var(--border);
}

.blog-post__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.blog-post__title {
  margin: 0;
  font: normal 26px/1.3 Georgia, serif;
}

.blog-post__meta {
  font: 15px/1 Georgia, serif;
  color: var(--faint);
}

.blog-post__excerpt {
  margin: 10px 0 0;
  font: 14px/1.6 Georgia, serif;
  color: var(--muted);
}

.blog-empty {
  margin: 0;
  padding: 40px 0;
  font: 19px/1.6 Georgia, serif;
  color: var(--faint);
  border-top: 1px solid var(--border);
}

.blog-empty[hidden] {
  display: none;
}

/* ---------------------------------------------------------------------- */
/* Blog post detail (not covered by the design handoff -- extends the same */
/* type system for a functional single-post view)                          */
/* ---------------------------------------------------------------------- */

.post-header {
  padding: 80px 72px 0;
  max-width: 700px;
}

.post-header h1 {
  margin: 0 0 10px;
  font: normal 44px/1.25 Georgia, serif;
  letter-spacing: -0.01em;
}

.post-meta {
  font: 15px/1 Georgia, serif;
  color: var(--faint);
}

.post-body {
  padding: 40px 72px 56px;
  max-width: 700px;
  font: 15px/1.7 Georgia, serif;
  color: var(--muted);
}

.post-body p {
  margin: 0 0 20px;
}

/* ---------------------------------------------------------------------- */
/* Image placeholder                                                       */
/* ---------------------------------------------------------------------- */

.img-slot {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  background: var(--img-slot-bg);
  border: 1px dashed var(--img-slot-border);
  border-radius: 6px;
  color: var(--img-slot-fg);
  font: 13px/1.5 ui-monospace, monospace;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

img.media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.case-cover img.media {
  border-radius: 0;
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */

@media (max-width: 720px) {
  .nav,
  .intro,
  .work-header,
  .work-cards,
  .work-other,
  .case-header,
  .case-meta,
  .case-article,
  .blog-header,
  .blog-filter,
  .blog-list,
  .footer,
  .post-header,
  .post-body {
    padding-left: 24px;
    padding-right: 24px;
  }

  .work-header h1,
  .blog-header h1,
  .case-header h1,
  .post-header h1 {
    font-size: 34px;
  }

  .hero,
  .work-list__item,
  .resume__row,
  .contact {
    font-size: 16px;
  }
}
