:root {
  --bg: #f7f7f4;
  --panel: #f3f3f0;
  --text: #0f0f0f;
  --muted: #666;
  --line: rgba(0, 0, 0, 0.10);
  --white: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.page { min-height: 100vh; }

.site-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f7f4;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.site-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-loader__inner {
  text-align: center;
}

.site-loader__name {
  margin-bottom: 18px;
  color: #111;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-loader__spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 14px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: #111;
  border-radius: 50%;
  animation: portfolio-spin 0.8s linear infinite;
}

.site-loader__text {
  color: rgba(0, 0, 0, 0.58);
  font-size: 14px;
}

@keyframes portfolio-spin {
  to { transform: rotate(360deg); }
}


.site-header,
.hero,
.work,
.about,
.contact {
  max-width: 1440px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 28px;
}

.site-name {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

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

.hero-inner { max-width: 1050px; }

.role {
  margin: 0;
  color: #555;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  margin: 20px 0 0;
  max-width: 1050px;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.95;
  font-weight: 500;
  letter-spacing: -0.055em;
}

.work { padding-bottom: 112px; }

.section-head {
  margin-bottom: 20px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.project-list {
  display: grid;
  gap: 32px;
}

.case-card {
  overflow: hidden;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.case-head { margin-bottom: 32px; }

.case-index {
  margin: 0 0 12px;
  color: #9a9a9a;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.case-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.case-subtitle {
  margin: 14px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.gallery {
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
}

/* Full-width viewer:
   width stays 100%; height follows selected image aspect ratio. */
.main-screen {
  display: block;
  overflow: hidden;
  width: 100%;
  border-radius: 16px;
  background: transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid var(--line);
}

.main-screen img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: transparent;
}

.image-fallback-large {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: transparent;
  color: #9a9a9a;
  font-size: 14px;
}

.thumb-wrap {
  position: relative;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 0;
  background: var(--panel);
}

.thumb-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.thumb {
  flex: 0 0 128px;
  height: 80px;
  overflow: hidden;
  padding: 2px;
  cursor: pointer;
  border: 0;
  border-radius: 10px;
  background: var(--white);
  outline: 1px solid var(--line);
  transition: all 0.18s ease;
}

.thumb:hover { outline-color: rgba(0,0,0,0.30); }

.thumb.active {
  background: #0f0f0f;
  outline: none;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 8px;
  background: var(--white);
}

.thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--white);
  color: #999;
  font-size: 10px;
}

.fade-left,
.fade-right {
  display: none !important;
}

.arrow {
  position: absolute;
  top: 50%;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #333;
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 1px 8px rgba(0,0,0,.10);
  outline: 1px solid var(--line);
  transition: all 0.18s ease;
}

.arrow:hover {
  background: #0f0f0f;
  color: #fff;
}

.arrow-left { left: 12px; }
.arrow-right { right: 12px; }

.figma-note {
  margin: 8px 0 0;
  max-width: 760px;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

.about { padding-bottom: 40px; }

.about-card {
  display: grid;
  grid-template-columns: 0.35fr 0.65fr;
  gap: 24px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.about-card h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.about-card p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.contact { padding-bottom: 96px; }

.contact-card {
  display: grid;
  grid-template-columns: 0.7fr 1fr;
  gap: 32px;
  align-items: end;
  padding: 40px;
  border-radius: 34px;
  background: #0f0f0f;
  color: white;
}

.contact-label {
  margin: 0;
  color: #aaa;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.contact-card h2 {
  margin: 16px 0 0;
  max-width: 720px;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.96;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.contact-copy {
  margin: 0 0 24px;
  color: #d0d0d0;
  font-size: 18px;
  line-height: 1.65;
}

.contact-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.contact-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 16px 20px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background .18s ease;
}

.contact-button:hover { background: rgba(255,255,255,.10); }
.contact-button svg { width: 20px; height: 20px; }

.hidden { display: none !important; }

@media (max-width: 900px) {
  .site-header,
  .hero,
  .work,
  .about,
  .contact {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero {
    padding-top: 40px;
    padding-bottom: 56px;
  }

  .case-card,
  .about-card,
  .contact-card {
    padding: 22px;
    border-radius: 28px;
  }

  .gallery {
    padding: 10px;
    border-radius: 24px;
  }

  .main-screen,
  .main-screen img {
    border-radius: 16px;
  }

  .image-fallback-large {
    min-height: 300px;
    border-radius: 16px;
  }

  .case-subtitle { font-size: 17px; }

  .about-card,
  .contact-card {
    grid-template-columns: 1fr;
  }

  .contact-actions {
    grid-template-columns: 1fr;
  }
}


.main-screen img,
.thumb img {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.main-screen img.is-loaded,
.thumb img.is-loaded {
  opacity: 1;
}

.main-screen,
.thumb {
  background:
    linear-gradient(90deg, #eceae6 25%, #f7f7f4 50%, #eceae6 75%);
  background-size: 200% 100%;
  animation: portfolio-shimmer 1.25s ease-in-out infinite;
}

.main-screen:has(img.is-loaded),
.thumb:has(img.is-loaded) {
  animation: none;
}

@keyframes portfolio-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
