/* ========================================
   Reset & Base
   ======================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
  background: #0f172a;
  color: #cbd5e1;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ========================================
   Utilities
   ======================================== */

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 0.5rem;
  z-index: 200;
  padding: 0.625rem 1rem;
  background: #38bdf8;
  color: #0f172a;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 6px;
  transition: top 0.15s;
}

.skip-link:focus {
  top: 0.5rem;
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
}

main[tabindex="-1"]:focus {
  outline: none;
}

.accent {
  color: #38bdf8;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: #38bdf8;
  color: #0f172a;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 6px;
  transition: background 0.2s, transform 0.2s;
}

.btn:hover {
  background: #7dd3fc;
  transform: translateY(-1px);
}

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

/* ========================================
   Navigation
   ======================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.1);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: #38bdf8;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #38bdf8;
  transition: width 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #f1f5f9;
}

.nav-links a.active::after {
  width: 100%;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #94a3b8;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   Hero
   ======================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 0 4rem;
}

.hero-content {
  max-width: 640px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-tagline {
  font-size: 1.125rem;
  color: #94a3b8;
  margin-bottom: 1rem;
  max-width: 480px;
}

.hero-support {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin-bottom: 2rem;
  max-width: 540px;
}

/* ========================================
   Sections
   ======================================== */

.section {
  padding: 5rem 0;
}

.section-alt {
  background: #1e293b;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 2.5rem;
  letter-spacing: -0.02em;
}

.section-intro {
  max-width: 640px;
  margin: -1.25rem 0 2rem;
  color: #94a3b8;
  font-size: 0.95rem;
}

/* ========================================
   Services
   ======================================== */

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.card-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: #38bdf8;
  margin-bottom: 1rem;
}

.card-icon svg {
  width: 100%;
  height: 100%;
}

.card h3 {
  font-size: 1.1rem;
  color: #f1f5f9;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.card p {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* ========================================
   Projects
   ======================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.showcase-card {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1.75rem;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 12px;
  background:
    radial-gradient(circle at right top, rgba(56, 189, 248, 0.12), transparent 32%),
    #0f172a;
}

.showcase-copy {
  max-width: 40rem;
}

.showcase-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #38bdf8;
  margin-bottom: 0.6rem;
}

.showcase-card h3 {
  font-size: 1.2rem;
  color: #f1f5f9;
  margin-bottom: 0.65rem;
}

.showcase-card p {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.showcase-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 14rem;
}

.showcase-btn {
  white-space: nowrap;
}

.showcase-note {
  font-size: 0.85rem;
  color: #cbd5e1;
}

.showcase-note a {
  color: #7dd3fc;
}

.project {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1.75rem;
  transition: border-color 0.2s;
}

.project:hover {
  border-color: #475569;
}

.project h3 {
  font-size: 1.05rem;
  color: #f1f5f9;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.project p {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.project-impact {
  font-size: 0.8rem;
  color: #38bdf8;
  font-style: italic;
  margin-bottom: 1rem;
}

/* ========================================
   Who I Help
   ======================================== */

.who-list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
  max-width: 640px;
}

.who-list li {
  font-size: 1rem;
  color: #cbd5e1;
  padding-left: 1.5rem;
  position: relative;
}

.who-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 2px;
  background: #38bdf8;
}

/* ========================================
   Tags
   ======================================== */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border-radius: 4px;
  white-space: nowrap;
}

/* ========================================
   Skills & Experience
   ======================================== */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.skill-group h3 {
  font-size: 0.95rem;
  color: #f1f5f9;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.timeline {
  border-top: 1px solid #334155;
  padding-top: 2rem;
}

.timeline h3 {
  font-size: 1.1rem;
  color: #f1f5f9;
  margin-bottom: 1.25rem;
  font-weight: 600;
}

.timeline-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.timeline-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.timeline-year {
  font-size: 1.75rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.timeline-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.4;
}

.highlights-text {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.6;
}

/* ========================================
   Contact
   ======================================== */

.contact {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.contact p {
  color: #94a3b8;
  margin-bottom: 1.5rem;
}

.contact .btn {
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
}

.contact-links a {
  width: 2rem;
  height: 2rem;
  color: #64748b;
  transition: color 0.2s;
}

.contact-links a:hover {
  color: #38bdf8;
}

.contact-links svg {
  width: 100%;
  height: 100%;
}

/* ========================================
   Footer
   ======================================== */

.footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid #1e293b;
}

.footer p {
  font-size: 0.8rem;
  color: #475569;
}

/* ========================================
   Services — Section Flip
   ======================================== */

.services-flip {
  perspective: 2000px;
}

.services-flip-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.services-flip.flipped .services-flip-inner {
  transform: rotateY(180deg);
}

.services-flip-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.services-flip-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transform: rotateY(180deg);
}

.service-card {
  display: block;
  width: 100%;
  text-align: left;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1.75rem;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.service-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.service-card:focus-visible {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.service-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: #38bdf8;
  margin-bottom: 1rem;
}

.service-card-icon svg {
  width: 100%;
  height: 100%;
}

.service-card h3 {
  font-size: 1.1rem;
  color: #f1f5f9;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.service-card p {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.5;
}

.service-card-hint {
  display: block;
  margin-top: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #38bdf8;
  letter-spacing: 0.02em;
}

.service-detail-panel {
  background: #1e293b;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 8px;
  padding: 2rem;
}

.service-detail-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: #38bdf8;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.75rem;
  transition: color 0.2s;
}

.service-detail-back-btn:hover {
  color: #7dd3fc;
}

.service-detail-back-btn svg {
  width: 16px;
  height: 16px;
}

.service-detail-item {
  display: none;
}

.service-detail-item.active {
  display: block;
}

.service-detail-item h3 {
  font-size: 1.375rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}


/* ========================================
   Services Detail Page
   ======================================== */

.page-hero {
  padding: 8rem 0 3.5rem;
  border-bottom: 1px solid #1e293b;
}

.page-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.page-hero p {
  font-size: 1rem;
  color: #94a3b8;
  max-width: 540px;
  line-height: 1.6;
}

.service-detail {
  scroll-margin-top: 4rem;
}

.service-detail-inner {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0 1.5rem;
  align-items: start;
}

.service-detail-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: #38bdf8;
  margin-top: 0.2rem;
}

.service-detail-icon svg {
  width: 100%;
  height: 100%;
}

.service-detail h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.service-detail-intro {
  font-size: 0.975rem;
  color: #94a3b8;
  margin-bottom: 1rem;
  line-height: 1.65;
}

.service-detail-body {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.service-includes {
  margin-bottom: 2rem;
}

.service-includes h4 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.875rem;
}

.service-includes ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 2rem;
}

.service-includes li {
  font-size: 0.875rem;
  color: #94a3b8;
  padding-left: 1rem;
  position: relative;
  line-height: 1.4;
}

.service-includes li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 2px;
  background: #38bdf8;
}

.service-detail-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-outline {
  display: inline-block;
  padding: 0.625rem 1.5rem;
  border: 1px solid #334155;
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 6px;
  transition: border-color 0.2s, color 0.2s;
}

.btn-outline:hover {
  border-color: #475569;
  color: #f1f5f9;
}

/* ========================================
   Animations
   ======================================== */

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 3.5rem;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 1.5rem;
    gap: 0;
    border-bottom: 1px solid #334155;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 0;
  }

  .nav-links a::after {
    display: none;
  }

  .services-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .showcase-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .showcase-actions {
    min-width: 0;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .timeline-items {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .hero {
    min-height: auto;
    padding: 7rem 0 4rem;
  }

  .service-detail-inner {
    grid-template-columns: 1fr;
  }

  .service-detail-icon {
    display: none;
  }

  .service-includes ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .section-title {
    font-size: 1.5rem;
  }
}
