:root {
  --bg: #0d0f16;
  --text: #f6f8fc;
  --muted: #a5afbf;
  --line: rgba(255, 255, 255, 0.11);
  --panel: rgba(255, 255, 255, 0.05);
  --accent: #7dd3fc;
  --accent-2: #c084fc;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.4);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -8%, rgba(130, 140, 255, 0.2), transparent 35rem),
    radial-gradient(circle at 50% 12%, rgba(125, 211, 252, 0.055), transparent 42rem),
    linear-gradient(180deg, rgba(23, 27, 39, 0.8), rgba(13, 15, 22, 0) 34rem),
    var(--bg);
  -webkit-tap-highlight-color: transparent;
}

button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a, .phone-card, .phone-shell, .phone-screen {
  -webkit-tap-highlight-color: transparent;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.024;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 96 96' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.68'/%3E%3C/svg%3E");
  background-size: 96px 96px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(13, 15, 22, 0.78);
  backdrop-filter: blur(18px);
}

.logo {
  font-weight: 900;
  letter-spacing: -0.012em;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-nav a {
  color: var(--muted);
  font-size: 14px;
  transition: color 0.2s ease;
}
.top-nav a:hover { color: var(--text); }

.hero {
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(62px, 8vw, 112px) clamp(18px, 5vw, 72px) 46px;
  text-align: center;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 900px;
  margin: 0 auto 18px;
  font-size: clamp(52px, 8vw, 104px);
  line-height: 0.96;
  letter-spacing: -0.045em;
}

.hero-text {
  margin: 0 auto 16px;
  color: var(--text);
  font-size: clamp(20px, 2.3vw, 28px);
  font-weight: 800;
  letter-spacing: -0.018em;
}

.hero-stack {
  max-width: 780px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.6;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  transition: border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.button:hover {
  box-shadow: 0 12px 34px rgba(125, 211, 252, 0.14);
}
.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101d;
}
.button.secondary, .button.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.playables-section,
.skills-section,
.contact-section,
.footer {
  max-width: 1240px;
  margin: 0 auto;
  padding-left: clamp(18px, 5vw, 72px);
  padding-right: clamp(18px, 5vw, 72px);
}

.playables-section {
  padding-top: 28px;
  padding-bottom: 62px;
}

.gallery-header {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 18px;
  max-width: min(100%, 980px);
  margin: 0 auto 24px;
  text-align: center;
}

.gallery-header h2 {
  margin: 0;
  color: rgba(246, 248, 252, 0.82);
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.025em;
}

.phone-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(18px, 2.4vw, 30px);
  align-items: start;
}

.phone-card {
  position: relative;
  display: grid;
  justify-items: center;
  flex: 1 1 calc((100% - 60px) / 3);
  max-width: calc((100% - 60px) / 3);
  min-width: 0;
  outline: none;
  isolation: isolate;
}

.phone-card::before,
.phone-card::after {
  content: "";
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 0;
  opacity: 0;
  transform: translateX(-50%);
}

.phone-card--wall-frame::before {
  top: 18%;
  width: min(76%, 244px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(54px);
  background: rgba(125, 211, 252, 0.065);
  opacity: 0.58;
}

.phone-shell {
  position: relative;
  width: min(100%, 295px);
  aspect-ratio: 9 / 18.7;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 40px;
  background: linear-gradient(160deg, rgba(255,255,255,0.18), rgba(255,255,255,0.045));
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.08);
  transition: box-shadow 0.22s ease;
  outline: none;
  user-select: none;
  z-index: 1;
}

.phone-card--wall-frame .phone-shell {
  padding: 10px;
  border-color: rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.02)),
    #1a1f27;
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.44),
    inset 0 0 0 1px rgba(255,255,255,0.035);
}

.phone-card:not(.active) .phone-shell {
  cursor: pointer;
}

.phone-card:hover .phone-shell {
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.46), inset 0 0 0 1px rgba(255,255,255,0.09);
}

.phone-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 29px;
  background: #070b12;
  clip-path: inset(0 round 29px);
  outline: none;
  transform: translateZ(0);
}

.phone-screen iframe {
  display: block;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  margin: -1px;
  border: 0;
  border-radius: inherit;
  background: #070b12;
  transform: translateZ(0);
}

.phone-screen iframe[data-scroll-mode="page"] {
  overscroll-behavior: none;
}

.phone-meta {
  position: relative;
  z-index: 1;
  width: min(100%, 295px);
  margin-top: 14px;
  text-align: center;
}

.phone-title {
  display: block;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.preview {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 18%, var(--preview-a), transparent 11rem),
    radial-gradient(circle at 30% 78%, var(--preview-b), transparent 10rem),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
}

.preview::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background: rgba(7, 13, 22, 0.13);
}

.preview-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview:not(.preview-fallback) .preview-icon {
  opacity: 0;
  transform: scale(0.9);
}

.preview:not(.preview-fallback)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle at center, rgba(0,0,0,0.08), rgba(0,0,0,0.34));
}

.preview-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  font-size: 42px;
}

.play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  color: #07111f;
  box-shadow: 0 20px 60px rgba(0,0,0,0.38);
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}
.phone-card:hover .play-button,
.phone-card:focus-within .play-button {
  background: #fff;
  box-shadow: 0 22px 68px rgba(0,0,0,0.46);
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.03);
}
.play-button::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 20px solid currentColor;
}

.pause-button {
  position: absolute;
  top: 23px;
  right: 23px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  background: rgba(7, 13, 22, 0.62);
  color: var(--text);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pause-button:hover {
  background: rgba(7, 13, 22, 0.78);
  border-color: rgba(255,255,255,0.36);
}

.pause-button span {
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: currentColor;
}

.skills-section,
.contact-section {
  padding-top: 20px;
  padding-bottom: 52px;
}

.skills-card,
.contact-card {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255,255,255,0.058), rgba(255,255,255,0.04));
  box-shadow: 0 24px 80px rgba(0,0,0,0.24);
}

.skills-card h2,
.contact-card h2 {
  max-width: 820px;
  margin-bottom: 24px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.032em;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.skills-grid div {
  min-height: 160px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,0.035);
}

.skills-grid h3 {
  margin-bottom: 10px;
  font-size: 17px;
  letter-spacing: -0.03em;
}

.skills-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.contact-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.04));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.contact-card h2,
.contact-subtitle {
  margin-left: clamp(22px, 4vw, 34px);
  margin-right: clamp(22px, 4vw, 34px);
}

.contact-card h2 {
  margin-bottom: 0;
  margin-top: clamp(24px, 4vw, 34px);
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.contact-subtitle {
  margin-top: 10px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.contact-list {
  display: block;
  padding: 0 12px 12px;
}

.contact-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  transition: background 0.16s ease;
}

.contact-item:not(.contact-item--link) {
  grid-template-columns: 112px minmax(0, 1fr) auto;
}

.contact-item--link {
  cursor: pointer;
}

.contact-item:first-child {
  border-top-color: rgba(255,255,255,0.18);
}

.contact-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.contact-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
}

.contact-button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  justify-self: end;
}

.contact-item:hover,
.contact-button:hover,
.copy-button:hover {
  background: rgba(255,255,255,0.085);
}

.contact-button:hover,
.copy-button:hover {
  border-color: rgba(255,255,255,0.28);
  transform: translateY(-1px);
}

.footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 44px;
  color: var(--muted);
}
.footer p { margin: 0; }

@media (max-width: 1060px) {
  .phone-card {
    flex-basis: calc((100% - 30px) / 2);
    max-width: calc((100% - 30px) / 2);
  }
  .phone-shell { width: min(100%, 310px); }
  .phone-meta { width: min(100%, 310px); }
  .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .contact-card h2,
  .contact-subtitle {
    margin-left: 22px;
    margin-right: 22px;
  }

  .contact-card h2 {
    margin-top: 26px;
  }

  .contact-subtitle {
    margin-bottom: 18px;
  }

  .contact-list {
    padding: 0 8px 8px;
  }

  .contact-item {
    grid-template-columns: auto auto 1fr;
    gap: 9px;
    padding: 16px 14px;
  }

  .contact-label,
  .contact-value {
    grid-column: 1 / -1;
  }

  .contact-value {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .contact-button,
  .copy-button {
    justify-self: start;
  }

  .phone-screen iframe[data-scroll-mode="page"] {
    touch-action: pan-y;
  }
}

@media (max-width: 700px) {
  .top-nav { display: none; }
  .site-header { padding-top: 14px; padding-bottom: 14px; }
  .hero { text-align: left; }
  .hero-actions { justify-content: center; }
  .gallery-header {
    align-items: center;
    flex-direction: column;
  }
  .phone-card {
    flex-basis: 100%;
    max-width: 100%;
  }
  .phone-shell { width: min(88vw, 330px); }
  .phone-meta { width: min(88vw, 330px); }
  .skills-grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; }
}

.gallery-more {
  display: none;
}

@media (max-width: 700px) {
  .gallery-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin: 8px auto 0;
    padding: 0 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,255,255,0.065);
    color: var(--text);
    cursor: pointer;
    font-weight: 900;
    transition: border-color 0.2s ease, background 0.2s ease;
  }

  .gallery-more:hover {
    border-color: rgba(125, 211, 252, 0.55);
    background: rgba(255,255,255,0.095);
  }
}
