/* ============================================================
   MAX EVEN — PORTFOLIO
   style.css  |  Shared across all pages
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Source+Sans+Pro:ital,wght@0,400;0,600;1,400&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:        #FFFFFF;
  --text:      #1A1A1A;
  --accent:    #1B3A5C;
  --accent-lt: rgba(27,58,92,0.07);
  --mid:       #444444;
  --sub:       #666666;
  --light-bg:  #F5F5F5;
  --border:    #E5E5E5;
  --nav-h:     64px;
  --max-w:     1100px;
  --fh:        'Montserrat', sans-serif;
  --fb:        'Source Sans Pro', sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
img   { display: block; max-width: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--fb);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ── Navigation ─────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 52px;
}

.nav-name {
  font-family: var(--fh);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  font-family: var(--fh);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sub);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

/* Hamburger (mobile only) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all 0.25s;
}

/* ── Layout helpers ─────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 52px;
}

.page-body { padding-top: var(--nav-h); }

section { padding: 96px 0; }
section.tight { padding: 64px 0; }

.section-label {
  font-family: var(--fh);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

/* ── Typography ─────────────────────────────────────────────── */
h1 {
  font-family: var(--fh);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.5px;
}

h2 {
  font-family: var(--fh);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.25;
}

h3 {
  font-family: var(--fh);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

p { color: var(--mid); margin-bottom: 16px; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

strong { font-weight: 600; color: var(--text); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 14px 34px;
  background: var(--accent);
  color: #fff;
  font-family: var(--fh);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.btn:hover {
  background: #12293f;
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

.btn-white {
  background: #fff;
  color: var(--accent);
}
.btn-white:hover {
  background: #f0f0f0;
}

/* ── Tags ───────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-family: var(--fh);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-lt);
  padding: 5px 11px;
  border-radius: 2px;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  min-height: 92vh;
  background: var(--accent);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Subtle geometric background pattern */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* Radial glow */
.hero::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.22;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 52px;
}

.hero-eyebrow {
  font-family: var(--fh);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 24px;
}

.hero h1 {
  color: #fff;
  max-width: 680px;
  margin-bottom: 24px;
}

.hero-sub {
  font-family: var(--fb);
  font-size: 19px;
  color: rgba(255,255,255,0.72);
  max-width: 500px;
  line-height: 1.65;
  margin-bottom: 48px;
}

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

/* ── Credentials bar ────────────────────────────────────────── */
.cred-bar {
  background: var(--light-bg);
  padding: 18px 52px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

.cred-bar-item {
  font-family: var(--fh);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--sub);
  padding: 4px 20px;
}

.cred-bar-item:not(:last-child) {
  border-right: 1px solid var(--border);
}

/* ── Project cards (home + projects page) ───────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 52px;
}

.project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s, box-shadow 0.25s;
  background: var(--bg);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.09);
  text-decoration: none;
}

.card-img {
  width: 100%;
  height: 340px;
  background: var(--accent);
  overflow: hidden;
  position: relative;
}

.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.project-card:hover .card-img img { transform: scale(1.04); }

.card-img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--accent) 0%, #2a5280 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fh);
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
}

.card-body {
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.card-body h3 {
  font-size: 21px;
  margin-bottom: 10px;
  color: var(--text);
}

.card-body p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--sub);
  margin-bottom: 24px;
  flex: 1;
}

.card-link {
  font-family: var(--fh);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.card-link::after {
  content: '→';
  transition: transform 0.2s;
}

.project-card:hover .card-link::after { transform: translateX(4px); }

/* ── Project detail ─────────────────────────────────────────── */
.proj-hero {
  width: 100%;
  height: 440px;
  background: var(--accent);
  overflow: hidden;
  position: relative;
  margin-top: var(--nav-h);
}

.proj-hero img {
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0.9;
}

.proj-hero-placeholder {
  width: 100%;
  height: 440px;
  margin-top: var(--nav-h);
  background: linear-gradient(135deg, var(--accent) 0%, #2a5280 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

.proj-hero-placeholder .ph-label {
  font-family: var(--fh);
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
}

.proj-hero-placeholder .ph-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.25);
}

.proj-body {
  max-width: 820px;
  margin: 0 auto;
  padding: 72px 52px 96px;
}

.proj-header {
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.proj-header h1 {
  font-size: clamp(26px, 4vw, 42px);
  margin-bottom: 10px;
}

.proj-header .proj-subtitle {
  font-size: 17px;
  color: var(--sub);
  margin-bottom: 24px;
  font-style: italic;
}

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.proj-section { margin-bottom: 60px; }

.proj-section-title {
  font-family: var(--fh);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.proj-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.proj-section p {
  font-size: 16px;
  line-height: 1.85;
  color: var(--mid);
  margin-bottom: 18px;
}

.proj-section p:last-child { margin-bottom: 0; }

/* Callout */
.callout {
  background: var(--accent-lt);
  border-left: 3px solid var(--accent);
  padding: 20px 24px;
  margin: 28px 0;
  border-radius: 0 3px 3px 0;
}

.callout p {
  color: var(--text);
  font-size: 15px;
  margin: 0;
}

/* Sensor blocks */
.sensor-block {
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.sensor-block h3 {
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 6px;
}

.sensor-block p {
  font-size: 15px;
  color: var(--mid);
  line-height: 1.7;
  margin: 0;
}

/* Image layouts */
.img-single {
  width: 100%;
  margin: 28px 0;
  border: 1px solid var(--border);
  overflow: hidden;
}

.img-single img { width: 100%; height: auto; }

.img-caption {
  font-size: 13px;
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 10px 16px;
  background: var(--light-bg);
}

.img-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0;
}

.img-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0;
}

.img-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 28px 0;
}

.img-item {
  border: 1px solid var(--border);
  overflow: hidden;
}

.img-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.img-ph {
  aspect-ratio: 4/3;
  background: var(--light-bg);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  text-align: center;
}

.img-ph .ph-main {
  font-family: var(--fh);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #bbb;
}

.img-ph .ph-sub {
  font-size: 12px;
  color: #ccc;
}

/* Results table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}

.data-table thead tr {
  background: var(--accent);
}

.data-table th {
  color: #fff;
  font-family: var(--fh);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 13px 18px;
  text-align: left;
}

.data-table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--mid);
}

.data-table tr.best td {
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-lt);
}

.data-table tr:last-child td { border-bottom: none; }

/* Prototype steps */
.proto-step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 20px;
  margin-bottom: 36px;
  align-items: start;
}

.step-num {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #fff;
  font-family: var(--fh);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 4px;
}

.step-content h3 {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 8px;
}

.step-content p {
  font-size: 15px;
  color: var(--mid);
  line-height: 1.75;
  margin: 0;
}

/* ── About page ─────────────────────────────────────────────── */
.about-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 88px 52px;
}

.about-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 80px;
  align-items: start;
  margin-bottom: 88px;
}

.about-photo {
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(160deg, var(--accent) 0%, #2a5280 100%);
  overflow: hidden;
  position: sticky;
  top: calc(var(--nav-h) + 32px);
}

.about-photo img { width: 100%; height: 100%; object-fit: cover; }

.about-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
}

.about-photo.placeholder .ph-main {
  font-family: var(--fh);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.about-text h1 { margin-bottom: 32px; }
.about-text p { font-size: 16px; color: var(--mid); line-height: 1.85; margin-bottom: 22px; }

.about-contact-row {
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* Skills section */
.skills-section {
  background: var(--light-bg);
  padding: 72px 52px;
}

.skills-section h2 {
  max-width: var(--max-w);
  margin: 0 auto 48px;
  font-size: 24px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.skill-group {}

.skill-group-label {
  font-family: var(--fh);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-list li {
  font-size: 15px;
  color: var(--mid);
  padding-left: 14px;
  position: relative;
}

.skill-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 1px;
  background: var(--accent);
}

/* ── Resume page ────────────────────────────────────────────── */
.resume-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 80px 52px 96px;
}

.resume-wrap h1 { margin-bottom: 12px; }

.resume-wrap .note {
  color: var(--sub);
  font-size: 16px;
  margin-bottom: 40px;
}

.pdf-container {
  width: 100%;
  height: 900px;
  border: 1px solid var(--border);
  margin-bottom: 28px;
}

.pdf-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.pdf-placeholder {
  width: 100%;
  height: 900px;
  background: var(--light-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.pdf-placeholder .ph-main {
  font-family: var(--fh);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #bbb;
  text-transform: uppercase;
}

/* ── Contact page ───────────────────────────────────────────── */
.contact-wrap {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 52px;
}

.contact-inner {
  max-width: 580px;
  width: 100%;
}

.contact-inner h1 { margin-bottom: 20px; }

.contact-intro {
  font-size: 18px;
  color: var(--sub);
  line-height: 1.7;
  margin-bottom: 52px;
}

.contact-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 48px;
  border-top: 1px solid var(--border);
}

.contact-row {
  display: flex;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  gap: 24px;
}

.contact-row-label {
  font-family: var(--fh);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sub);
  min-width: 90px;
}

.contact-row-value {
  font-size: 16px;
  color: var(--text);
}

.contact-row-value a {
  color: var(--accent);
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  background: var(--text);
  padding: 28px 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-name {
  font-family: var(--fh);
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.5px;
}

.footer-right {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
}

.footer-right a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
}

.footer-right a:hover { color: rgba(255,255,255,0.8); }

/* ── Fade-in on scroll ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal-stagger.visible > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.05s; }
.reveal-stagger.visible > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.15s; }
.reveal-stagger.visible > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.25s; }
.reveal-stagger.visible > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.35s; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  nav { padding: 0 28px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 28px 28px 32px;
    gap: 28px;
  }

  .container { padding: 0 28px; }
  .hero-inner { padding: 0 28px; }
  section { padding: 64px 0; }

  .cred-bar { padding: 16px 28px; gap: 4px; }
  .cred-bar-item { padding: 4px 12px; font-size: 10px; }

  .about-wrap { padding: 64px 28px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-photo { position: static; max-width: 260px; aspect-ratio: 1; }

  .skills-section { padding: 56px 28px; }
  .skills-grid { grid-template-columns: 1fr 1fr; gap: 32px; }

  .proj-body { padding: 48px 28px 72px; }
  .proj-hero { height: 280px; }
  .proj-hero-placeholder { height: 280px; }

  .img-grid-2,
  .img-grid-3,
  .img-grid-4 { grid-template-columns: 1fr; }

  .resume-wrap { padding: 56px 28px 72px; }
  .pdf-container { height: 600px; }
  .pdf-placeholder { height: 600px; }

  .contact-wrap { padding: 64px 28px; }

  footer { padding: 24px 28px; flex-direction: column; gap: 8px; text-align: center; }

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

@media (max-width: 600px) {
  .skills-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .hero-sub { font-size: 16px; }
  .proto-step { grid-template-columns: 1fr; }
  .step-num { display: none; }
}
