/*
  Hanz Hendrick Lacsi — One-page Portfolio Styles
  Color palette: Blue (#2563eb), Dark Navy (#0f172a), Slate (#475569), Light Gray (#f1f5f9), White (#ffffff)
  Font: Poppins
*/

:root {
  --bg: #0f172a; /* dark base */
  --surface: #0b1220;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #22c55e; /* green-500 */
  --primary-600: #16a34a; /* green-600 */
  --primary-700: #15803d; /* green-700 */
  --card: #111827;
  --border: #1f2937;
  --alt: #0b1220;
  --shadow: 0 10px 30px rgba(0,0,0,0.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 80% -10%, rgba(34,197,94,0.16), transparent 60%),
              radial-gradient(1000px 700px at -10% 20%, rgba(34,197,94,0.10), transparent 60%),
              var(--bg);
  line-height: 1.6;
}

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

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.section { padding: 80px 0; }
.section.alt { background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: clamp(2rem, 2.8vw + 1rem, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 1.4vw + 1rem, 2.2rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
.lead { color: var(--muted); font-size: 1.05rem; text-align: justify; hyphens: auto; }
.subtitle { color: var(--muted); margin-top: 4px; }
.eyebrow { color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: .85rem; }
.accent { color: var(--primary); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  background: rgba(15,23,42,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { color: #fff; font-weight: 700; text-decoration: none; letter-spacing: 0.5px; }

.site-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 500; opacity: .9; }
.site-nav a:hover { color: #fff; opacity: 1; }

.nav-toggle { display: none; background: transparent; border: none; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; transition: transform .3s ease, opacity .3s ease; }

/* Hero */
.hero { position: relative; padding: 120px 0 100px; overflow: hidden; }
.hero-inner { display: grid; align-items: center; min-height: 60vh; }
.hero-content { max-width: 720px; }
.cta { margin-top: 22px; }

.hero-inner.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center; }
.hero-media { display: flex; justify-content: center; }
.hero-photo { width: min(420px, 90%); aspect-ratio: 1 / 1; border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 12px 24px rgba(0,0,0,0.25); background: rgba(255,255,255,0.03); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-bg { position: absolute; inset: -40% -30% auto auto; height: 520px; width: 520px; background: radial-gradient(50% 50% at 50% 50%, rgba(34,197,94,0.25) 0%, rgba(34,197,94,0.05) 60%, transparent 70%); filter: blur(20px); pointer-events: none; }

/* Buttons */
.btn {
  display: inline-block; padding: 12px 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; text-decoration: none; transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease; cursor: pointer;
}
.btn-primary { background: var(--primary); color: #0b1a12; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--primary-600); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { color: #fff; border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.04); }
.btn-ghost:hover { border-color: rgba(34,197,94,0.5); background: rgba(34,197,94,0.08); }
.header-cta { margin-left: 12px; }

/* Cards */
.card-grid { display: grid; grid-template-columns: 1.1fr 1.1fr 1.4fr; grid-template-rows: auto auto; grid-template-areas:
  "nids net pulse"
  "nids net pulse";
  gap: 18px; margin-top: 24px; }
.project-card.nids { grid-area: nids; }
.project-card.net { grid-area: net; }
.project-card.pulse { grid-area: pulse; display: grid; align-content: start; }
.project-card .project-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.project-card .project-media { min-width: 0; }
.project-card .project-desc { display: grid; align-content: start; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-4px); border-color: rgba(34,197,94,0.5); box-shadow: 0 12px 24px rgba(0,0,0,0.25); }
.card p { color: var(--muted); margin: 8px 0 0; }

/* Justify text for all project descriptions */
.project-card p { text-align: justify; hyphens: auto; }

/* Project media */
.project-card .thumb { width: 100%; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); margin-bottom: 10px; }

/* Simple carousel */
.carousel { position: relative; overflow: hidden; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); margin-bottom: 10px; }
.carousel-track { display: flex; transition: transform .35s ease; }
.carousel .slide { width: 100%; flex: 0 0 100%; display: block; }
.carousel.landscape { aspect-ratio: 16 / 9; background: #0b1220; }
.carousel.landscape .slide { height: 100%; object-fit: cover; object-position: center; }
.carousel.portrait { aspect-ratio: 9 / 16; background: #0b1220; min-height: 320px; }
.carousel.portrait .slide { height: 100%; object-fit: cover; object-position: center top; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.35); color: #fff; border: 1px solid rgba(255,255,255,0.2); width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; }
.carousel-btn:hover { background: rgba(34,197,94,0.4); }
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; gap: 6px; justify-content: center; }
.carousel-dots button { width: 8px; height: 8px; border-radius: 999px; border: none; background: rgba(255,255,255,0.5); cursor: pointer; padding: 0; }
.carousel-dots button[aria-selected="true"] { background: var(--primary); }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 16px; }
.skill-block { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.skill-block h3 { margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chips li { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); padding: 6px 10px; border-radius: 999px; font-size: .9rem; color: var(--text); }
.about-highlights { margin-top: 12px; }
.about-highlights li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* Certifications */
.cert-list { margin-top: 8px; color: var(--muted); }
/* Certificates grid uses card styles */
.cert-grid { 
  margin-top: 16px; 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 18px; 
  align-items: stretch; /* make items fill row height */
}
.cert-grid .card { height: 100%; }
.cert-card { display: flex; flex-direction: column; height: 100%; }
/* Keep headings consistent height regardless of title length */
.cert-card h3 { 
  margin-top: 0; 
  line-height: 1.3; 
  display: -webkit-box; 
  -webkit-line-clamp: 2; 
  line-clamp: 2; 
  -webkit-box-orient: vertical; 
  overflow: hidden; 
  min-height: calc(1.2rem * 1.3 * 2); /* 2 lines */
}
.cert-card .meta { 
  color: var(--muted); 
  font-size: .9rem; 
  margin: 4px 0 12px; 
  line-height: 1.3; 
  min-height: calc(0.9rem * 1.3); /* 1 line */
}
/* Uniform media size for all certificate thumbnails */
.cert-card .thumb { 
  width: 100%; 
  height: 200px; /* fixed visual height to normalize cards */
  object-fit: cover; 
  object-position: center; 
  border-radius: 12px; 
  border: 1px solid rgba(255,255,255,0.08); 
  margin-bottom: 12px; 
  background: #0b1220; 
}
/* Keep button row pinned to bottom for equal-height cards */
.cert-card .actions { margin-top: auto; }
/* Make the View Certificate button take full width */
.cert-card .actions .btn { 
  width: 100%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
}

/* Contact */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }

.contact-header { margin-bottom: 32px; }
.contact-header h2 { margin-bottom: 8px; }
.contact-subtitle { color: var(--muted); font-size: 1.1rem; margin: 0; }

.contact-info { display: grid; gap: 16px; }
.contact-card { 
  display: flex; align-items: center; gap: 16px; 
  background: var(--card); border: 1px solid var(--border); 
  border-radius: 14px; padding: 20px; 
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.contact-card:hover { 
  transform: translateY(-2px); 
  border-color: rgba(34,197,94,0.5); 
  box-shadow: 0 8px 20px rgba(0,0,0,0.15); 
}
.contact-icon { 
  display: flex; align-items: center; justify-content: center; 
  width: 48px; height: 48px; 
  background: rgba(34,197,94,0.12); 
  border-radius: 12px; 
  color: var(--primary); 
  flex-shrink: 0;
}
.contact-details h3 { margin: 0 0 4px; font-size: 1rem; }
.contact-details a, .contact-details span { color: var(--muted); text-decoration: none; }
.contact-details a:hover { color: #fff; text-decoration: underline; }

.contact-form { 
  background: var(--card); 
  border: 1px solid var(--border); 
  border-radius: 18px; 
  padding: 32px; 
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.contact-form #honey { display: none; }

.form-header { margin-bottom: 24px; }
.form-header h3 { margin: 0 0 8px; font-size: 1.4rem; }
.form-header p { color: var(--muted); margin: 0; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-status { margin-bottom: 16px; font-size: .9rem; color: var(--muted); text-align: center; }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field label { font-weight: 500; color: var(--text); }
.field input, .field textarea { 
  width: 100%; 
  padding: 14px 16px; 
  border-radius: 12px; 
  border: 1px solid var(--border); 
  background: rgba(255,255,255,0.02); 
  color: var(--text); 
  outline: none; 
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  font-family: inherit;
}
.field input:focus, .field textarea:focus { 
  border-color: var(--primary); 
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15); 
  background: rgba(255,255,255,0.04);
}
.field textarea { resize: vertical; min-height: 120px; }
.error { color: #fca5a5; min-height: 18px; font-size: .85rem; }

.btn-submit { 
  width: 100%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px; 
  padding: 16px 24px; 
  font-size: 1rem;
  margin-bottom: 16px;
}
.btn-submit:hover .btn-icon { transform: translateX(2px); }
.btn-icon { transition: transform .2s ease; }

.form-note { 
  color: var(--muted); 
  font-size: .85rem; 
  text-align: center; 
  margin: 0; 
  line-height: 1.4;
}

.contact-social {
  text-align: center; 
  margin-top: 40px; 
  padding-top: 32px; 
  border-top: 1px solid var(--border);
}
.contact-social h3 { 
  margin: 0 0 8px; 
  font-size: 1.2rem; 
}
.contact-social p { 
  color: var(--muted); 
  margin: 0 0 20px; 
}
.contact-social .socials { 
  justify-content: center; 
  margin: 0; 
}

/* Footer */
.site-footer { padding: 28px 0; border-top: 1px solid rgba(255,255,255,0.06); background: rgba(0,0,0,0.15); }
.site-footer p { color: var(--muted); text-align: center; margin: 0; }

/* Responsive */
@media (max-width: 980px) {
  .card-grid { grid-template-columns: 1fr; grid-template-areas: none; grid-auto-rows: auto; }
  .project-card.nids, .project-card.net, .project-card.pulse { grid-area: auto; }
  .project-card .project-split { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-layout { grid-template-columns: 1fr; gap: 30px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .header-inner { height: 60px; }
  .site-nav { position: absolute; inset: 60px 0 auto 0; background: rgba(15,23,42,0.95); border-bottom: 1px solid rgba(255,255,255,0.08); display: none; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li { border-top: 1px solid rgba(255,255,255,0.06); }
  .site-nav a { display: block; padding: 12px 16px; }
  .nav-toggle { display: inline-block; }
  .card-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: 1fr; }

  .hero-inner.two-col { grid-template-columns: 1fr; }
  .hero-photo { width: 100%; margin: 12px auto 0; }
}

/* Socials */
.socials { list-style: none; display: flex; gap: 14px; padding: 0; margin: 18px 0 0; }
.socials a { color: var(--text); display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); }
.socials a:hover { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.5); color: #fff; }

/* Accessibility helpers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
