/* ===== Variables ===== */
:root {
  --bg: #06080f;
  --bg-alt: #0c1019;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaed;
  --text-muted: #8b929a;
  --accent: #00d4aa;
  --accent-2: #3b82f6;
  --gradient: linear-gradient(135deg, #00d4aa 0%, #3b82f6 100%);
  --radius: 12px;
  --radius-lg: 20px;
  --header-h: 64px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", monospace;
  --container: 1120px;
  --transition: 0.25s ease;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

/* ===== Background ===== */
.bg-grid {
  position: fixed;
  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: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.bg-glow--1 {
  width: 600px;
  height: 600px;
  top: -200px;
  right: -100px;
  background: rgba(0, 212, 170, 0.12);
}

.bg-glow--2 {
  width: 500px;
  height: 500px;
  bottom: 20%;
  left: -150px;
  background: rgba(59, 130, 246, 0.1);
}

/* ===== Layout ===== */
.container {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
}

main,
.header,
.footer {
  position: relative;
  z-index: 1;
}

/* ===== Brand ===== */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1rem;
}

.brand__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.brand__icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand__text {
  display: inline-flex;
  align-items: baseline;
  letter-spacing: -0.02em;
}

.brand__name {
  color: var(--text);
}

.brand__domain {
  color: var(--accent);
  font-weight: 500;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(6, 8, 15, 0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background var(--transition);
}

.header--scrolled {
  background: rgba(6, 8, 15, 0.92);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__link {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}

.nav__link:hover,
.nav__link.active {
  color: var(--text);
}

.nav__link.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  border-radius: 1px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding-block: 80px 60px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8125rem;
  font-family: var(--mono);
  color: var(--accent);
  margin-bottom: 24px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.5); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(0, 212, 170, 0); }
}

.hero__title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__desc {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 32px;
}

.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero__stats {
  display: flex;
  gap: 40px;
}

.stat__num {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--mono);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat__label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.hero__visual {
  display: flex;
  justify-content: center;
}

.hero__frame {
  position: relative;
  width: min(400px, 100%);
}

.hero__photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  position: relative;
  z-index: 1;
}

.hero__frame-border {
  position: absolute;
  inset: -3px;
  border-radius: calc(var(--radius-lg) + 3px);
  background: var(--gradient);
  z-index: 0;
  opacity: 0.6;
}

.hero__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0, 212, 170, 0.15), 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 2;
  pointer-events: none;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn--primary {
  background: var(--gradient);
  color: #fff;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 212, 170, 0.3);
}

.btn--ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn--sm {
  padding: 8px 16px;
  font-size: 0.8125rem;
}

/* ===== Sections ===== */
.section {
  padding-block: 100px;
}

.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section__head {
  margin-bottom: 56px;
}

.section__tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.section__title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section__subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ===== About ===== */
.about-intro {
  max-width: 760px;
  margin-bottom: 48px;
}

.about-intro p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 16px;
}

.about-intro p:last-child {
  margin-bottom: 0;
}

.about-intro strong {
  color: var(--text);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.about-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color var(--transition), transform var(--transition);
}

.about-card:hover {
  border-color: rgba(0, 212, 170, 0.3);
  transform: translateY(-4px);
}

.about-card__icon {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.about-card h3 {
  font-size: 1.125rem;
  margin-bottom: 12px;
}

.about-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 10px;
}

.about-card p:last-child {
  margin-bottom: 0;
}

.about-card__extra {
  font-size: 0.875rem !important;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 12px !important;
}

.about-card strong {
  color: var(--accent);
}

.about-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-list li {
  color: var(--text-muted);
  font-size: 0.9375rem;
  padding-left: 16px;
  position: relative;
  line-height: 1.6;
}

.about-list li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.about-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

.about-bottom__label {
  font-size: 0.8125rem;
  font-family: var(--mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tags span {
  font-size: 0.8125rem;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: border-color var(--transition), color var(--transition);
}

.skill-tags span:hover {
  border-color: rgba(0, 212, 170, 0.3);
  color: var(--text);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: start;
}

.timeline__year {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent-2);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  text-align: center;
  white-space: nowrap;
}

.timeline__text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding-top: 2px;
}

/* ===== Projects ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color var(--transition), transform var(--transition);
}

.project-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
  transform: translateY(-3px);
}

.project-card--wide {
  grid-column: 1 / -1;
}

.project-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.project-card__type {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent-2);
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.project-card__link {
  color: var(--text-muted);
  transition: color var(--transition);
}

.project-card__link:hover {
  color: var(--accent);
}

.project-card__title {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.project-card__desc {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 20px;
  line-height: 1.7;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-card__tags li {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.project-card--featured {
  border-color: rgba(0, 212, 170, 0.25);
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.06) 0%, rgba(59, 130, 246, 0.04) 100%);
}

.project-card--featured:hover {
  border-color: rgba(0, 212, 170, 0.45);
}

.project-card__type--ai {
  color: var(--accent);
  background: rgba(0, 212, 170, 0.1);
  border-color: rgba(0, 212, 170, 0.25);
}

.project-card--placeholder {
  border-style: dashed;
  border-color: rgba(0, 212, 170, 0.2);
  background: transparent;
}

.project-card--placeholder:hover {
  border-color: rgba(0, 212, 170, 0.35);
  transform: none;
}

.project-card--placeholder .project-card__desc {
  margin-bottom: 0;
}

.about-card--highlight {
  border-color: rgba(0, 212, 170, 0.25);
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.06) 0%, rgba(59, 130, 246, 0.04) 100%);
}

.section--ai {
  background-image: radial-gradient(ellipse at top center, rgba(0, 212, 170, 0.06), transparent 60%);
}

.project-card__desc strong {
  color: var(--text);
}

/* ===== Products ===== */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.product-item {
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}

.product-item:hover {
  border-color: rgba(0, 212, 170, 0.25);
}

.product-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.product-item__title {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.product-item__slogan {
  font-size: 0.875rem;
  color: var(--accent);
  font-style: italic;
}

.product-item__desc {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 16px;
  line-height: 1.7;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.feature-list li {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
}

.feature-list li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.product-item__tech {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.badge--muted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ===== Contact ===== */
.contact-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 48px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  background-image: radial-gradient(ellipse at top right, rgba(0, 212, 170, 0.08), transparent 60%);
}

.contact-box p {
  color: var(--text-muted);
  margin-top: 8px;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding-block: 24px;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand--footer .brand__name {
  color: var(--text);
}

.footer__links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.footer__links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer__links a:hover {
  color: var(--text);
}

.footer__github {
  display: flex;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer__github:hover {
  color: var(--text);
}

.footer__copy {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .hero__desc {
    margin-inline: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__stats {
    justify-content: center;
  }

  .hero__visual {
    order: -1;
  }

  .hero__frame {
    width: min(280px, 70%);
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-bottom {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .timeline__year {
    justify-self: start;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card--wide {
    grid-column: auto;
  }

  .contact-box {
    flex-direction: column;
    text-align: center;
    padding: 32px 24px;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .footer__links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .container {
    width: min(var(--container), calc(100% - 32px));
  }

  .menu-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(6, 8, 15, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition), opacity var(--transition), visibility var(--transition);
  }

  .nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav__link {
    display: block;
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: 8px;
  }

  .nav__link:hover {
    background: var(--surface);
  }

  .nav__link.active::after {
    display: none;
  }

  .section {
    padding-block: 72px;
  }

  .product-item__header {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .hero__stats {
    gap: 24px;
  }

  .stat__num {
    font-size: 1.5rem;
  }

  .footer__links {
    gap: 16px;
  }
}

/* ===== Legal Pages ===== */
.legal-page {
  padding-top: calc(var(--header-h) + 48px);
  padding-bottom: 80px;
  min-height: 60vh;
}

.legal-page h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 8px;
}

.legal-page__updated {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 40px;
}

.legal-page section {
  margin-bottom: 32px;
}

.legal-page h2 {
  font-size: 1.125rem;
  margin-bottom: 12px;
}

.legal-page p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.8;
}
