/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-off: #f7f7f7;
  --text: #111111;
  --text-muted: #888888;
  --border: #e5e5e5;
  --font: 'Inter', sans-serif;
  --radius: 10px;
  --ease: 0.25s ease;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 60px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ease);
}

nav.scrolled { border-color: var(--border); }

.nav-logo {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 36px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

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

.nav-cta {
  background: var(--text);
  color: #fff;
  padding: 9px 20px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity var(--ease);
}

.nav-cta:hover { opacity: 0.75; }

.nav-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-menu-btn span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--ease);
}

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 60px 80px;
}

.hero-content {
  max-width: 760px;
}

.hero-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 28px;
}

.hero-title {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 36px;
  line-height: 1.7;
}

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

.btn-primary {
  background: var(--text);
  color: #fff;
  padding: 13px 28px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: opacity var(--ease);
}

.btn-primary:hover { opacity: 0.75; }

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 28px;
  border-radius: 100px;
  font-weight: 500;
  font-size: 0.92rem;
  transition: border-color var(--ease), background var(--ease);
}

.btn-ghost:hover { border-color: #aaa; background: var(--bg-off); }

.hero-stats {
  display: flex;
  gap: 48px;
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== SECTION BASE ===== */
section { padding: 96px 60px; }
.section-inner { max-width: 1100px; margin: 0 auto; }

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 14px;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.7;
}

/* ===== ABOUT ===== */
#about { background: var(--bg-off); border-top: 1px solid var(--border); }

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

.about-body {
  font-size: 0.97rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-top: 20px;
  margin-bottom: 16px;
}

.about-right { padding-top: 8px; }

.about-skills-title,
.about-tools-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}

.about-tools-title { margin-top: 32px; }

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
}

.tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
}

.tool-item .tool-icon { font-size: 0.9rem; }

/* ===== WORK ===== */
#work { background: var(--bg); border-top: 1px solid var(--border); }

.work-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
  flex-wrap: wrap;
  gap: 20px;
}

.work-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 18px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease);
  font-family: var(--font);
}

.filter-btn:hover { color: var(--text); border-color: #aaa; }
.filter-btn.active { background: var(--text); border-color: var(--text); color: #fff; }

.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.work-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-off);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--ease), transform var(--ease);
  grid-column: span 4;
}

.work-card:nth-child(1) { grid-column: span 8; }
.work-card:nth-child(6) { grid-column: span 8; }
.work-card:nth-child(6) .work-card-img { aspect-ratio: 16/10; padding: 0 !important; height: auto !important; position: relative !important; }
.work-card:nth-child(6) .work-card-img iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.work-card:hover { border-color: #aaa; transform: translateY(-3px); }

.work-card-img {
  width: 100%;
  aspect-ratio: 16/10;
  background: #ebebeb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  opacity: 0.4;
  transition: opacity var(--ease);
  overflow: hidden;
}

.work-card:nth-child(1) .work-card-img { aspect-ratio: 16/8; }
.work-card:hover .work-card-img { opacity: 0.6; }

/* Real images / videos inside cards */
.work-card-img img,
.work-card-img video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  align-self: stretch;
  transition: transform 0.4s ease;
}

.work-card-img:has(img),
.work-card-img:has(video),
.work-card-img:has(iframe) {
  opacity: 1;
}

.work-card:hover .work-card-img:has(img),
.work-card:hover .work-card-img:has(video) {
  opacity: 1;
}

.work-card:hover .work-card-img img,
.work-card:hover .work-card-img video {
  transform: scale(1.03);
}

/* Rush flyer — fit full image within frame */
.work-card[data-project="rush-flyer"] .work-card-img {
  background: #ebebeb;
}
.work-card[data-project="rush-flyer"] .work-card-img img {
  object-fit: contain;
}

/* SQFT logo — show full image without cropping */
.work-card[data-project="sqft-logo"] .work-card-img {
  background: #f5f5f5;
}
.work-card[data-project="sqft-logo"] .work-card-img img {
  object-fit: contain;
  transform: scale(1.15);
}
.work-card:hover .work-card[data-project="sqft-logo"] .work-card-img img {
  transform: scale(1.03);
}

.work-card-body { padding: 18px 20px 22px; }

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

.work-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.work-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: -0.01em;
}

.work-card-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.work-card-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0;
  transition: opacity var(--ease);
}

.work-card:hover .work-card-link { opacity: 1; }

/* ===== RESUME ===== */
#resume { background: var(--bg-off); border-top: 1px solid var(--border); }

.resume-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 48px;
}

.resume-col-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.timeline { display: flex; flex-direction: column; }

.timeline-item {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

.timeline-item:last-child { border-bottom: none; }

.timeline-role {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.timeline-company {
  font-size: 0.85rem;
  color: #444444;
  font-weight: 500;
  margin-bottom: 8px;
}

.timeline-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 3px;
}

.resume-download {
  margin-top: 44px;
  text-align: center;
}

/* ===== CONTACT ===== */
#contact { background: var(--bg); border-top: 1px solid var(--border); }

.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 80px;
  align-items: start;
}

.contact-intro {
  font-size: 0.97rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 20px;
  margin-bottom: 36px;
}

.contact-items { display: flex; flex-direction: column; gap: 18px; margin-bottom: 32px; }

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-item-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact-item-value {
  font-size: 0.9rem;
  font-weight: 500;
}

.contact-socials {
  display: flex;
  gap: 10px;
}

.social-btn {
  width: 38px; height: 38px;
  background: #0a66c2;
  border: 1px solid #0a66c2;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  transition: background var(--ease), border-color var(--ease);
}

.social-btn:hover { background: #004182; border-color: #004182; }

/* Form */
.contact-form {
  background: var(--bg-off);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 7px;
}

input, textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--ease);
  resize: none;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, textarea:focus, select:focus { border-color: #aaa; }
input::placeholder, textarea::placeholder { color: #bbb; }
select option { background: #fff; }

.form-submit {
  width: 100%;
  background: var(--text);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 100px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity var(--ease);
  margin-top: 6px;
}

.form-submit:hover { opacity: 0.75; }

/* ===== FOOTER ===== */
footer {
  background: var(--bg-off);
  border-top: 1px solid var(--border);
  padding: 32px 60px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-logo {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

/* ===== MOBILE NAV OVERLAY ===== */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

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

.nav-overlay a {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ===== TYPEWRITER ===== */
.typewriter-cursor {
  display: inline-block;
  font-weight: 300;
  color: #57068c;
  animation: blink 0.75s step-end infinite;
  margin-left: 1px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ===== FADE-UP ANIMATIONS ===== */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .work-card:nth-child(1) { grid-column: span 12; }
  .work-card:nth-child(4), .work-card:nth-child(5) { grid-column: span 6; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 768px) {
  nav { padding: 16px 24px; }
  .nav-links, .nav-cta { display: none; }
  .nav-menu-btn { display: flex; }
  section { padding: 72px 24px; }
  #hero { padding: 100px 24px 60px; }
  .hero-stats { gap: 32px; }
  .work-card, .work-card:nth-child(n) { grid-column: span 12; }
  .resume-grid { grid-template-columns: 1fr; gap: 36px; }
  .contact-wrap { grid-template-columns: 1fr; gap: 40px; }
  footer { padding: 28px 24px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .form-row { grid-template-columns: 1fr; }
}

/* ===== PROJECT MODAL ===== */
.project-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 24px;
  overflow-y: auto;
}

.project-modal.open { display: flex; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.modal-panel {
  position: relative;
  background: var(--bg);
  border-radius: 16px;
  width: 100%;
  max-width: 840px;
  z-index: 1;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  margin: auto;
}

/* Sticky top bar with back button */
.modal-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
}

.modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}

.modal-close:hover { border-color: #aaa; background: var(--bg-off); }

/* Hero image / video */
.modal-hero {
  width: 100%;
  aspect-ratio: 16/8;
  background: #e8e8e8;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-hero img,
.modal-hero video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.modal-hero-placeholder {
  font-size: 5rem;
  opacity: 0.2;
}

/* Content area */
.modal-content {
  padding: 32px 40px 48px;
}

.modal-tags-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.modal-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  background: var(--bg-off);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 100px;
}

.modal-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.modal-overview {
  font-size: 0.97rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 28px;
  max-width: 620px;
}

/* Meta row (Role / Duration / Tools / Outcome) */
.modal-meta {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}

.modal-meta-item {
  flex: 1 1 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 0;
  padding-right: 24px;
}

.modal-meta-item + .modal-meta-item {
  border-left: 1px solid var(--border);
  padding-left: 24px;
}

.modal-meta-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.modal-meta-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

/* Written sections */
.modal-sections { display: flex; flex-direction: column; gap: 28px; }

.modal-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.modal-section-body {
  font-size: 0.93rem;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-line;
}

/* Image/video gallery */
.modal-gallery {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-gallery img,
.modal-gallery video {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 8px;
  background: #ebebeb;
  display: block;
}

.modal-gallery-label {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Animate modal in */
.modal-panel {
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.project-modal.open .modal-panel {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 768px) {
  .project-modal { padding: 0; align-items: flex-end; }
  .modal-panel { border-radius: 20px 20px 0 0; max-width: 100%; margin: 0; }
  .modal-content { padding: 24px 20px 36px; }
  .modal-meta-item + .modal-meta-item { border-left: none; padding-left: 0; border-top: 1px solid var(--border); }
  .modal-meta-item { padding: 14px 0; flex: 1 1 40%; }
  .modal-gallery { grid-template-columns: 1fr; }
}
