/* ============================================================
   Dilrukshan portfolio
   Theme: single dark theme, one blue accent.
   Radius system: cards 20px, inputs 12px, interactive pills full.
   ============================================================ */

:root {
  --bg: #05070d;
  --bg-2: #0b101c;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --accent: #4d8dff;
  --accent-strong: #3372f0;
  --accent-soft: rgba(77, 141, 255, 0.14);
  --accent-glow: rgba(77, 141, 255, 0.35);
  --text: #eaf0ff;
  --muted: #97a1b8;

  --r-card: 20px;
  --r-input: 12px;

  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Outfit', sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 72px;
}

* {
  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-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s var(--ease-out);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Background layers */
.globe-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: -1;
}

/* Soft scrim over the canvas so foreground text stays readable */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(5, 7, 13, 0.78) 0%, rgba(5, 7, 13, 0.3) 42%, rgba(5, 7, 13, 0) 68%);
}

@media (max-width: 1024px) {
  body::after {
    background: linear-gradient(180deg, rgba(5, 7, 13, 0.72) 0%, rgba(5, 7, 13, 0.42) 55%, rgba(5, 7, 13, 0.6) 100%);
  }
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 16px;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: background 0.3s var(--ease-out), border-color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out), transform 0.2s var(--ease-out);
  will-change: transform;
}

.btn:active {
  transform: scale(0.97);
}

.btn i {
  transition: transform 0.3s var(--ease-out);
}

.btn:hover i {
  transform: translateX(3px);
}

.btn-primary {
  background: var(--accent-strong);
  color: #ffffff;
  box-shadow: 0 6px 24px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:hover {
  background: var(--accent);
  box-shadow: 0 10px 32px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background 0.4s var(--ease-out), border-color 0.4s var(--ease-out),
    transform 0.45s var(--ease-out);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(5, 7, 13, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.site-header.header-hidden {
  transform: translateY(-100%);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

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

.site-nav {
  display: flex;
  gap: 36px;
  align-items: center;
}

.nav-link {
  position: relative;
  font-size: 15px;
  color: var(--muted);
}

.nav-link:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}

.nav-link:not(.nav-cta):hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link:hover {
  color: var(--text);
}

.nav-cta {
  color: #ffffff;
  background: var(--accent-strong);
  padding: 10px 22px;
  border-radius: 999px;
  box-shadow: 0 4px 18px var(--accent-glow);
  transition: background 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.nav-cta:hover {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 8px 26px var(--accent-glow);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 26px;
  cursor: pointer;
  z-index: 110;
}

/* Hero */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: var(--header-h);
}

.hero::before {
  content: '';
  position: absolute;
  top: 12%;
  left: -12%;
  width: 46vw;
  height: 46vw;
  max-width: 640px;
  max-height: 640px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 65%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 48px;
  align-items: center;
  width: 100%;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 20px;
}

.eyebrow-rule {
  display: inline-block;
  width: 44px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-size: clamp(56px, 9.5vw, 118px);
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  overflow: hidden;
}

.hero-title .char {
  display: inline-block;
  will-change: transform;
  background: linear-gradient(180deg, #ffffff 55%, #93a4c9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 19px;
  font-weight: 300;
  color: var(--muted);
  margin-bottom: 36px;
  max-width: 460px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 56px;
}

.hero-stats {
  display: flex;
  gap: 48px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
  max-width: 460px;
}

.stat-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.stat-desc {
  font-size: 14px;
  color: var(--muted);
}

/* Profile card */
.hero-visual {
  display: flex;
  justify-content: center;
  perspective: 1000px;
}

.profile-card {
  position: relative;
  width: 100%;
  max-width: 330px;
  padding: 40px 32px;
  text-align: center;
  background: rgba(7, 10, 18, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 24px 60px rgba(0, 0, 0, 0.45);
  transform-style: preserve-3d;
  will-change: transform;
  overflow: hidden;
}

.card-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(360px circle at var(--gx, 50%) var(--gy, 0%),
      rgba(255, 255, 255, 0.09), transparent 60%);
  pointer-events: none;
}

.profile-img-ring {
  width: 132px;
  height: 132px;
  margin: 0 auto 22px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 140deg, var(--accent), transparent 40%, var(--accent) 80%);
}

.profile-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
}

.profile-info h3 {
  font-size: 24px;
  margin-bottom: 4px;
}

.profile-info p {
  color: var(--muted);
  margin-bottom: 22px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.social-links a {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 18px;
  transition: background 0.3s var(--ease-out), transform 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out);
}

.social-links a:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
}

/* Sections */
.section {
  padding: 130px 0;
  position: relative;
}

.section-head {
  margin-bottom: 64px;
  max-width: 640px;
}

.section-title {
  font-size: clamp(34px, 5vw, 52px);
  margin-bottom: 12px;
}

.section-desc {
  color: var(--muted);
  font-size: 18px;
  font-weight: 300;
}

/* About: asymmetric grid */
.about-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(190px, auto);
  gap: 20px;
}

.about-cell {
  padding: 36px 32px;
  background: rgba(8, 11, 20, 0.55);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--r-card);
  transition: border-color 0.4s var(--ease-out), background 0.4s var(--ease-out),
    transform 0.4s var(--ease-out);
}

.about-cell:hover {
  border-color: rgba(77, 141, 255, 0.35);
  background: var(--surface-2);
  transform: translateY(-4px);
}

.cell-photo {
  grid-column: 1 / 6;
  grid-row: 1 / 3;
  padding: 0;
  overflow: hidden;
}

.cell-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out);
}

.cell-photo:hover img {
  transform: scale(1.05);
}

.cell-feature {
  grid-column: 6 / 13;
  background: linear-gradient(135deg, var(--accent-soft), rgba(8, 11, 20, 0.55) 60%), rgba(8, 11, 20, 0.55);
}

.about-cell:nth-child(3) {
  grid-column: 6 / 10;
}

.about-cell:nth-child(4) {
  grid-column: 10 / 13;
}

.icon-box {
  width: 54px;
  height: 54px;
  background: var(--accent-soft);
  border-radius: var(--r-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--accent);
  margin-bottom: 20px;
}

.about-cell h3 {
  font-size: 21px;
  margin-bottom: 10px;
}

.about-cell p {
  color: var(--muted);
  font-size: 15px;
}

/* Skills marquee */
.skills .section-head {
  margin-bottom: 40px;
}

.marquee {
  overflow: hidden;
  padding: 18px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-group {
  display: flex;
  gap: 18px;
  padding-right: 18px;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.skill-tag {
  padding: 16px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out);
}

.skill-tag i {
  color: var(--accent);
  font-size: 22px;
}

.skill-tag:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.gallery-item {
  position: relative;
  border-radius: var(--r-card);
  overflow: hidden;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.12);
  transition: filter 0.5s var(--ease-out);
  will-change: transform;
}

.gallery-item:hover img {
  filter: brightness(1.08) saturate(1.08);
}

.item-1 {
  grid-column: 1 / 8;
  aspect-ratio: 4 / 3;
}

.item-2 {
  grid-column: 8 / 13;
  aspect-ratio: 4 / 5;
  margin-top: 72px;
}

.item-3 {
  grid-column: 1 / 6;
  aspect-ratio: 1 / 1;
  margin-top: -52px;
}

.item-4 {
  grid-column: 6 / 13;
  aspect-ratio: 16 / 10;
}

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(5, 7, 13, 0.72));
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 22px;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.overlay i {
  font-size: 26px;
  color: #ffffff;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item:hover .overlay {
  opacity: 1;
}

/* Lightbox */
.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3, 4, 9, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}

.lightbox.open {
  opacity: 1;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--r-card);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s var(--ease-out);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Contact */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.contact-info {
  padding: 52px 44px;
  background: linear-gradient(160deg, var(--accent-soft), rgba(255, 255, 255, 0.01) 70%);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-info h3 {
  font-size: 30px;
  margin-bottom: 14px;
}

.contact-info p {
  color: var(--muted);
  margin-bottom: 36px;
}

.c-item {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  font-size: 16px;
  word-break: break-word;
}

.c-item i {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.contact-form {
  padding: 52px 44px;
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #6d7791;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* Footer */
.site-footer {
  padding: 44px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

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

.credit a:hover {
  color: var(--text);
}

/* Thank-you page */
.thank-you-section {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.thank-you-card {
  max-width: 480px;
  width: 100%;
  padding: 52px 36px;
  background: rgba(8, 11, 20, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 24px 60px rgba(0, 0, 0, 0.45);
}

.success-icon {
  width: 84px;
  height: 84px;
  background: var(--accent-soft);
  border: 1px solid rgba(77, 141, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 26px;
  color: var(--accent);
  font-size: 42px;
  animation: popIn 0.6s var(--ease-out);
}

.thank-you-title {
  font-size: 34px;
  margin-bottom: 14px;
}

.thank-you-msg {
  color: var(--muted);
  margin-bottom: 34px;
  font-size: 16px;
}

@keyframes popIn {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 56px;
    text-align: center;
    padding-top: 32px;
    padding-bottom: 56px;
  }

  .hero-eyebrow,
  .hero-actions {
    justify-content: center;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-stats {
    justify-content: center;
    margin: 0 auto;
  }
}

@media (max-width: 900px) {
  .section {
    padding: 90px 0;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 20px 24px 28px;
    background: rgba(5, 7, 13, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s var(--ease-out), opacity 0.35s var(--ease-out),
      visibility 0.35s;
  }

  .site-nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    padding: 12px 4px;
    font-size: 17px;
  }

  .nav-cta {
    text-align: center;
    margin-top: 8px;
  }

  .mobile-toggle {
    display: block;
  }

  .about-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .cell-photo,
  .cell-feature,
  .about-cell:nth-child(3),
  .about-cell:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .cell-photo {
    max-height: 380px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .item-1,
  .item-2,
  .item-3,
  .item-4 {
    grid-column: 1 / -1;
    margin-top: 0;
    aspect-ratio: 4 / 3;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
  }

  .contact-info,
  .contact-form {
    padding: 40px 28px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .marquee {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .marquee-track {
    animation: none;
    width: 100%;
  }

  .marquee-group {
    flex-wrap: wrap;
    justify-content: center;
  }

  .marquee-group[aria-hidden="true"] {
    display: none;
  }

  .gallery-item img {
    transform: none;
  }
}
