/* --- tokens --- */
:root {
  --bg: #0c0e12;
  --bg-elevated: #12151c;
  --surface: #181c26;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaef;
  --muted: #9aa3b2;
  --accent: #6ee7c5;
  --accent-dim: rgba(110, 231, 197, 0.15);
  --accent-glow: rgba(110, 231, 197, 0.35);
  --font-sans: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --header-h: 72px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  border-radius: 8px;
  transition: top 0.2s var(--ease-out);
}

.skip-link:focus {
  top: 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wrap {
  width: min(1100px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* --- header --- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.25s var(--ease-out), border-color 0.25s var(--ease-out),
    backdrop-filter 0.25s var(--ease-out);
}

.site-header.is-scrolled {
  background: rgba(12, 14, 18, 0.82);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

.header-inner {
  width: min(1100px, calc(100% - 2.5rem));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.logo-dot {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-nav a {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-cta {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text) !important;
}

.nav-cta:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  position: relative;
}

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.25s var(--ease-out), opacity 0.2s;
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 50%;
  translate: -50% 0;
}

.nav-toggle-bar::before {
  top: 15px;
}

.nav-toggle-bar::after {
  bottom: 15px;
}

.site-header.nav-open .nav-toggle-bar {
  background: transparent;
}

.site-header.nav-open .nav-toggle-bar::before {
  top: 21px;
  transform: rotate(45deg);
}

.site-header.nav-open .nav-toggle-bar::after {
  bottom: 21px;
  transform: rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem 1.25rem 1.25rem;
    background: rgba(12, 14, 18, 0.96);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease-out), opacity 0.25s;
  }

  .site-header.nav-open .site-nav {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
  }

  .site-nav a:last-child {
    border-bottom: 0;
    margin-top: 0.5rem;
    text-align: center;
  }
}

/* --- hero --- */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 4rem) 0 5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 85%;
  background: radial-gradient(
      ellipse 70% 55% at 50% 0%,
      var(--accent-glow),
      transparent 70%
    ),
    radial-gradient(ellipse 50% 40% at 80% 20%, rgba(99, 102, 241, 0.12), transparent);
  pointer-events: none;
}

.hero-inner {
  position: relative;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 1rem;
}

.hero-title {
  margin: 0 0 1.25rem;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-name {
  display: block;
  background: linear-gradient(135deg, #fff 0%, #c8cdd8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-line {
  display: block;
  margin-top: 0.35em;
  font-size: 0.55em;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: -0.02em;
}

.hero-lead {
  max-width: 36rem;
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.125rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, border-color 0.2s,
    background 0.2s;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 12px 40px var(--accent-glow);
}

.btn-ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--muted);
  background: var(--surface);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

/* --- sections --- */
.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--bg-elevated);
  border-block: 1px solid var(--border);
}

.section-title {
  margin: 0 0 2rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.about-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr 280px;
  align-items: start;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.about-copy p {
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 42rem;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.about-facts {
  list-style: none;
  margin: 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.about-facts li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.about-facts li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.fact-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.skill-tags li {
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.project-cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  .project-cards {
    grid-template-columns: 1fr;
  }
}

.project-card {
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.25s, transform 0.25s var(--ease-out);
}

.project-card:hover {
  border-color: rgba(110, 231, 197, 0.35);
  transform: translateY(-3px);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.project-tag {
  color: var(--accent);
}

.project-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.project-card p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.project-link {
  font-weight: 600;
  font-size: 0.875rem;
}

.btn-sm {
  padding: 0.5rem 1.15rem;
  font-size: 0.875rem;
}

.project-actions {
  margin-top: 0.15rem;
}

.project-card--feature .project-meta {
  margin-bottom: 0.75rem;
}

.project-card-visual img {
  display: block;
  width: clamp(104px, 26vw, 160px);
  height: auto;
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* Premium app icon (Termion): gradient halo + hover lift */
.project-icon-frame {
  position: relative;
  display: inline-flex;
  border-radius: 34px;
  padding: 3px;
  background: linear-gradient(
    148deg,
    rgba(110, 231, 197, 0.65) 0%,
    rgba(110, 231, 197, 0.12) 38%,
    rgba(255, 255, 255, 0.16) 62%,
    rgba(110, 231, 197, 0.1) 100%
  );
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45) inset,
    0 22px 56px rgba(0, 0, 0, 0.48),
    0 0 48px rgba(110, 231, 197, 0.14);
  transition:
    transform 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out);
}

.project-icon-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.project-card--feature:has(.project-icon-frame):hover .project-icon-frame {
  transform: translateY(-5px) scale(1.03);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 28px 64px rgba(0, 0, 0, 0.55),
    0 0 72px rgba(110, 231, 197, 0.28);
}

.project-icon-frame .project-app-icon {
  position: relative;
  z-index: 1;
  display: block;
  width: clamp(118px, 15.5vw, 154px);
  aspect-ratio: 1;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 31px;
  background: #060606;
  border: none;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .project-icon-frame,
  .project-card--feature:has(.project-icon-frame):hover .project-icon-frame {
    transform: none;
    transition: none;
  }
}

.project-card-body {
  min-width: 0;
}

@media (min-width: 901px) {
  .project-card--feature {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    align-items: center;
  }
}

@media (max-width: 900px) {
  .project-card--feature {
    text-align: center;
  }

  .project-card--feature .project-card-visual {
    display: flex;
    justify-content: center;
    padding-bottom: 0.25rem;
  }

  .project-card--feature .project-actions {
    display: flex;
    justify-content: center;
  }
}

/* --- project detail (weather-krd) --- */
.detail-page .detail-main {
  padding-top: calc(var(--header-h) + 2.5rem);
  padding-bottom: 4rem;
}

.crumb {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.crumb a {
  color: var(--muted);
}

.crumb a:hover {
  color: var(--accent);
}

.detail-head .detail-eyebrow {
  margin-bottom: 0.75rem;
}

.detail-head {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr auto;
  align-items: start;
  margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
  .detail-head {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

.detail-title {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.detail-lead {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
  font-size: 1.125rem;
}

.detail-tagline {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.015em;
  line-height: 1.45;
  max-width: 42rem;
}

.detail-icon-wrap img {
  display: block;
  width: clamp(120px, 36vw, 180px);
  height: auto;
  border-radius: 40px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.detail-prose h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.detail-prose h2:first-of-type {
  margin-top: 0;
}

.detail-prose p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.detail-prose strong {
  color: var(--text);
  font-weight: 600;
}

.detail-prose code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  padding: 0.12em 0.35em;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.detail-prose .detail-list {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
  color: var(--muted);
}

.detail-list li {
  margin-bottom: 0.75rem;
}

.detail-list li:last-child {
  margin-bottom: 0;
}

.detail-list--checks {
  list-style: none;
  padding-left: 0;
}

.detail-list--checks li {
  padding-left: 1.35rem;
  position: relative;
}

.detail-list--checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.detail-video-section {
  margin-top: 2.75rem;
}

.detail-video-section > h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.detail-video-note {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
}

.detail-video-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: var(--shadow);
}

.detail-video {
  display: block;
  width: 100%;
  max-height: min(70vh, 720px);
  margin: 0 auto;
}

.video-fallback {
  margin-top: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.video-fallback[hidden] {
  display: none !important;
}

.video-fallback-hint {
  padding: 0.65rem 0.85rem;
  margin: 0 0 1rem !important;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.1);
  font-size: 0.875rem;
  color: #fcd34d;
  line-height: 1.5;
}

.video-fallback-hint[hidden] {
  display: none !important;
}

.video-fallback p {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.55;
}

.video-fallback strong {
  color: var(--text);
}

.video-fallback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem !important;
  margin-bottom: 0 !important;
}

.exe-panel {
  margin-top: 2.75rem;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(110, 231, 197, 0.4);
  background: var(--accent-dim);
}

.exe-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.exe-panel > p:first-of-type {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.exe-note {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 1rem 0 0;
  line-height: 1.55;
}

.ipa-panel {
  margin-top: 2.75rem;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(110, 231, 197, 0.4);
  background: var(--accent-dim);
}

.ipa-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ipa-panel > p:first-of-type {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.ipa-note {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 1rem 0 0;
  line-height: 1.55;
}

.download-duo {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.75rem;
}

@media (min-width: 720px) {
  .download-duo {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.download-duo .ipa-panel {
  margin-top: 0;
}

.clipcatch-try-duo {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.75rem;
}

@media (min-width: 720px) {
  .clipcatch-try-duo {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.clipcatch-try-duo .ipa-panel {
  margin-top: 0;
}

.clipcatch-web-cta {
  border-color: rgba(230, 57, 70, 0.45);
  background: rgba(230, 57, 70, 0.08);
}

.clipcatch-bot-cta {
  border-color: rgba(42, 171, 238, 0.45);
  background: rgba(42, 171, 238, 0.08);
}

.clipcatch-web-cta .btn-primary,
.clipcatch-bot-cta .btn-primary {
  color: #fff;
  border-color: transparent;
}

.clipcatch-web-cta .btn-primary {
  background: #e63946;
}

.clipcatch-web-cta .btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 24px rgba(230, 57, 70, 0.45);
}

.clipcatch-bot-cta .btn-primary {
  background: #2aabee;
}

.clipcatch-bot-cta .btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 24px rgba(42, 171, 238, 0.45);
}

.section-cta {
  padding: 5.5rem 0;
  text-align: center;
}

.contact-block .section-title {
  margin-bottom: 1rem;
}

.contact-lead {
  max-width: 32rem;
  margin: 0 auto 1.75rem;
  color: var(--muted);
}

.social-row {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.social-row a {
  color: var(--muted);
}

.social-row a:hover {
  color: var(--accent);
}

.dot {
  margin: 0 0.35rem;
  opacity: 0.5;
}

/* --- footer (shared across pages) --- */
.site-footer {
  flex-shrink: 0;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 100%);
}

.footer-shell {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.footer-grid {
  display: grid;
  gap: 2rem 2.5rem;
  grid-template-columns: minmax(200px, 1.35fr) repeat(3, minmax(0, 1fr));
  align-items: start;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand {
  min-width: 0;
}

.footer-logo {
  display: inline-block;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.footer-logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.footer-tagline {
  margin: 0.65rem 0 0;
  max-width: 22rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--muted);
}

.footer-col-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.footer-copy {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

.footer-built {
  opacity: 0.85;
}

.to-top {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s var(--ease-out);
  flex-shrink: 0;
}

.to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .to-top:hover {
    transform: none;
  }
}

/* --- scroll reveal --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

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

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --- home page (index) --- */
.page-home .hero {
  padding-bottom: 6rem;
}

.page-home .hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 20%, transparent 75%);
  pointer-events: none;
}

.page-home .hero-bg {
  inset: -30% -15% auto -15%;
  height: 95%;
  background:
    radial-gradient(ellipse 65% 50% at 20% 0%, var(--accent-glow), transparent 65%),
    radial-gradient(ellipse 45% 40% at 85% 15%, rgba(99, 102, 241, 0.18), transparent),
    radial-gradient(ellipse 35% 30% at 60% 40%, rgba(225, 29, 72, 0.06), transparent);
}

.page-home .hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
}

.page-home .hero-stats li {
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  background: rgba(24, 28, 38, 0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.page-home .hero-stat-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  margin-right: 0.35rem;
}

.page-home .section-head {
  margin-bottom: 2.5rem;
  max-width: 40rem;
}

.page-home .section-head .section-title {
  margin-bottom: 0.65rem;
}

.page-home .section-desc {
  margin: 0;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.page-home .section-desc strong {
  color: var(--text);
  font-weight: 600;
}

.page-home .about-facts {
  position: relative;
  overflow: hidden;
}

.page-home .about-facts::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
  opacity: 0.5;
}

.page-home .skill-tags li {
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.2s var(--ease-out),
    box-shadow 0.2s;
}

.page-home .skill-tags li:hover {
  border-color: rgba(110, 231, 197, 0.45);
  background: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.page-home .section-projects {
  position: relative;
}

.page-home .section-projects::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(110, 231, 197, 0.04), transparent);
  pointer-events: none;
}

.page-home .project-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.page-home .project-card--feature {
  grid-column: span 1;
}

.page-home .project-card--site {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(24, 28, 38, 0.6) 100%);
}

.page-home .project-card--site .project-card-body--full {
  max-width: 52rem;
}

.page-home .project-card--site .project-link {
  display: inline-block;
  margin-top: 0.25rem;
}

@media (min-width: 901px) {
  .page-home .project-card--feature {
    grid-template-columns: auto 1fr;
    gap: 1.5rem 1.75rem;
    padding: 1.5rem 1.75rem;
  }

  .page-home .project-card-visual img {
    width: 120px;
    border-radius: 24px;
  }

  .page-home .project-icon-frame .project-app-icon {
    width: 114px;
  }
}

@media (max-width: 900px) {
  .page-home .project-cards {
    grid-template-columns: 1fr;
  }
}

.page-home .project-card[data-reveal]:nth-child(1) {
  transition-delay: 0ms;
}
.page-home .project-card[data-reveal]:nth-child(2) {
  transition-delay: 60ms;
}
.page-home .project-card[data-reveal]:nth-child(3) {
  transition-delay: 120ms;
}
.page-home .project-card[data-reveal]:nth-child(4) {
  transition-delay: 180ms;
}
.page-home .project-card[data-reveal]:nth-child(5) {
  transition-delay: 240ms;
}
.page-home .project-card[data-reveal]:nth-child(6) {
  transition-delay: 300ms;
}

.page-home .project-card {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.page-home .project-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(110, 231, 197, 0.12);
}

.page-home .contact-block {
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(
    160deg,
    rgba(110, 231, 197, 0.08) 0%,
    var(--surface) 45%,
    var(--bg-elevated) 100%
  );
  box-shadow: var(--shadow);
}

.page-home .section-cta .wrap {
  width: min(720px, calc(100% - 2.5rem));
}

@media (prefers-reduced-motion: reduce) {
  .page-home .skill-tags li:hover {
    transform: none;
  }

  .page-home .project-card[data-reveal] {
    transition-delay: 0ms !important;
  }
}

/* --- polished project detail pages --- */
.detail-polished .detail-main {
  padding-bottom: 5rem;
}

.detail-polished .crumb {
  margin-bottom: 1.25rem;
}

.detail-hero {
  position: relative;
  margin-bottom: 2.5rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.detail-hero-bg {
  position: absolute;
  inset: -40% -20% 0 -20%;
  height: 120%;
  pointer-events: none;
  opacity: 0.9;
}

.detail-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 90% 80% at 30% 0%, black 15%, transparent 70%);
  pointer-events: none;
}

.detail-hero-inner {
  position: relative;
}

.detail-polished .detail-head {
  margin-bottom: 1.25rem;
}

.detail-polished .detail-title {
  background: linear-gradient(135deg, #fff 0%, #b8c0d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.detail-stats li {
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  background: rgba(24, 28, 38, 0.8);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.detail-stat-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--detail-accent, var(--accent));
  margin-right: 0.3rem;
}

.detail-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.detail-polished .detail-icon-wrap {
  position: relative;
}

.termion-page {
  --detail-accent: #6ee7c5;
  --detail-glow: rgba(110, 231, 197, 0.35);
}

.termion-page .detail-eyebrow,
.termion-page .detail-tagline {
  color: var(--detail-accent);
}

.termion-page .detail-hero-bg {
  background:
    radial-gradient(ellipse 60% 50% at 15% 0%, var(--detail-glow), transparent 65%),
    radial-gradient(ellipse 40% 35% at 90% 20%, rgba(99, 102, 241, 0.12), transparent);
}

.termion-page .detail-icon-wrap {
  padding: 4px;
  border-radius: 38px;
  background: linear-gradient(
    148deg,
    rgba(110, 231, 197, 0.65) 0%,
    rgba(110, 231, 197, 0.12) 45%,
    rgba(255, 255, 255, 0.14) 100%
  );
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 22px 56px rgba(0, 0, 0, 0.45),
    0 0 48px var(--detail-glow);
}

.termion-page .detail-icon-wrap img {
  border-radius: 34px;
  border: none;
  box-shadow: none;
}

.clipcatch-page {
  --detail-accent: #fb7185;
  --detail-glow: rgba(251, 113, 133, 0.35);
}

.clipcatch-page .detail-eyebrow,
.clipcatch-page .detail-tagline {
  color: var(--detail-accent);
}

.clipcatch-page .detail-hero-bg {
  background:
    radial-gradient(ellipse 55% 45% at 20% 0%, var(--detail-glow), transparent 65%),
    radial-gradient(ellipse 35% 30% at 85% 30%, rgba(220, 38, 38, 0.08), transparent);
}

.clipcatch-page .detail-icon-wrap img {
  border-radius: 28%;
  box-shadow:
    0 0 0 1px rgba(251, 113, 133, 0.25),
    0 20px 48px rgba(251, 113, 133, 0.15),
    0 8px 24px rgba(0, 0, 0, 0.4);
}

.detail-polished .detail-prose {
  padding: 2rem 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(18, 21, 28, 0.85) 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.detail-polished .detail-prose h2 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.detail-polished .detail-prose h2::before {
  content: "";
  width: 4px;
  height: 1.1em;
  border-radius: 2px;
  background: var(--detail-accent, var(--accent));
  flex-shrink: 0;
}

.detail-polished .detail-list--checks li {
  padding-left: 0.25rem;
}

.detail-polished .detail-video-section {
  margin-top: 2.5rem;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.detail-polished .detail-video-section > h2::before {
  display: none;
}

.detail-polished .detail-panel {
  margin-top: 2rem;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(
    145deg,
    var(--accent-dim) 0%,
    var(--surface) 55%,
    var(--bg-elevated) 100%
  );
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.clipcatch-page .detail-panel--web {
  border-color: rgba(110, 231, 197, 0.35);
  background: linear-gradient(
    145deg,
    rgba(110, 231, 197, 0.12) 0%,
    var(--surface) 50%,
    var(--bg-elevated) 100%
  );
}

.clipcatch-page .detail-panel--bot {
  border-color: rgba(42, 171, 238, 0.35);
  background: linear-gradient(
    145deg,
    rgba(42, 171, 238, 0.1) 0%,
    var(--surface) 50%,
    var(--bg-elevated) 100%
  );
}

.detail-polished .clipcatch-try-duo .ipa-panel,
.detail-polished .download-duo .ipa-panel {
  margin-top: 0;
  border-style: solid;
  box-shadow: none;
}

.detail-polished .clipcatch-try-duo,
.detail-polished .download-duo {
  margin-top: 2rem;
  gap: 1.25rem;
}

.detail-polished .exe-panel.detail-panel {
  border-color: rgba(110, 231, 197, 0.4);
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2.5rem;
  padding: 0.65rem 1.1rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  transition:
    color 0.2s,
    border-color 0.2s,
    transform 0.2s var(--ease-out);
}

.detail-back:hover {
  color: var(--detail-accent, var(--accent));
  border-color: var(--detail-accent, var(--accent));
  text-decoration: none;
  transform: translateX(-3px);
}

@media (max-width: 768px) {
  .detail-polished .detail-prose {
    padding: 1.5rem 1.25rem;
  }

  .detail-polished .detail-video-section {
    padding: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .detail-back:hover {
    transform: none;
  }
}

.rozhwar-page {
  --detail-accent: #4ade80;
  --detail-glow: rgba(139, 92, 246, 0.35);
}

.rozhwar-page .detail-eyebrow,
.rozhwar-page .detail-tagline {
  color: var(--detail-accent);
}

.rozhwar-page .detail-hero-bg {
  background:
    radial-gradient(ellipse 55% 45% at 15% 0%, var(--detail-glow), transparent 65%),
    radial-gradient(ellipse 40% 35% at 85% 25%, rgba(74, 222, 128, 0.12), transparent);
}

.rozhwar-page .detail-icon-wrap img {
  border-radius: 22%;
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.25),
    0 20px 48px rgba(74, 222, 128, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.45);
}

.rozhwar-page .rozhwar-store-panel.detail-panel {
  border-color: rgba(139, 92, 246, 0.35);
  background: linear-gradient(
    145deg,
    rgba(139, 92, 246, 0.12) 0%,
    rgba(74, 222, 128, 0.06) 55%,
    var(--surface) 100%
  );
}

.phase-media-page {
  --detail-accent: #fb7185;
  --detail-glow: rgba(225, 29, 72, 0.28);
}

.phase-media-page .detail-eyebrow,
.phase-media-page .detail-tagline {
  color: var(--detail-accent);
}

.phase-media-page .detail-hero-bg {
  background:
    radial-gradient(ellipse 55% 45% at 20% 0%, var(--detail-glow), transparent 65%),
    radial-gradient(ellipse 35% 30% at 85% 30%, rgba(251, 113, 133, 0.1), transparent);
}

.phase-media-page .detail-icon-wrap img {
  border-radius: 22%;
  box-shadow:
    0 0 0 1px rgba(225, 29, 72, 0.2),
    0 20px 48px rgba(251, 113, 133, 0.18),
    0 8px 24px rgba(0, 0, 0, 0.35);
}

.phase-media-page .phase-store-panel.detail-panel {
  border-color: rgba(225, 29, 72, 0.3);
  background: linear-gradient(
    145deg,
    rgba(225, 29, 72, 0.1) 0%,
    rgba(251, 113, 133, 0.06) 50%,
    var(--surface) 100%
  );
}

.phase-download-duo {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

@media (min-width: 720px) {
  .phase-download-duo {
    grid-template-columns: 1fr 1fr;
  }
}

.detail-polished .phase-download-duo .ipa-panel.detail-panel {
  margin-top: 0;
}

.detail-dev-credit {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.detail-dev-credit strong {
  color: var(--detail-accent, var(--accent));
  font-weight: 600;
}

.detail-release-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-release-badge span {
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(225, 29, 72, 0.14);
  border: 1px solid rgba(225, 29, 72, 0.35);
  color: var(--detail-accent, var(--accent));
}

.detail-release-badge .badge-new {
  background: rgba(251, 113, 133, 0.2);
  color: #fff;
  border-color: rgba(251, 113, 133, 0.4);
}

.phase-formats {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}

@media (min-width: 640px) {
  .phase-formats {
    grid-template-columns: repeat(3, 1fr);
  }
}

.phase-format-card {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s var(--ease-out);
}

.phase-format-card:hover {
  border-color: rgba(251, 113, 133, 0.4);
  transform: translateY(-2px);
}

.phase-format-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--detail-accent, #fb7185);
}

.phase-format-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.detail-polished .app-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.35rem 0.65rem 1rem;
  background: #000;
  color: #fff;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
  max-width: 100%;
}

.detail-polished .app-store-btn:hover {
  transform: translateY(-2px);
  border-color: var(--detail-accent, var(--accent));
  color: #fff;
  text-decoration: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.detail-polished .app-store-btn:focus-visible {
  outline: 2px solid var(--detail-accent, var(--accent));
  outline-offset: 3px;
}

.detail-polished .app-store-btn svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.detail-polished .app-store-btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.detail-polished .app-store-btn-text small {
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.92;
}

.detail-polished .app-store-btn-text strong {
  font-size: 1.35rem;
  font-weight: 600;
}

.detail-store-meta {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.detail-store-meta span {
  color: var(--detail-accent, var(--accent));
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .phase-format-card:hover {
    transform: none;
  }

  .detail-polished .app-store-btn:hover {
    transform: none;
  }
}

/* ── Games hub (/games) — App Store style grid ─────────────── */

.page-games-store {
  --games-store-play: #0a84ff;
  --games-store-play-hover: #409cff;
}

.page-games-store .games-store-main {
  flex: 1;
  padding: clamp(2rem, 6vw, 3.5rem) 0 clamp(4rem, 10vw, 6rem);
  min-height: calc(100vh - 52px - 1px);
}

.page-games-store .games-store-wrap {
  max-width: 980px;
}

.page-games-store .games-store-heading {
  margin: 0 0 clamp(1.75rem, 5vw, 2.5rem);
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

.page-games-store .games-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 140px));
  gap: clamp(1.5rem, 4vw, 2rem) clamp(1rem, 3vw, 1.75rem);
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content: start;
}

.page-games-store .games-store-cell {
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-games-store .games-store-app {
  display: block;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.page-games-store .games-store-icon-wrap {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 0.55rem;
  border-radius: 22.5%;
  overflow: hidden;
  background: #1a1d24;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 8px 24px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.2s var(--ease-out, ease-out),
    box-shadow 0.2s;
}

.page-games-store .games-store-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-games-store .games-store-icon-wrap--generated svg {
  display: block;
  width: 100%;
  height: 100%;
}

.page-games-store .games-store-app-name {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.page-games-store .games-store-app-sub {
  display: block;
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--muted);
  margin-bottom: 0.6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-games-store .games-store-play-btn {
  display: inline-block;
  min-width: 4rem;
  padding: 0.28rem 0.9rem;
  border-radius: 999px;
  background: var(--games-store-play);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  transition: background 0.15s;
}

.page-games-store .games-store-app:hover .games-store-icon-wrap,
.page-games-store .games-store-app:focus-visible .games-store-icon-wrap {
  transform: scale(1.04);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 12px 32px rgba(0, 0, 0, 0.35);
}

.page-games-store .games-store-app:hover .games-store-play-btn,
.page-games-store .games-store-app:focus-visible .games-store-play-btn {
  background: var(--games-store-play-hover);
}

.page-games-store .games-store-app:focus-visible {
  outline: none;
}

.page-games-store .games-store-app:focus-visible .games-store-icon-wrap {
  outline: 2px solid var(--games-store-play);
  outline-offset: 3px;
}

.page-games-store .site-nav a[aria-current="page"] {
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .page-games-store .games-store-app:hover .games-store-icon-wrap,
  .page-games-store .games-store-app:focus-visible .games-store-icon-wrap {
    transform: none;
  }
}
