/*
  Apple-inspired portfolio styling
  Updated to highlight hero identity, immersive gallery, and case storytelling.
*/
:root {
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-panel: rgba(255, 255, 255, 0.82);
  --color-text: #1d1d1f;
  --color-text-muted: #515154;
  --color-accent: #0071e3;
  --color-border: rgba(255, 255, 255, 0.6);
  --radius-hero: 44px;
  --radius-large: 36px;
  --radius-medium: 24px;
  --radius-small: 14px;
  --shadow-large: 0 28px 80px rgba(15, 23, 42, 0.14);
  --shadow-medium: 0 22px 50px rgba(15, 23, 42, 0.14);
  --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.1);
  --transition: all 240ms ease;
  --max-width: 1180px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'SF Pro Text', 'PingFang SC', 'Microsoft YaHei', -apple-system,
    BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(24px, 6vw, 72px);
  background: rgba(245, 245, 247, 0.85);
  backdrop-filter: blur(16px);
  z-index: 10;
}

.primary-nav {
  display: flex;
  gap: 18px;
  font-size: 0.95rem;
}

.primary-nav a {
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--color-text-muted);
  transition: var(--transition);
}

.primary-nav a:hover,
.primary-nav a:focus {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.04);
}

.language-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--color-border);
}

.lang-btn {
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.lang-btn.active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.hero {
  position: relative;
  min-height: 95vh;
  padding: clamp(88px, 18vw, 200px) clamp(28px, 8vw, 112px);
  overflow: hidden;
  display: flex;
  align-items: center;
  background:
    radial-gradient(60% 80% at 10% 20%, rgba(0, 113, 227, 0.3), transparent),
    radial-gradient(70% 80% at 90% 15%, rgba(120, 186, 255, 0.28), transparent),
    linear-gradient(140deg, #f5f5f7 0%, #e6edff 55%, #eaf8ff 100%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.12) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(var(--max-width), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(40px, 6vw, 110px);
  align-items: center;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-eyebrow {
  font-size: 0.95rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin: 0;
  color: rgba(29, 29, 31, 0.6);
}

.hero-title {
  margin: 0;
  font-family: 'SF Pro Display', 'PingFang SC', sans-serif;
  font-size: clamp(3rem, 5.5vw, 4.6rem);
  line-height: 1.08;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-name {
  font-weight: 600;
  letter-spacing: 0.06em;
}

.hero-name-secondary {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  color: rgba(29, 29, 31, 0.68);
}

.hero-description {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.9;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: var(--transition);
}

.btn.primary {
  background: var(--color-text);
  color: #fff;
}

.btn.primary:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
}

.btn.soft {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text);
}

.btn.soft:hover {
  background: rgba(0, 0, 0, 0.1);
}

.btn.link {
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.7);
}

.btn.link:hover {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.9);
}

.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
}

.portrait-frame {
  width: min(420px, 100%);
  border-radius: var(--radius-hero);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-large);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.6)),
    radial-gradient(circle at 35% 20%, rgba(0, 113, 227, 0.28), transparent 65%),
    radial-gradient(circle at 75% 90%, rgba(120, 186, 255, 0.26), transparent 60%);
  padding: 22px;
}

.portrait-frame img {
  width: 100%;
  border-radius: calc(var(--radius-hero) - 20px);
  filter: saturate(1.05);
}

.hero-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-chip {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section {
  padding: clamp(110px, 13vw, 160px) clamp(28px, 8vw, 112px);
}

.section-inner {
  width: min(var(--max-width), 100%);
  margin: 0 auto;
  display: grid;
  gap: clamp(36px, 6vw, 72px);
}

.section h2 {
  margin: 0;
  font-family: 'SF Pro Display', 'PingFang SC', sans-serif;
  font-size: clamp(2.2rem, 3.4vw, 3rem);
  font-weight: 600;
}

.story {
  background: var(--color-surface);
}

.story-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  color: var(--color-text-muted);
  font-size: 1.08rem;
  line-height: 1.95;
}

.story-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}

.fact-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(29, 29, 31, 0.58);
  margin-bottom: 6px;
}

.fact-value {
  font-size: 1.05rem;
  font-weight: 500;
}

.capabilities {
  background: linear-gradient(135deg, #eef2ff, #f5f5f7 65%);
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(24px, 4vw, 32px);
}

.capability-card {
  background: var(--color-panel);
  border-radius: var(--radius-medium);
  padding: clamp(26px, 4.4vw, 40px);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.capability-card h3 {
  margin: 0 0 12px;
  font-size: 1.3rem;
}

.capability-card p {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.85;
}

.feature-project {
  background: var(--color-surface);
}

.project-hero {
  display: grid;
  gap: 18px;
  max-width: 780px;
}

.project-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(29, 29, 31, 0.65);
  width: fit-content;
}

.project-summary {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1.2rem;
  line-height: 1.9;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: rgba(29, 29, 31, 0.7);
}

.project-tags span {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(29, 29, 31, 0.12);
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-link {
  font-weight: 500;
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-link::after {
  content: '↗';
  font-size: 1.1rem;
}

.case-scroll {
  display: grid;
  gap: clamp(32px, 5vw, 48px);
}

.case-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

.case-visual {
  border-radius: var(--radius-large);
  min-height: 320px;
  box-shadow: var(--shadow-medium);
  position: relative;
  overflow: hidden;
}

.case-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.1));
}

.case-visual-1 {
  background: radial-gradient(circle at 20% 20%, rgba(0, 113, 227, 0.32), transparent 60%),
    linear-gradient(135deg, #e6ecff, #f5f5f7);
}

.case-visual-2 {
  background: radial-gradient(circle at 80% 30%, rgba(94, 186, 255, 0.35), transparent 62%),
    linear-gradient(135deg, #f5f5f7, #f2f9ff);
}

.case-visual-3 {
  background: radial-gradient(circle at 30% 80%, rgba(120, 186, 255, 0.32), transparent 60%),
    linear-gradient(135deg, #eef4ff, #f5f5f7);
}

.case-copy h3 {
  margin: 0 0 10px;
  font-size: 1.45rem;
}

.case-copy p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.highlights {
  background: linear-gradient(135deg, #ffffff 0%, #eef3ff 100%);
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(24px, 4vw, 32px);
}

.highlight-card {
  background: var(--color-panel);
  border-radius: var(--radius-medium);
  padding: clamp(26px, 4.2vw, 38px);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.highlight-card h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.highlight-card p {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.85;
}

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

.gallery-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.gallery-header p {
  color: var(--color-text-muted);
  margin: 12px 0 0;
  max-width: 520px;
}

.gallery-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 70vw);
  gap: clamp(18px, 4vw, 32px);
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.gallery-rail::-webkit-scrollbar {
  height: 8px;
}

.gallery-rail::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 999px;
}

.gallery-slide {
  position: relative;
  border-radius: var(--radius-large);
  min-height: 420px;
  box-shadow: var(--shadow-medium);
  scroll-snap-align: start;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 24px;
}

.gallery-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.gallery-caption {
  position: relative;
  z-index: 1;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

.gallery-item-1 {
  background: radial-gradient(circle at 20% 20%, rgba(0, 113, 227, 0.4), transparent 55%),
    linear-gradient(135deg, #1f2b56, #0b152b);
}

.gallery-item-2 {
  background: radial-gradient(circle at 70% 15%, rgba(120, 186, 255, 0.38), transparent 60%),
    linear-gradient(135deg, #172d3f, #071827);
}

.gallery-item-3 {
  background: radial-gradient(circle at 30% 80%, rgba(94, 186, 255, 0.4), transparent 66%),
    linear-gradient(135deg, #26334d, #0f1a2f);
}

.gallery-item-4 {
  background: radial-gradient(circle at 70% 70%, rgba(127, 191, 255, 0.4), transparent 60%),
    linear-gradient(135deg, #1c2438, #080f1f);
}

.gallery-item-5 {
  background: radial-gradient(circle at 15% 50%, rgba(94, 186, 255, 0.42), transparent 60%),
    linear-gradient(135deg, #242d46, #0b1426);
}

.gallery-item-6 {
  background: radial-gradient(circle at 55% 25%, rgba(0, 113, 227, 0.4), transparent 60%),
    linear-gradient(135deg, #1c2237, #090f1d);
}

.site-footer {
  padding: clamp(110px, 13vw, 160px) clamp(28px, 8vw, 112px);
  background: linear-gradient(135deg, #11121e 0%, #1c2234 100%);
  color: #fff;
}

.footer-content {
  width: min(720px, 100%);
  display: grid;
  gap: 24px;
  text-align: center;
  margin: 0 auto 56px;
}

.footer-content p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.85;
}

.contact-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.contact-chip {
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  transition: var(--transition);
  backdrop-filter: blur(6px);
}

.contact-chip:hover {
  background: rgba(255, 255, 255, 0.14);
}

.footnote {
  text-align: center;
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .case-section {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .case-visual {
    order: -1;
  }

  .hero-description {
    max-width: 100%;
  }
}

@media (max-width: 960px) {
  .site-header {
    position: static;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  .primary-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero {
    min-height: auto;
    padding-top: 140px;
  }

  .hero-content {
    justify-items: center;
    text-align: center;
  }

  .hero-visual {
    align-items: center;
  }

  .hero-chip-row {
    justify-content: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .gallery-rail {
    grid-auto-columns: minmax(240px, 82vw);
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 18px 18px;
  }

  .hero-title {
    font-size: 2.6rem;
  }

  .hero-name-secondary {
    font-size: 2rem;
  }

  .capability-grid,
  .highlight-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
