/* ========================================
   Tom Portfolio
   ======================================== */

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

:root {
  --color-surface: #0A0A0A;
  --color-surface-raised: #141414;
  --color-text-primary: #fff;
  --color-text-secondary: rgba(255, 255, 255, 0.5);
  --color-text-tertiary: rgba(255, 255, 255, 0.35);
  --color-border-subtle: rgba(255, 255, 255, 0.12);
  --gap: 8px;
  --page-padding: 40px;
  --section-gap: 48px;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -0.28px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Preloader ---- */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease;
}

.preloader.fade-out {
  opacity: 0;
}

.preloader-logo {
  width: 48px;
  height: 48px;
  animation: preloaderPulse 1.5s ease-in-out infinite;
}

@keyframes preloaderPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* ---- Layout ---- */
.layout {
  display: flex;
  gap: var(--gap);
  padding: var(--gap);
  height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
}

/* ---- Sidebar ---- */
.sidebar {
  width: 520px;
  min-width: 520px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: 0;
  position: sticky;
  top: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

/* ---- Bento Cards ---- */
.bento-card {
  background: var(--color-surface-raised);
  border-radius: 16px;
  padding: var(--page-padding);
  flex-shrink: 0;
}

/* ---- Logo ---- */
.logo img {
  width: 40px;
  height: 40px;
}

/* ---- Bio Card ---- */
.bio-card {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  flex: 1;
}

/* ---- Hero ---- */
.hero {
  flex-shrink: 0;
}

.hero-text {
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -0.5px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.hero-text .text-primary {
  color: var(--color-text-primary);
}

.hero-text .text-secondary {
  color: var(--color-text-secondary);
}

.hero-text a:not(.bio-arrow) {
  color: var(--color-text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity 0.2s ease;
}

.hero-text a:not(.bio-arrow):hover {
  opacity: 0.7;
}

.bio-arrow {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
  position: relative;
}

.bio-arrow:hover {
  color: var(--color-text-primary);
}

.bio-tooltip {
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  transform: translateY(-50%);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  padding: 4px 12px 4px 4px;
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bio-arrow:hover .bio-tooltip {
  opacity: 1;
}

.bio-tooltip-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ---- Bio Footer ---- */
.bio-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: auto;
}

/* ---- Get in touch button ---- */
.btn-touch {
  display: inline-block;
  padding: 10px 18px;
  min-width: 110px;
  text-align: center;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--color-border-subtle);
  border-radius: 100px;
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.28px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-touch:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn-icon:hover {
  color: var(--color-text-primary);
}

/* ---- Availability ---- */
.availability {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #facc15;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.availability-text {
  font-size: 14px;
  color: var(--color-text-tertiary);
}

/* ---- Testimonials Overlay ---- */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.overlay-logo {
  position: fixed;
  top: calc(var(--gap) + var(--page-padding));
  left: calc(var(--gap) + var(--page-padding));
  width: 40px;
  height: 40px;
  z-index: 10001;
  cursor: pointer;
}

.overlay-close {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.overlay-close:hover {
  opacity: 0.6;
}

/* ---- Carousel ---- */
.carousel {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  align-items: center;
  gap: 24px;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  padding-left: calc(50vw - 270px);
}

.testimonial-card {
  width: 540px;
  min-width: 540px;
  background: var(--color-surface-raised);
  border-radius: 16px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  opacity: 0.12;
  transform: scale(0.95);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.testimonial-card.active {
  opacity: 1;
  transform: scale(1);
}

.testimonial-card.next,
.testimonial-card.prev {
  opacity: 0.12;
  transform: scale(0.95);
}

.testimonial-quote {
  font-size: 18px;
  line-height: 1.55;
  color: var(--color-text-primary);
  font-weight: 400;
}

.testimonial-author {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.testimonial-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.testimonial-role {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ---- Carousel Nav ---- */
.carousel-nav {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
}

.carousel-arrow {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.carousel-arrow:hover {
  opacity: 0.6;
}

.carousel-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.carousel-dot.active {
  background: #fff;
  transform: scale(1.3);
}

/* ---- About Overlay ---- */
.about-content {
  width: 100%;
  max-width: 520px;
  height: calc(100% - 280px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0 auto;
}

.about-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.about-heading {
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -0.3px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.about-subheading {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-primary);
  font-weight: 500;
}

.about-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.about-list li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.about-list li::before {
  content: '–';
  margin-right: 8px;
  color: var(--color-text-tertiary);
}

.about-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.about-photo-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  gap: var(--gap);
  padding: 0 var(--gap);
}

.about-strip-photo {
  height: 280px;
  min-width: 0;
  object-fit: cover;
  border-radius: 0;
  display: block;
  flex: 1;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.about-strip-photo:hover {
  opacity: 1;
}

.about-socials {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.about-social-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-tertiary);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s ease;
}

.about-social-link:hover {
  color: var(--color-text-primary);
}

/* ---- Clients Card ---- */
.clients-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.testimonials-link {
  font-size: 13px;
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.testimonials-link:hover {
  color: var(--color-text-primary);
}

.bio-link {
  margin-top: 24px;
}

.footer-clients-list {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ---- Gallery ---- */
.gallery {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  border-radius: 10px;
  padding: 0;

  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.gallery::-webkit-scrollbar {
  width: 6px;
}

.gallery::-webkit-scrollbar-track {
  background: transparent;
}

.gallery::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.gallery::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ---- Gallery Items ---- */
.gallery-item {
  overflow: hidden;
  border-radius: 10px;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}

.gallery-item.portrait {
  aspect-ratio: 0.74;
}

/* Showcase: background image + centred focus image */
.gallery-item.showcase {
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.gallery-item.showcase .showcase-focus {
  width: auto;
  height: auto;
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  border-radius: 12px;
}

/* Cutoff variant: image overflows bottom, clipped */
.gallery-item.showcase-cutoff {
  align-items: flex-start;
  padding: 40px 40px 0;
  overflow: hidden;
}

.gallery-item.showcase-cutoff .showcase-focus {
  max-height: none;
  height: auto;
  width: 85%;
  object-fit: contain;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
  margin-top: 20px;
}

/* Bottom-aligned cutoff: image starts from top with padding, overflows bottom */
.gallery-item.showcase-bottom {
  align-items: flex-start;
  justify-content: center;
  padding: 48px 48px 0;
  overflow: hidden;
}

.gallery-item.showcase-bottom .showcase-focus {
  max-width: 100%;
  max-height: none;
  width: 100%;
  height: auto;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.gallery-item.placeholder-item {
  background: var(--color-surface-raised);
}

.gallery-item.landscape {
  grid-column: 1 / -1;
  aspect-ratio: 1.5;
}

.gallery-item.hero-visual {
  aspect-ratio: 1.5;
}

.gallery-item.hero-visual img {
  object-position: top left;
}

/* ========================================
   Responsive
   ======================================== */

/* Tablet */
@media (max-width: 1200px) {
  html, body {
    height: auto;
    overflow: auto;
  }

  .layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    width: 100%;
    min-width: unset;
    height: auto;
    position: relative;
    overflow: visible;
  }

  .bio-card {
    gap: 32px;
  }

  .bio-footer {
    flex-wrap: wrap;
  }

  .gallery {
    height: auto;
    overflow: visible;
    padding: 0;
  }
}

/* Mobile */
@media (max-width: 600px) {
  :root {
    --gap: 6px;
    --page-padding: 20px;
  }

  .hero-text {
    font-size: 20px;
    letter-spacing: -0.4px;
  }

  .bio-card {
    gap: 24px;
    padding: 24px;
  }

  .clients-card {
    padding: 20px;
    gap: 10px;
  }

  .bio-footer {
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
  }

  .bento-card {
    border-radius: 12px;
  }

  .gallery-item {
    border-radius: 8px;
  }

  .gallery-item img {
    border-radius: 8px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .gallery-item.landscape {
    grid-column: 1;
  }

  .gallery-item.hero-visual {
    aspect-ratio: 1.5;
  }

  .gallery-item.showcase-cutoff {
    align-items: center;
    padding: 40px;
  }

  .gallery-item.showcase-cutoff .showcase-focus {
    width: 60%;
    border-radius: 12px;
  }

  .testimonial-card {
    width: calc(100vw - 60px);
    min-width: calc(100vw - 60px);
    padding: 28px;
  }

  .carousel-track {
    padding-left: 30px;
    gap: 16px;
  }

  .testimonial-quote {
    font-size: 16px;
  }

  .about-content {
    padding: 100px calc(var(--gap) + var(--page-padding)) 20px;
    align-items: flex-start;
  }

  .about-photo-strip {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
    padding: 0 calc(var(--gap) + var(--page-padding));
    margin-top: 24px;
  }

  .about-strip-photo {
    height: 180px;
    width: 100%;
    opacity: 1;
  }

  #about-overlay .about-content {
    height: auto;
  }

  #about-overlay {
    overflow-y: auto;
  }
}
