/* ==========================================================================
   Gamini Heraliyawala — Portfolio
   Palette: deep navy ink, warm ivory ground, antique gold accent
   ========================================================================== */

:root {
  --ink: #16283c;
  --ink-soft: #3d4f63;
  --ink-mute: #6b7a8c;
  --ivory: #faf8f4;
  --ivory-deep: #f1ede5;
  --white: #ffffff;
  --gold: #b28a2f;
  --gold-soft: #d8bc79;
  --line: #e3ddd1;
  --shadow: 0 10px 30px rgba(22, 40, 60, 0.08);
  --radius: 10px;
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink-soft);
  background: var(--ivory);
  line-height: 1.7;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.2;
  font-weight: 600;
}

a { color: var(--gold); text-decoration: none; }

/* ===== Header / Nav ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--gold); }

.nav-links .nav-cta {
  padding: 9px 20px;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
}

.nav-links .nav-cta:hover {
  background: var(--gold);
  color: var(--white);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s, opacity 0.25s;
}

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

.hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(178, 138, 47, 0.10), transparent 60%),
    linear-gradient(180deg, var(--ivory) 0%, var(--ivory-deep) 100%);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  padding: 96px 24px 88px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  max-width: 24ch;
  margin-bottom: 24px;
}

.hero-lead {
  max-width: 58ch;
  font-size: 1.08rem;
  margin-bottom: 36px;
}

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

.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
}

.btn-primary:hover { transform: translateY(-2px); background: #1f3650; }

.btn-ghost {
  border: 1.5px solid var(--ink);
  color: var(--ink);
}

.btn-ghost:hover { background: var(--ink); color: var(--white); }

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-photo {
  width: 280px;
  height: 280px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--shadow);
  border: 3px solid var(--gold-soft);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 72px;
  box-shadow: var(--shadow);
  grid-column: 1 / -1;
}

.stat {
  background: var(--white);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--ink-mute);
  line-height: 1.45;
}

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

.section { padding: 96px 0; }

.section-alt {
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 12px;
}

.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }

/* ===== About ===== */

.about-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 56px;
  align-items: start;
}

.about-copy p + p { margin-top: 20px; }

.about-frameworks {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.about-frameworks h3 {
  font-size: 1.15rem;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gold-soft);
}

.about-frameworks ul { list-style: none; }

.about-frameworks li {
  padding: 10px 0 10px 26px;
  position: relative;
  font-size: 0.95rem;
  border-bottom: 1px dashed var(--line);
}

.about-frameworks li:last-child { border-bottom: 0; }

.about-frameworks li::before {
  content: "◆";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.7rem;
  top: 14px;
}

/* ===== Expertise cards ===== */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--gold-soft);
}

.card h3 {
  font-size: 1.18rem;
  margin-bottom: 12px;
}

.card p { font-size: 0.93rem; color: var(--ink-mute); }

/* ===== Timeline ===== */

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 218px;
  top: 8px;
  bottom: 8px;
  width: 1.5px;
  background: linear-gradient(180deg, var(--gold-soft), var(--line));
}

.tl-item {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 56px;
  position: relative;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: 212px;
  top: 8px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ivory);
  border: 3px solid var(--gold);
}

.tl-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}

.tl-dates {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.92rem;
}

.tl-loc { font-size: 0.8rem; color: var(--ink-mute); }

.tl-body h3 { font-size: 1.25rem; margin-bottom: 4px; }

.tl-org {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 12px;
}

.tl-body > p:last-child {
  font-size: 0.95rem;
  color: var(--ink-mute);
}

/* ===== Achievements ===== */

.achievements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.achievement {
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
}

.achievement-num {
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 700;
  color: rgba(178, 138, 47, 0.16);
  position: absolute;
  top: 12px;
  right: 22px;
  line-height: 1;
}

.achievement h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  max-width: 26ch;
}

.achievement p { font-size: 0.93rem; color: var(--ink-mute); }

/* ===== Credentials ===== */

.cred-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
}

.cred-col h3 {
  font-size: 1.2rem;
  padding-bottom: 14px;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--gold-soft);
}

.cred-col .cred-sub { margin-top: 40px; }

.cred-list { list-style: none; }

.cred-list li {
  padding: 18px 0;
  border-bottom: 1px dashed var(--line);
}

.cred-list li:last-child { border-bottom: 0; }

.cred-list strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 3px;
}

.cred-list span {
  font-size: 0.86rem;
  color: var(--ink-mute);
  line-height: 1.55;
}

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

.section-contact {
  background: var(--ink);
}

.section-contact .section-eyebrow { color: var(--gold-soft); }

.section-contact h2 { color: var(--white); }

.contact-lead {
  margin-top: 16px;
  color: #aebbc9;
  max-width: 52ch;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.contact-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--gold-soft);
  transform: translateY(-3px);
}

.contact-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gold-soft);
}

.contact-value {
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

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

.site-footer {
  background: #0f1d2c;
  padding: 28px 0;
}

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

.footer-left { flex: 1; }

.site-footer p { color: #7d8fa1; font-size: 0.85rem; margin: 0; }

.footer-credit {
  margin-top: 4px !important;
}

.footer-credit a {
  color: var(--gold-soft);
  font-weight: 500;
}

.back-to-top {
  color: var(--gold-soft);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ===== Reveal animation ===== */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

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

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-image { justify-content: center; }
  .hero-photo { width: 240px; height: 240px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); grid-column: auto; }
  .about-grid, .cred-grid { grid-template-columns: 1fr; gap: 40px; }
  .achievements { grid-template-columns: 1fr; }
  .contact-cards { grid-template-columns: repeat(2, 1fr); }

  .timeline::before { left: 6px; }
  .tl-item { grid-template-columns: 1fr; gap: 8px; padding-left: 36px; }
  .tl-item::before { left: 0; }
  .tl-meta { text-align: left; flex-direction: row; gap: 14px; align-items: baseline; }
}

@media (max-width: 640px) {
  .cards, .contact-cards { grid-template-columns: 1fr; }
  .hero-inner { padding: 64px 24px 56px; }
  .section { padding: 64px 0; }
  .brand-name { display: none; }

  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--ivory);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 16px;
    display: none;
  }

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

  .nav-links li { width: 100%; }

  .nav-links a {
    display: block;
    padding: 12px 0;
    font-size: 1rem;
  }

  .nav-links .nav-cta {
    border: 0;
    padding: 12px 0;
  }

  .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); }
}
