/* ============================================
   Katie — shared site stylesheet
   Used by index.html, work.html, about.html, contact.html
   ============================================ */

:root {
  --ink: #141414;
  --muted: #6e6e76;
  --faint: #9a9aa1;
  --paper: #fcfcfb;
  --line: #e7e7e5;
  --card: #f3f3f1;
  --card-hover: #ececea;
}

html[data-theme="dark"] {
  --ink: #f0f0ee;
  --muted: #a3a3aa;
  --faint: #79797f;
  --paper: #121213;
  --line: #262628;
  --card: #1c1c1e;
  --card-hover: #232325;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { transition: background 0.3s ease; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  font-size: 16px;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 24px;
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(252,252,251,0.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
html[data-theme="dark"] header {
  background: rgba(18,18,19,0.72);
}
header.scrolled { border-bottom-color: var(--line); }

.header-inner {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 689px) {
  header {
    max-width: 640px;
    margin: 0 auto;
  }
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  position: relative;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.avatar .logo-dark { display: none; }
html[data-theme="dark"] .avatar .logo-light { display: none; }
html[data-theme="dark"] .avatar .logo-dark { display: block; }

.name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

.header-nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
}

.header-nav a {
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.header-nav a:hover,
.header-nav a.active { color: var(--ink); }

/* Animated underline on hover */
.link-hover {
  position: relative;
  display: inline-block;
}
.link-hover::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.link-hover:hover::after { transform: scaleX(1); }

.resume-pill {
  border: 1px solid var(--line);
  border-radius: 980px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.resume-pill:hover {
  border-color: var(--faint);
  background: var(--card);
}

.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--faint); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: block; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Generic sections (index / about) ---------- */
.section {
  padding: 48px 0;
  border-top: 1px solid var(--line);
}
.section:first-of-type,
.page-title + .section {
  border-top: none;
  padding-top: 0;
}

.section h1 {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin-bottom: 24px;
}

.section.hero {
  padding-top: 24px;
  padding-bottom: 64px;
}

.section h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-bottom: 20px;
}

.section p {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.section p:last-child { margin-bottom: 0; }

.section.border { padding-top: 48px; border-top: 1px solid var(--line); }

.hero h1 {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 24px;
}
@media (min-width: 480px) {
  .hero h1 { font-size: 44px; }
}

.highlighted {
  font-weight: 800;
  letter-spacing: 0.01em;
}
.cursor {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  margin-left: 3px;
  background: currentColor;
  vertical-align: middle;
  animation: blink 0.8s steps(2, start) infinite;
}
@keyframes blink {
  to { opacity: 0; }
}

.help-list {
  list-style: none;
}

.help-list li {
  font-size: 15.5px;
  color: var(--ink);
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.help-list li:first-child { border-top: none; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 980px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

/* ---------- Photography page: masonry gallery ---------- */
.gallery {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.gallery-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.gallery-item {
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--faint);
  cursor: pointer;
  border: none;
  padding: 0;
  width: 100%;
}
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}
.gallery-item.hidden { display: none; }

.gallery-more {
  display: block;
  margin: 24px auto 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 980px;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.gallery-more:hover { border-color: var(--faint); background: var(--card); }
.gallery-more.is-hidden { display: none; }

/* ---------- Photography page: lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10,10,10,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  display: block;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-close svg { width: 16px; height: 16px; }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-nav svg { width: 16px; height: 16px; }
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

/* ---------- About page: experience timeline ---------- */
.timeline-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
}
.timeline-item .tl-date {
  font-size: 12px;
  color: var(--faint);
  padding-top: 3px;
}
.timeline-item .tl-content {
  position: relative;
  padding-left: 22px;
  padding-bottom: 36px;
  border-left: 1px solid var(--line);
}
.timeline-item:last-child .tl-content {
  padding-bottom: 0;
}
.timeline-item .tl-content::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 3px var(--paper);
}
.tl-content .tl-role {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.tl-content .tl-org {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 10px;
}
.tl-content .tl-desc {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
}

.work-teaser {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  margin-top: 4px;
}
.work-teaser .arrow { transition: transform 0.2s ease; }
.work-teaser:hover .arrow { transform: translateX(3px); }

.socials {
  display: flex;
  gap: 20px;
  margin-top: 28px;
}
.socials a {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
}
.socials a:hover { color: var(--ink); }

/* ---------- Page title (work / about / contact headers) ---------- */
.page-title {
  padding-bottom: 40px;
}
.page-title h1 {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.page-title p {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
}

/* ---------- Email link + copy toast ---------- */
.email {
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
}
.email::after { bottom: -1px; }

.copy-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 980px;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.copy-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Scroll to top ---------- */
.to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.3s ease;
}
.to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top svg { width: 16px; height: 16px; }

/* ---------- Homepage: featured projects list ---------- */
.section-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-head-row h2 { margin-bottom: 0; }
.see-all {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
}

.project-list {
  list-style: none;
}
.project-list li {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.project-list li:first-child { border-top: none; padding-top: 0; }

.project-list .name {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.project-list .desc {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 10px;
}
.project-list .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.project-list .tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  color: var(--muted);
  background: var(--card);
  border-radius: 980px;
  padding: 4px 10px;
}

/* ---------- Homepage: centered closing CTA ---------- */
.cta-close {
  text-align: center;
}
.cta-close h1 {
  font-size: 32px;
}
.cta-close p {
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}
.cta-close .socials {
  justify-content: center;
}

/* ---------- Homepage: Apple-style feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
@media (min-width: 560px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.feature-grid .feature h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 8px;
}
.feature-grid .feature p {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- Work page: project carousels ---------- */
.carousel {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--card);
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.02em;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(128,128,128,0.35);
  cursor: pointer;
  padding: 6px;
  margin: -6px;
  background-clip: content-box;
}
.dot.active { background: var(--ink); background-clip: content-box; }

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  color: #141414;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(4px);
}
.carousel:hover .carousel-arrow,
.carousel-arrow:focus-visible {
  opacity: 1;
}
.carousel-arrow:hover { background: rgba(255,255,255,0.95); }
html[data-theme="dark"] .carousel-arrow {
  background: rgba(20,20,20,0.75);
  color: #f0f0ee;
}
html[data-theme="dark"] .carousel-arrow:hover { background: rgba(20,20,20,0.9); }
.carousel-arrow.prev { left: 10px; }
.carousel-arrow.next { right: 10px; }
.carousel-arrow svg { width: 15px; height: 15px; }
.carousel-arrow:disabled { opacity: 0 !important; pointer-events: none; }

@media (hover: none) {
  .carousel-arrow { display: none; }
}

.project h3.title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 12px;
}

.project .bolder { font-weight: 700; }

.project p {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
}

/* ---------- Contact page: hero + form ---------- */
.contact-box {
  background: var(--card);
  border-radius: 20px;
  padding: 40px;
  transition: background 0.3s ease;
}

.field { margin-bottom: 24px; }
.field:last-of-type { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-bottom: 10px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  padding: 8px 0 12px;
  outline: none;
  resize: none;
  transition: border-color 0.2s ease;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  padding: 8px 24px 12px 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa1' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 14px;
  cursor: pointer;
}
.field select option { background: var(--paper); color: var(--ink); }
.field input::placeholder,
.field textarea::placeholder { color: var(--faint); }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--ink); }
.field textarea { min-height: 88px; line-height: 1.6; resize: vertical; }

.form-status {
  margin-top: 16px;
  font-size: 13.5px;
}
.form-status.success { color: var(--muted); }
.form-status.error { color: #c0553f; }
html[data-theme="dark"] .form-status.error { color: #e08469; }

.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--paper);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  border: none;
  border-radius: 980px;
  padding: 12px 24px;
  margin-top: 8px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}
.submit-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.submit-btn:disabled { opacity: 0.5; cursor: default; transform: none; }

.contact-direct {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
}
.contact-direct a { color: var(--ink); font-weight: 500; }

/* ---------- Site footer ---------- */
.site-footer {
  margin-top: 24px;
  padding-top: 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--faint);
}

.footer h1 { font-size: 24px; }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .header-right { gap: 14px; }
  .header-nav ul { gap: 14px; }
  .resume-pill { padding: 5px 10px; font-size: 11.5px; }
  .to-top { right: 20px; bottom: 20px; }
}
