/* calebdfarmer.com — static rebuild. Colors sampled from the live Squarespace site. */

:root {
  --font-sans: "Plus Jakarta Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --color-outer: #d8dbd6;    /* body background outside the page canvas */
  --color-canvas: #f8fbf5;   /* page canvas */
  --color-text: #10130f;
  --color-muted: #7d817b;    /* active nav item, captions */
  --color-logo: #485e52;
  --color-link: #385a68;
  --color-rule: #dfe3dc;
  --canvas-width: 928px;
  --canvas-padding: 69px;
  --top-padding: 64px;
}

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

html { -webkit-text-size-adjust: 100%; background: var(--color-outer); }

body {
  margin: 0;
  background: var(--color-outer);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
.clear::after { content: ""; display: table; clear: both; }

a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img { max-width: 100%; height: auto; display: block; }

#canvas {
  max-width: var(--canvas-width);
  min-height: 100vh;
  margin: 0 auto;
  padding: var(--top-padding) var(--canvas-padding) 70px;
  background: var(--color-canvas);
}

/* ---------- Header ---------- */

#header::after { display: none; }
#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.logo {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 19px;
  line-height: 1;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.logo a { color: var(--color-logo); text-decoration: none; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; }
.main-nav li { position: relative; }
.main-nav a, .main-nav .folder-toggle-label {
  position: relative;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  padding-bottom: 6px;
  text-decoration: none;
  color: var(--color-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s ease;
}
.main-nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--color-logo);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}
.main-nav a:hover { text-decoration: none; color: var(--color-text); }
.main-nav .active-link > a { color: var(--color-logo); }
.main-nav .active-link > a::after { transform: scaleX(1); }

/* Desktop dropdown */
#topNav .subnav {
  display: none;
  position: absolute;
  top: 100%;
  left: -16px;
  padding: 16px;
  min-width: 170px;
  background: var(--color-canvas);
  border: 1px solid var(--color-rule);
  z-index: 10;
}
#topNav .folder:hover .subnav,
#topNav .folder:focus-within .subnav { display: block; }
#topNav .subnav ul { flex-direction: column; gap: 12px; }

.page-divider { display: none; }

/* Mobile nav (hidden on desktop) */
#mobileMenuLink, #mobileNav { display: none; }
.menu-close { display: none; }

/* ---------- Page ---------- */

#page { padding-top: 92px; }

h1, h2, h3 { margin: 0 0 .5em; white-space: pre-wrap; }

h1 {
  font-weight: 500;
  font-size: 46px;
  line-height: 1.26;
  letter-spacing: -.01em;
}

h2 {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text);
}

h3 {
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
}
h3 strong { font-weight: 700; }

.text-block { margin-bottom: 1em; }

/* Spacer blocks: fixed (vsize-1) and ratio-based (Squarespace data-aspect-ratio) */
.spacer { height: 20px; }
.spacer-ratio { height: 0; padding-bottom: calc(var(--ratio, 2) * 1%); }

/* Image blocks */
.image-block { margin: 0 auto 24px; width: 100%; }
.image-wrapper { position: relative; width: 100%; height: 0; overflow: hidden; }
.image-wrapper img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
figcaption { margin-top: 10px; }
figcaption p { margin: 0; font-size: 13px; color: var(--color-muted); }

/* Image that links out */
.image-link { display: block; color: inherit; text-decoration: none; }
.image-link:hover { text-decoration: none; }
.image-link figcaption p { color: var(--color-link); font-weight: 700; }
.image-link:hover img { opacity: .92; }

/* 12-column grid */
.row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 34px; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-9 { grid-column: span 9; }

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

.info-footer-wrapper { margin-top: 60px; padding-top: 30px; }
.social-links { display: flex; gap: 10px; }
.social-icon {
  display: inline-flex;
  width: 30px; height: 30px;
  color: var(--color-text);
  text-decoration: none;
}
.social-icon svg { width: 100%; height: 100%; }

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

@media (max-width: 900px) {
  :root { --canvas-padding: 40px; --top-padding: 48px; }
  h1 { font-size: 38px; }
}

@media (max-width: 640px) {
  :root { --canvas-padding: 20px; --top-padding: 28px; }

  #header { align-items: center; gap: 16px; flex-wrap: nowrap; }
  .logo { font-size: 17px; }
  #topNav { display: none; }

  #mobileMenuLink {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--color-text);
    cursor: pointer;
    padding: 8px 0 8px 16px;
    -webkit-user-select: none; user-select: none;
  }
  #mobile-menu-toggle:checked ~ #header .menu-open { display: none; }
  #mobile-menu-toggle:checked ~ #header .menu-close { display: inline; }

  #mobile-menu-toggle:checked ~ #mobileNav { display: block; }
  #mobileNav { margin: 20px 0 0; border-top: 1px solid var(--color-rule); }
  #mobileNav ul { flex-direction: column; gap: 0; }
  #mobileNav li { border-bottom: 1px solid var(--color-rule); }
  #mobileNav a {
    display: block;
    padding: 16px 0;
    font-size: 15px;
    letter-spacing: 0;
  }
  #mobileNav a::after { display: none; }
  #mobileNav .active-link > a { color: var(--color-logo); }
  #mobileNav .active-link > a::before { content: "→ "; }

  #page { padding-top: 48px; }
  h1 { font-size: 32px; }
  h3 { font-size: 17px; }

  .row { display: block; }
  .col { margin-bottom: 16px; }
  .spacer-ratio { padding-bottom: calc(var(--ratio, 2) * 2%); }
}

/* ---------- Past Work: grid ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 20px;
}
.card { display: block; color: inherit; text-decoration: none; }
.card:hover { text-decoration: none; }
.card:hover .card-title { color: var(--color-link); }
.card-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #e3e7e0;
  overflow: hidden;
}
.card-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(var(--thumb-scale, 1));
  transition: transform .4s ease;
}
.card:hover .card-thumb img { transform: scale(calc(var(--thumb-scale, 1) * 1.03)); }
.card-play {
  position: absolute; left: 50%; top: 50%;
  width: 54px; height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(16, 19, 15, .72);
  z-index: 1;
}
.card-play::after {
  content: "";
  position: absolute; left: 21px; top: 17px;
  border-left: 16px solid #f8fbf5;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}
.card-title { margin: 12px 0 2px; font-size: 16px; font-weight: 600; line-height: 1.35; }
.card-meta { margin: 0; font-size: 13px; color: var(--color-muted); }

/* ---------- Project page ---------- */

.breadcrumb { margin: 0 0 28px; font-size: 13px; font-weight: 700; }
.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-text); text-decoration: none; }

.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #10130f;
  margin-bottom: 24px;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.credits { margin: 0; }
.credit { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 7px 0; border-top: 1px solid var(--color-rule); font-size: 15px; }
.credit:last-child { border-bottom: 1px solid var(--color-rule); }
.credit dt { margin: 0; color: var(--color-muted); }
.credit dd { margin: 0; }
.vimeo-link { margin: 18px 0 0; font-size: 13px; font-weight: 700; }

.project-nav {
  display: flex; justify-content: space-between; gap: 24px;
  padding-top: 24px; border-top: 1px solid var(--color-rule);
  font-size: 14px; font-weight: 600;
}
.project-nav a:last-child { text-align: right; }

@media (max-width: 640px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .card-title { font-size: 14px; }
  .card-play { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
  .card-play::after { left: 15px; top: 11px; border-left-width: 13px; border-top-width: 9px; border-bottom-width: 9px; }
  .credit { grid-template-columns: 1fr; gap: 2px; }
  .project-nav { flex-direction: column; }
  .project-nav a:last-child { text-align: left; }
}

/* ---------- Current Work: surface cards ---------- */

.surfaces {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 20px;
}
.surface-card { min-width: 0; }

.surface {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0b0d0c;
  color: #f8fbf5;
  text-decoration: none;
  isolation: isolate;
}
.surface:hover { text-decoration: none; }
.surface-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.surface.has-shot .surface-art { display: none; }
.surface-go {
  position: absolute; left: 50%; top: 50%;
  width: 54px; height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(16, 19, 15, .72);
  color: #f8fbf5;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: background .3s ease, transform .3s ease;
}
.surface-go svg { width: 24px; height: 24px; }
.surface:hover .surface-go { background: rgba(16, 19, 15, .9); transform: scale(1.06); }
.surface-card .card-title { margin-top: 12px; }
.surface-card:hover .card-title { color: var(--color-link); }

.surface-shot {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: filter .5s ease, transform .5s ease;
}

/* Frame Set: interface floats inside a black margin so the logo sits off the corner */
.surface-site .surface-shot {
  inset: 7%;
  width: 86%; height: 86%;
  object-position: 0 0;
  filter: blur(1px) brightness(.75);
}
.surface-site:hover .surface-shot { filter: blur(.3px) brightness(.9); }

/* Instagram: 2x2 grid of posts inside a black margin, counts visible on the first */
.surface-ig .surface-shot {
  inset: 7%;
  width: 86%; height: 86%;
  object-position: 50% 30%;
  filter: blur(.5px) brightness(.85);
}
.surface-ig:hover .surface-shot { filter: none; transform: scale(1.02); }

/* YouTube: thumbnail card floating on black */
.surface-yt.has-shot { background: #000; }
.yt-card {
  position: absolute; left: 10%; top: 50%; width: 80%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 6px;
  filter: brightness(.8);
  transition: filter .5s ease, transform .5s ease;
}
.surface-yt:hover .yt-card { filter: brightness(1); transform: translateY(-50%) scale(1.02); }
.yt-card .surface-shot {
  position: static; inset: auto;
  width: 100%; height: auto;
  border-radius: 8px;
  object-fit: contain;
  filter: none;
  transition: none;
}
.yt-title {
  font-size: 11px; font-weight: 600; line-height: 1.3;
  color: #f1f1f1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.yt-meta { font-size: 10.5px; color: #aaa; }

@media (max-width: 640px) {
  .surfaces { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- About Me: photo grid ---------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.photo { margin: 0; }
.photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  display: block;
}

@media (max-width: 640px) {
  .photo-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------- 404 ---------- */

.slate { max-width: 320px; }
.slate svg { width: 100%; height: auto; display: block; }
.slate-top { transform-origin: 24px 54px; animation: clap 2.6s ease-in-out infinite; }
@keyframes clap {
  0%, 55%, 100% { transform: rotate(0); }
  65% { transform: rotate(-14deg); }
  80% { transform: rotate(0); }
}
@media (prefers-reduced-motion: reduce) { .slate-top { animation: none; } }
