:root {
  /* Color variables - Sea from Space palette */
  --accent-gold: #f7c948;
  --accent-gold-hover: #ffd966;
  --accent-mint: #5dc7b5;
  --accent-mint-hover: #7ad3c3;
  --accent-teal: #1a9a9d;
  --accent-blue: #2d5384;
  --accent-blue-grey: #717d96;
  --accent-purple: #2a3158;
  --accent-navy: #0e1326;

  --accent-mist: #b8bfd0;
  --accent-mist-hover: #c8ceda;
  --accent-mist-disabled: #d8dce5;

  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #fafafa;
  --bg-contrast: var(--accent-navy);
  --text-primary: var(--accent-navy);
  --text-secondary: var(--accent-blue);
  --text-tertiary: var(--accent-blue-grey);
  --text-contrast: #ffffffeb;
  --border: rgba(0, 0, 0, 0.1);
  --shadow: rgba(0, 0, 0, 0.1);
  --glass: rgba(0, 0, 0, 0.02);

  /* Font size variables */
  --font-size-base: 1.06rem;
  --font-size-xs: 0.6875rem;
  /* 11px */
  --font-size-sm: 0.75rem;
  /* 12px */
  --font-size-md: 1rem;
  /* 16px */
  --font-size-lg: 1.125rem;
  /* 18px */
  --font-size-xl: 1.25rem;
  /* 20px */
  --font-size-2xl: 1.3rem;
  /* 21px */
  --font-size-3xl: 1.75rem;
  /* 28px */
  --font-size-4xl: 2rem;
  /* 32px */
  --font-size-5xl: 2.5rem;
  /* 40px */
  --font-size-6xl: 3rem;
  /* 48px */
  --font-size-7xl: 4rem;
  /* 64px */
  --font-size-8xl: 6rem;
  /* 96px */
  --font-size-headline-large: clamp(2rem, 4vw, 3rem);
  --font-size-headline-medium: clamp(1.5rem, 3vw, 2.25rem);
  --font-size-icon: 1.5rem;
  /* 24px */
  --font-size-hero-text: 2rem;
  /* 32px */
  --font-size-profile: 3.5rem;
  /* 56px */
  --font-size-service-icon: 1.75rem;
  /* 28px */
  --font-size-tech-icon: 1.063rem;
  /* 17px */

  /* Gallery */
  --viewport-content: min(980px, 100vw); /* 1024 - 22px padding on both sides */
  --gallery-side-padding: round(
    down,
    calc((100vw - var(--viewport-content)) / 2),
    1px
  );
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all 0.3s ease;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Typography System */
.headline-large {
  font-size: var(--font-size-headline-large);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.headline-medium {
  font-size: var(--font-size-headline-medium);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.headline-hero {
  font-size: var(--font-size-8xl);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.body-large {
  font-size: var(--font-size-xl);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
}

.body-medium {
  font-size: var(--font-size-lg);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--shadow);
  z-index: 2000;
  overflow: hidden;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background-color: var(--bg-primary);
  margin: 2vh auto;
  padding: 0;
  width: 96vw;
  max-width: 800px;
  max-height: 96vh;
  border-radius: 16px;
  box-shadow: 0 10px 40px var(--shadow);
  animation: modalFadeIn 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: var(--font-size-icon);
  font-weight: 300;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-secondary);
}

.close-modal:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-body {
  margin-bottom: 10px;
  margin-top: 10px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

body.modal-open {
  overflow: hidden;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 10px 0;
  transition: all 0.3s ease;
}

header:after {
  background-color: var(--border);
  bottom: 0;
  content: "";
  display: block;
  height: 1px;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: var(--font-size-2xl);
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  text-shadow: 1px 1px 24px white;
}

nav ul {
  align-items: center;
  display: flex;
  font-size: var(--font-size-sm);
  list-style: none;
  gap: 2rem;
}

nav a {
  color: var(--text-primary);
  display: inline-block;
  line-height: 22px;
  opacity: 0.8;
  text-decoration: none;
  transition: color 0.3s ease;
  white-space: nowrap;
  text-shadow: 1px 1px 20px white;
}

nav a:hover {
  color: var(--accent-blue);
}

/* Hero Section */
.hero {
  align-items: center;
  background: var(--bg-primary);
  display: flex;
  height: 82vh;
  justify-content: center;
  margin-bottom: 3rem;
  min-height: 540px;
  overflow: hidden;
  padding-top: 4rem;
  position: relative;
  text-align: center;
}

.hero-content {
  padding: 0 22px;
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-weight: 600;
  line-height: 1.04167;
  margin: 0 auto 1.5rem auto;
  max-width: 700px;
}

.hero p {
  color: var(--text-tertiary);
  font-size: var(--font-size-hero-text);
  font-weight: 600;
  line-height: 1.125;
  margin-bottom: 3rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 53.5294117647rem;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 30% 20%,
      var(--accent-gold) 0%,
      transparent 50%
    ),
    radial-gradient(circle at 70% 80%, var(--accent-teal) 0%, transparent 50%);
  opacity: 0.1;
  z-index: 1;
}

/* Section Layouts */
.section {
  padding: 8rem 0;
  position: relative;
}

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 22px;
}

/* About Section */
.about {
  background: var(--bg-primary);
  padding: 0 0 8rem 0;
}

.about-hero {
  background: linear-gradient(
    to bottom,
    var(--bg-secondary) 0%,
    var(--bg-primary) 100%
  );
}

.profile-content {
  flex: 1.2;
  text-align: left;
}

.profile-headlines {
  position: absolute;
  top: 25%;
}

.profile-image-container {
  flex: 0.8;
  display: flex;
  justify-content: flex-end;
}

.profile-image {
  background-image: url("resources/bala-profile.png");
  background-position-x: 400px;
  background-repeat: no-repeat;
  background-size: 489px 336px;
  height: 336px;
  width: 100%;
}

.profile-name {
  color: var(--text-primary);
  font-size: var(--font-size-5xl);
  font-weight: 400;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.profile-title {
  color: var(--text-secondary);
  font-size: var(--font-size-3xl);
  font-weight: 300;
}

.about-content {
  margin: 2rem 0 0;
  column-count: 2;
  column-gap: 2rem;
  text-align: left;
}

.bio-paragraph {
  color: var(--text-secondary);
  font-size: var(--font-size-md);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  break-inside: avoid-column;
}

.credentials {
  display: none;
}

/* Tech Showcase */
.tech-showcase {
  background: var(--bg-primary);
  padding: 0 0 6rem 0;
  position: relative;
  overflow: hidden;
}

.scroll-container {
  position: relative;
  width: 100%;
  overflow-x: hidden;
  padding: 0;
}

.tech-header {
  font-size: 56px;
  font-weight: 500;
  line-height: 1.0714285714;
  margin-bottom: 4rem;
}

.tech-gallery {
  margin: 0;
  position: relative;
  z-index: 1;
}

.scroll-container {
  display: grid;
  overflow-x: scroll;
  padding-block-end: 48px;
  scroll-padding: var(--gallery-side-padding);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.tech-grid {
  align-items: stretch;
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0 var(--gallery-side-padding);
  width: -moz-fit-content;
  width: fit-content;
}

.tech-grid::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.paddle-nav {
  display: flex;
  justify-content: flex-end;
  margin-inline-end: auto;
  margin-inline-start: auto;
  width: var(--viewport-content);
  padding: 0 22px;
  position: relative;
}

.paddle-nav ul {
  display: flex;
  gap: 20px;
  height: 36px;
  justify-content: center;
  list-style: none;
  margin: 0;
  width: 92px;
}

.paddle-button {
  align-items: center;
  background: var(--accent-mist);
  border-radius: 50%;
  border: 0;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  height: 36px;
  justify-content: center;
  margin: 0;
  outline: none;
  padding: 0;
  width: 36px;

  transition: background-color 0.1s linear, color 0.1s linear,
    opacity 0.1s linear;
  will-change: opacity;
}

.paddle-button svg {
  height: 100%;
  width: 100%;
  fill: currentColor;
}

.paddle-button:hover {
  background: var(--accent-mist-hover);
}

.paddle-button:disabled {
  background: var(--accent-mist-disabled);
  opacity: 0.42;
  pointer-events: none;
}

.tech-card {
  background: var(--bg-contrast);
  border: none;
  border-radius: 32px;
  height: 100%;
  min-height: 680px;
  max-height: 744px;
  overflow: hidden;
  padding: 32px;
  position: relative;
  scroll-snap-align: start;
  text-align: left;
  transition: all 0.3s ease;
  width: 372px;
}

.tech-card h3 {
  font-size: var(--font-size-tech-icon);
  line-height: 1.2353641176;
  letter-spacing: -0.022em;
  color: var(--text-contrast);
}

.tech-card p {
  -webkit-box-orient: vertical;
  box-orient: vertical;
  color: var(--text-contrast);
  display: -webkit-box;
  font-size: var(--font-size-service-icon);
  letter-spacing: 0.007em;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  line-height: 1.1428571429;
  margin-bottom: 423px;
  margin-top: 3px;
  overflow: hidden;
  padding-bottom: 4px;
  padding-top: 4px;
}

/* Card background image styles */
.tech-card-with-bg {
  background-size: cover;
  background-position: center;
}

/* Text shadow for better legibility on image backgrounds */
.text-shadow {
  text-shadow: 0px 0px 12px var(--accent-navy);
}

/* Value Proposition Section */
.value-prop {
  background: linear-gradient(
    to right,
    var(--bg-primary) 0%,
    var(--accent-mint) 50%,
    var(--accent-teal) 100%
  );
  padding: 10rem 0;
  color: var(--text-contrast);
  text-align: center;
}

.value-content {
  max-width: 900px;
  margin: 0 auto;
}

.value-prop h2 {
  font-size: var(--font-size-7xl);
  font-weight: 700;
  margin-bottom: 2rem;
  text-shadow: 0 2px 20px var(--shadow);
}

.value-prop p {
  font-size: var(--font-size-xl);
  line-height: 1.7;
  opacity: 0.95;
  margin: 0 auto 3rem auto;
  max-width: 760px;
}

.cta-button {
  align-items: center;
  background: var(--accent-gold);
  border-radius: 50px;
  border: none;
  box-shadow: 0 5px 15px var(--shadow);
  color: var(--accent-navy);
  cursor: pointer;
  display: inline-flex;
  font-size: var(--font-size-md);
  font-weight: 500;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cta-button:hover {
  background: var(--accent-gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px var(--shadow);
}

.fade-in.visible.cta-button:hover {
  transform: translateY(-2px);
}

header .cta-button {
  font-size: inherit;
  font-weight: 400;
  padding-block: 3px;
  padding-inline: 10px;
}

header .cta-button:hover {
  color: var(--accent-navy);
  /* Smaller button needs less movement */
  transform: translateY(-1px);
}

/* Footer */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  padding: 11px 0 11px 0;
  text-align: center;
}

.footer-content {
  color: var(--text-tertiary);
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.stagger-1 {
  transition-delay: 0.1s;
}

.stagger-2 {
  transition-delay: 0.2s;
}

.stagger-3 {
  transition-delay: 0.3s;
}

/* Responsive Design */
@media (max-width: 768px) {
  .section {
    padding: 4rem 0;
  }

  .container {
    padding: 0 1rem;
  }

  .profile-image {
    width: 200px;
    height: 200px;
    font-size: var(--font-size-6xl);
    margin: 0 auto;
  }
}
