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

:root {
  --bg: #050a18;
  --bg-elevated: #0a1428;
  --text: #f0f4ff;
  --text-muted: #7a8ba8;
  --border: rgba(77, 163, 255, 0.12);
  --border-hover: rgba(77, 163, 255, 0.28);
  --blue-dark: #1a4a8a;
  --blue-mid: #2d6fd4;
  --blue-bright: #4da3ff;
  --blue-glow: rgba(77, 163, 255, 0.15);
  --font-sans: "Inter", system-ui, sans-serif;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 60% at 50% 40%, #0d1f3c 0%, var(--bg) 70%);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Dot grid — vignette, stronger at edges */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(77, 163, 255, 0.45) 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, transparent 25%, black 85%);
  opacity: 0.2;
}

/* Fine grain texture */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.page {
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Ambient glow — logo radial feel */
.glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  will-change: transform;
}

.glow--left {
  top: 20%;
  left: -120px;
  background: rgba(26, 74, 138, 0.25);
  animation: glow-drift-left 20s ease-in-out infinite;
}

.glow--right {
  bottom: 10%;
  right: -120px;
  background: rgba(77, 163, 255, 0.12);
  animation: glow-drift-right 24s ease-in-out infinite;
}

@keyframes glow-drift-left {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(24px, -18px); }
}

@keyframes glow-drift-right {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-20px, 14px); }
}

@media (prefers-reduced-motion: reduce) {
  .glow--left,
  .glow--right {
    animation: none;
  }
}

/* Header */
.header {
  flex-shrink: 0;
  padding: clamp(12px, 2vh, 20px) clamp(20px, 4vw, 48px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin-inline: auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.logo-icon {
  border-radius: 7px;
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 32px);
}

.nav-menu > a:not(.btn-contact) {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.15s;
}

.nav-menu > a:not(.btn-contact):hover,
.nav-menu > a:not(.btn-contact).active {
  color: var(--blue-bright);
}

/* Navbar contact button */
.btn-contact {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid var(--border-hover);
  background: linear-gradient(135deg, rgba(26, 74, 138, 0.35) 0%, rgba(77, 163, 255, 0.12) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition:
    transform 0.25s,
    box-shadow 0.25s,
    border-color 0.25s,
    background 0.25s,
    padding 0.25s ease;
}

.btn-contact span {
  position: relative;
  z-index: 1;
}

.btn-contact-inner {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
}

.btn-contact-label {
  display: inline-block;
  white-space: nowrap;
}

.btn-contact-icon {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: var(--blue-bright);
  flex-shrink: 0;
}

.btn-contact-icon svg {
  display: block;
}

.btn-contact:hover {
  padding-right: 14px;
}

.btn-contact:hover .btn-contact-icon {
  display: inline-flex;
  animation: contact-send-nudge 0.6s ease forwards;
}

.btn-contact:active .btn-contact-icon {
  animation: contact-send-click 0.35s ease forwards;
}

@keyframes contact-send-nudge {
  0% { opacity: 0; transform: translateX(-6px); }
  30% { opacity: 1; transform: translateX(0); }
  70% { opacity: 1; transform: translateX(3px) translateY(-1px); }
  100% { opacity: 1; transform: translateX(0) translateY(0); }
}

@keyframes contact-send-click {
  0% { transform: translateX(0) translateY(0); opacity: 1; }
  100% { transform: translateX(6px) translateY(-2px); opacity: 1; }
}

.btn-contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.14) 50%,
    transparent 65%
  );
  background-size: 250% 100%;
  animation: contact-shimmer 2.8s ease-in-out infinite;
  pointer-events: none;
}

.btn-contact::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--blue-mid), var(--blue-bright), var(--blue-mid));
  background-size: 200% 200%;
  animation: contact-border 5s linear infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}

.btn-contact:hover {
  transform: translateY(-2px);
  border-color: var(--blue-bright);
  background: linear-gradient(135deg, rgba(26, 74, 138, 0.55) 0%, rgba(77, 163, 255, 0.22) 100%);
  box-shadow:
    0 0 28px rgba(77, 163, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-contact:hover::before {
  background: linear-gradient(
    105deg,
    transparent 25%,
    rgba(255, 255, 255, 0.28) 50%,
    transparent 75%
  );
  animation-duration: 1.2s;
}

.btn-contact:hover::after {
  opacity: 1;
  animation-duration: 2s;
}

.btn-contact:active {
  transform: translateY(0);
}

@keyframes contact-border {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes contact-shimmer {
  0% { background-position: 250% 0; }
  100% { background-position: -250% 0; }
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
}

/* Main */
.main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vh, 28px);
  padding: 0 clamp(20px, 4vw, 48px);
  text-align: center;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2vh, 18px);
}

.hero-title {
  font-size: clamp(2rem, 6vh, 3.25rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text) 30%, var(--blue-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: clamp(0.875rem, 2vh, 1rem);
  color: var(--text-muted);
  max-width: 380px;
  line-height: 1.5;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: rgba(10, 20, 40, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-size: clamp(0.8125rem, 1.8vh, 0.875rem);
  color: var(--text-muted);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stat-pill:hover {
  border-color: var(--border-hover);
  box-shadow:
    0 0 20px var(--blue-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hero-stat-number {
  font-weight: 600;
  color: var(--blue-bright);
  font-variant-numeric: tabular-nums;
}

.stat-pill-label {
  color: var(--text-muted);
}

/* Work */
.work {
  width: 100%;
  max-width: 320px;
}

.work-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(8px, 1.5vh, 12px) 0;
  border-top: 1px solid var(--border);
  font-size: clamp(0.8125rem, 1.8vh, 0.875rem);
  transition: color 0.15s;
}

.work-list li:hover .work-item-name,
.work-list li:hover span:first-child {
  color: var(--blue-bright);
}

.work-list li:last-child {
  border-bottom: 1px solid var(--border);
}

.work-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon {
  flex-shrink: 0;
  border-radius: 9px;
  display: block;
}

.work-item-name,
.work-list li span:first-child {
  font-weight: 500;
  transition: color 0.15s;
}

.work-item-platform,
.work-list li span:last-child {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.work-list--portfolio {
  width: 100%;
}

.work-list--portfolio .portfolio-item {
  display: block;
  padding: 0;
  border-top: none;
}

.portfolio-item {
  border-top: 1px solid var(--border);
}

.portfolio-item:last-child {
  border-bottom: 1px solid var(--border);
}

.portfolio-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s;
}

.portfolio-item--static .portfolio-row {
  cursor: default;
}

.portfolio-row-end {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.portfolio-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.25s, border-color 0.15s;
  margin-top: -2px;
}

.portfolio-item.is-open .portfolio-chevron {
  transform: rotate(-135deg);
  margin-top: 2px;
  border-color: var(--blue-bright);
}

.portfolio-item.is-open .portfolio-row .work-item-name {
  color: var(--blue-bright);
}

.portfolio-row:hover .work-item-name {
  color: var(--blue-bright);
}

.portfolio-row:hover .portfolio-chevron {
  border-color: var(--blue-bright);
}

.portfolio-detail {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
  padding: 0 0 0 52px;
}

.portfolio-item.is-open .portfolio-detail {
  max-height: 280px;
  opacity: 1;
  padding: 0 0 18px 52px;
}

.portfolio-detail[hidden] {
  display: block;
}

.portfolio-detail-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.portfolio-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}

.portfolio-meta div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portfolio-meta dt {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.portfolio-meta dd {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}

@media (max-width: 480px) {
  .portfolio-detail,
  .portfolio-item.is-open .portfolio-detail {
    padding-left: 0;
  }
}

/* Contact section */
.contact {
  display: flex;
  justify-content: center;
}

.email-copy {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: clamp(0.8125rem, 1.8vh, 0.875rem);
  color: var(--text);
  background: rgba(10, 20, 40, 0.6);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, gap 0.2s;
}

.email-copy:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  box-shadow: 0 0 24px var(--blue-glow);
  gap: 12px;
}

.email-copy-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 22px;
}

.email-copy-label {
  font-size: 0.75rem;
  color: var(--blue-bright);
  padding: 2px 8px;
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  background: rgba(77, 163, 255, 0.08);
  transition: opacity 0.2s, transform 0.2s;
}

.email-copy-icon {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-bright);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
}

.email-copy:hover .email-copy-label {
  opacity: 0;
  transform: translateX(4px);
}

.email-copy:hover .email-copy-icon--arrow {
  opacity: 1;
  transform: translateX(0);
}

.email-copy.copied .email-copy-label,
.email-copy.copied:hover .email-copy-label {
  opacity: 0;
}

.email-copy.copied .email-copy-icon--arrow,
.email-copy.copied:hover .email-copy-icon--arrow {
  opacity: 0;
}

.email-copy.copied .email-copy-icon--check {
  opacity: 1;
  transform: translateX(0);
  color: #6ee7b7;
}

/* Inner pages */
body.page--scroll {
  overflow: auto;
}

.page--inner {
  min-height: 100dvh;
  height: auto;
  max-height: none;
}

.main--inner {
  justify-content: flex-start;
  padding-top: clamp(40px, 10vh, 80px);
  padding-bottom: 64px;
  text-align: left;
  align-items: flex-start;
  max-width: 420px;
  margin-inline: auto;
  width: 100%;
}

.page-title {
  font-size: clamp(1.75rem, 5vh, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text) 30%, var(--blue-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-lead {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 12px;
}

.page-note {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.link {
  color: var(--blue-bright);
  transition: opacity 0.15s;
}

.link:hover {
  opacity: 0.8;
}

.main--error {
  text-align: center;
  align-items: center;
}

.error-code {
  font-size: clamp(4rem, 18vw, 7rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text) 20%, var(--blue-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.35;
}

.main--error .page-title {
  margin-bottom: 12px;
}

.error-actions {
  margin-top: 28px;
}

.error-home-btn {
  display: inline-flex;
  text-decoration: none;
}

.main--inner .work-list {
  width: 100%;
  margin-top: 8px;
}

/* Contact form — mailto, no backend */
.contact-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: rgba(10, 20, 40, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 3px var(--blue-glow);
}

.form-submit {
  align-self: flex-start;
  margin-top: 4px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.form-feedback {
  min-height: 48px;
  margin-top: 8px;
  display: flex;
  align-items: center;
}

.form-feedback-text {
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.form-feedback.is-visible .form-feedback-text {
  opacity: 1;
}

.form-feedback--success .form-feedback-text {
  color: #6ee7b7;
}

.form-feedback--error .form-feedback-text {
  color: #f87171;
}

.form-submit[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Footer */
.footer {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  text-align: center;
  padding: clamp(10px, 2vh, 16px) 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Mobile */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .nav {
    position: relative;
  }

  .nav.open .nav-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    gap: 14px;
  }

  .nav.open .btn-contact {
    justify-content: center;
  }
}

@media (max-height: 600px) {
  .hero-title {
    font-size: clamp(1.5rem, 5vh, 2.25rem);
  }

  .main {
    gap: 12px;
  }

  .hero {
    gap: 8px;
  }
}
