/* ═══════════════════════════════════════════════════════════════════════════
   Apple-inspired Portfolio — Design System
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────────────────── */

:root {
  --white:        #ffffff;
  --bg-page:      #ffffff;
  --bg-alt:       #f5f5f7;
  --bg-card:      #ffffff;
  --border:       #d2d2d7;
  --border-light: #e8e8ed;
  --text:         #1d1d1f;
  --text-2:       #6e6e73;
  --text-3:       #86868b;
  --blue:         #0071e3;
  --blue-hover:   #0077ed;
  --blue-active:  #006edb;
  --nav-bg:       rgba(255, 255, 255, .88);
  --nav-h:        44px;
  --r:            18px;
  --r-sm:         10px;
  --shadow-sm:    0 2px 12px rgba(0, 0, 0, .06);
  --shadow-md:    0 4px 24px rgba(0, 0, 0, .09);
  --shadow-lg:    0 12px 48px rgba(0, 0, 0, .14);
  --ease:         cubic-bezier(.4, 0, .2, 1);
  --dur:          .22s;
  --font:         -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
                  "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 17px; }

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.58824;           /* Apple's body line-height */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: var(--font); }

.container {
  width: min(100%, 980px);        /* Apple's signature 980px content column */
  margin-inline: auto;
  padding-inline: 22px;
}

/* ── Skip link ─────────────────────────────────────────────────────────────── */

.skip-link {
  position: fixed;
  top: -100px;
  left: 50%;
  translate: -50% 0;
  z-index: 500;
  background: var(--text);
  color: #fff;
  padding: 10px 22px;
  border-radius: 980px;
  font-size: .82rem;
  font-weight: 500;
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 12px; outline: none; box-shadow: 0 0 0 4px rgba(0,113,227,.4); }

/* ── Focus visible ─────────────────────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */

.header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .09);
}

.nav {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  gap: 0;
}

.nav-logo {
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
  flex-shrink: 0;
  transition: opacity var(--dur) var(--ease);
}
.nav-logo:hover { opacity: .7; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  justify-content: center;       /* center nav links like apple.com */
}

.nav-links a {
  font-size: .76rem;
  color: var(--text);
  padding: 0 14px;
  line-height: var(--nav-h);
  transition: opacity var(--dur) var(--ease);
  white-space: nowrap;
}
.nav-links a:hover { opacity: .55; }

#langToggle {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 13px;
  border-radius: 980px;
  font-size: .76rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  letter-spacing: -.01em;
}
#langToggle:hover {
  background: rgba(0, 0, 0, .05);
  border-color: #a1a1a6;
}

#menuToggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 8px;
  border-radius: 8px;
  transition: background var(--dur);
}
#menuToggle:hover { background: rgba(0,0,0,.05); }
#menuToggle svg { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════════════════ */

.hero {
  background: radial-gradient(ellipse 110% 90% at 50% -5%, #dceefe 0%, #f0f7ff 30%, #ffffff 65%);
  padding: 100px 0 90px;
  text-align: center;
  overflow: hidden;
}

.hero-greeting {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 16px;
}

.hero-name {
  font-size: clamp(3.2rem, 7.5vw, 6rem);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.025;
  color: var(--text);
  text-wrap: balance;
}

.hero-tagline {
  margin-top: 20px;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 400;
  color: var(--text-2);
  letter-spacing: -.01em;
  line-height: 1.35;
}

.hero-bio {
  max-width: 560px;
  margin: 18px auto 0;
  font-size: .94rem;
  color: var(--text-3);
  line-height: 1.65;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

/* ── Buttons (Apple pill style) ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: 980px;           /* Apple's full-pill shape */
  font-size: .94rem;
  font-weight: 400;
  letter-spacing: -.01em;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease), scale var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:active { scale: .97; }

.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover {
  background: var(--blue-hover);
  box-shadow: 0 4px 18px rgba(0, 113, 227, .35);
}

.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--blue);
}
.btn-outline:hover {
  background: var(--blue);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION SCAFFOLDING
   ═══════════════════════════════════════════════════════════════════════════ */

.section     { padding: 96px 0; background: var(--bg-page); }
.section-alt { background: var(--bg-alt); }

.section-header { margin-bottom: 48px; }

.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -.035em;
  color: var(--text);
  line-height: 1.07;
  text-wrap: balance;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GAME CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

/* Hide the old colored top-strip */
.card-accent { display: none; }

.card {
  background: var(--bg-card);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
  touch-action: manipulation;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px) scale(1.005);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* gradient set by inline style via app.js */
}

.card-initial {
  font-size: 5rem;
  font-weight: 700;
  letter-spacing: -.06em;
  opacity: .75;
  line-height: 1;
}

.card-body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1.25;
}

.card-desc {
  font-size: .82rem;
  color: var(--text-2);
  line-height: 1.55;
  flex: 1;
  margin-top: 2px;
}

.card-link {
  display: inline-block;
  margin-top: 10px;
  font-size: .82rem;
  font-weight: 400;
  color: var(--blue);
}
.card:hover .card-link { text-decoration: underline; text-underline-offset: 2px; }

/* ═══════════════════════════════════════════════════════════════════════════
   BLOG LIST
   ═══════════════════════════════════════════════════════════════════════════ */

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 2px;                       /* Apple News-style tight list */
}

/* Hide old left-bar accent */
.blog-accent { display: none; }

.blog-card {
  background: var(--bg-card);
  border-radius: var(--r);
  overflow: hidden;
  padding: 26px 28px;

  /* Override the old grid layout — flat flex column */
  display: flex;
  flex-direction: column;
  gap: 6px;

  box-shadow: none;
  border: 1px solid var(--border-light);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease),
              background var(--dur) var(--ease);
  touch-action: manipulation;
}
.blog-card:hover {
  background: var(--bg-alt);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Reset grid-column: 2 from old layout */
.blog-meta,
.blog-title,
.blog-desc,
.blog-card .card-link { grid-column: unset; }

.blog-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.blog-date {
  font-size: .76rem;
  color: var(--text-3);
  letter-spacing: .01em;
}

.blog-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -.022em;
  color: var(--text);
  line-height: 1.25;
  text-wrap: balance;
}

.blog-desc {
  font-size: .82rem;
  color: var(--text-2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card .card-link {
  margin-top: 6px;
  font-size: .82rem;
  color: var(--blue);
  font-weight: 400;
}
.blog-card:hover .card-link { text-decoration: underline; text-underline-offset: 2px; }

/* ── Tag pill ───────────────────────────────────────────────────────────────── */

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 980px;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
  /* color & background set inline by app.js */
}

/* ═══════════════════════════════════════════════════════════════════════════
   ABOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.about-inner { max-width: 660px; }

.about-inner p {
  font-size: .94rem;
  color: var(--text-2);
  line-height: 1.72;
  margin-bottom: 16px;
}

.contact-row {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
}

.contact-row span { color: var(--text-2); }

.contact-row a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 400;
}
.contact-row a:hover { color: var(--blue-hover); }

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */

.footer {
  background: var(--text);         /* #1d1d1f — Apple's dark footer */
  color: var(--text-3);
  border-top: 1px solid #424245;
  padding: 20px 0 24px;
  font-size: .76rem;
  line-height: 1.6;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy { color: #6e6e73; }

/* ═══════════════════════════════════════════════════════════════════════════
   FADE-IN ANIMATION (scroll-triggered via class added by JS)
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anim { opacity: 0; }
.anim.visible {
  animation: fadeUp .55s var(--ease) forwards;
}

.grid .card:nth-child(1) { animation-delay: .0s; }
.grid .card:nth-child(2) { animation-delay: .07s; }
.grid .card:nth-child(3) { animation-delay: .14s; }
.grid .card:nth-child(4) { animation-delay: .21s; }
.grid .card:nth-child(5) { animation-delay: .28s; }
.grid .card:nth-child(6) { animation-delay: .35s; }

.blog-list .blog-card:nth-child(1) { animation-delay: .0s; }
.blog-list .blog-card:nth-child(2) { animation-delay: .07s; }
.blog-list .blog-card:nth-child(3) { animation-delay: .14s; }
.blog-list .blog-card:nth-child(4) { animation-delay: .21s; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 680px) {
  /* Nav collapses to hamburger */
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    z-index: 199;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    font-size: 1.3rem;
    font-weight: 500;
    padding: 20px 40px;
    line-height: 1;
    letter-spacing: -.02em;
  }

  #menuToggle { display: flex; margin-left: auto; margin-right: 4px; }
  #langToggle { margin-left: 0; }

  .hero { padding: 72px 0 64px; }
  .section { padding: 72px 0; }

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

  .blog-card { padding: 20px; }
  .footer-inner { justify-content: center; text-align: center; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
  }
  html { scroll-behavior: auto; }
  .anim { opacity: 1; }
  .card:hover, .blog-card:hover, .btn:hover { transform: none; }
}
