/* ===== Lucca Venegas — Engineering Portfolio ===== */
/* Light, minimal theme */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --ink: #111111;
  --ink-2: #444444;
  --ink-3: #777777;
  --line: #e6e6e3;
  --accent: #111111;
  --accent-ink: #ffffff;
  --accent-soft: #f1f1ef;
  --radius: 8px;
  --shadow: none;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1080px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }
.label {
  font-size: 13px; font-weight: 500; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-3);
}
.label .n { display: none; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo {
  font-family: var(--sans); font-weight: 700; text-decoration: none;
  display: flex; align-items: center; gap: 10px; font-size: 15px;
}
.logo-mark {
  width: 30px; height: 30px; border: 2px solid var(--ink); border-radius: 6px;
  display: grid; place-items: center; font-size: 12px;
}
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a { text-decoration: none; font-size: 14px; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 600;
  text-decoration: none; border: 1px solid var(--line); background: var(--surface);
  transition: transform .15s, border-color .15s;
}
.btn:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.nav .btn { padding: 7px 13px; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(40px, 6vw, 64px); margin: 14px 0 18px; }
.hero h1 .accent { color: var(--accent); }
.lede { font-size: 19px; color: var(--ink-2); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-media { position: relative; }
.hero-media .frame {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow); background: var(--surface); aspect-ratio: 4/5;
}
.hero-media video, .hero-media img { width: 100%; height: 100%; object-fit: cover; }
.callout {
  position: absolute; left: -18px; bottom: 26px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px; box-shadow: var(--shadow); font-family: var(--mono); font-size: 12px;
}
.callout b { color: var(--accent); }
.subtitle { font-size: 16px; color: var(--ink-2); font-weight: 500; margin: -6px 0 18px; }
.lede.small { font-size: 16px; color: var(--ink-3); }
.hero-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ph { margin: 0; position: relative; overflow: hidden; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); aspect-ratio: 1 / 1; }
.ph img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.ph-main { grid-column: 1 / -1; aspect-ratio: 4 / 5; }
.ph-main img { object-position: 50% 55%; }
.ph-kyoto img { object-position: 50% 15%; }
.ph-lax img { object-position: 50% 30%; }
.stats.facts .v { font-size: 17px; font-weight: 600; letter-spacing: 0; }
.stats.facts .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
@media (max-width: 640px) {
  .ph figcaption { font-size: 10px; left: 6px; bottom: 6px; }
}
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 56px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.stat { padding: 18px 20px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.stat .k { font-size: 13px; color: var(--ink-3); }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(28px, 4vw, 38px); margin-top: 6px; }

/* Featured project */
.featured {
  display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none;
  transition: transform .2s, border-color .2s;
}
.featured:hover { border-color: var(--ink-3); }
.featured-media { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); min-height: 380px; }
.featured-media img { width: 100%; height: 100%; object-fit: cover; }
.featured-body { padding: 34px; display: flex; flex-direction: column; }
.featured-body h3 { font-size: 30px; margin: 10px 0 12px; }
.featured-body p { color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 20px; padding: 0; list-style: none; }
.tags li {
  font-size: 13px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.more { margin-top: auto; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* Project cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.card h3 { font-size: 20px; margin: 8px 0 4px; }
.card .org { font-size: 14px; color: var(--ink-3); margin-bottom: 14px; }
.card ul.points { margin: 0 0 16px; padding-left: 18px; color: var(--ink-2); font-size: 15px; }
.card ul.points li { margin-bottom: 6px; }
.spec {
  margin-top: auto; border-top: 1px dashed var(--line); padding-top: 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
}
.spec div { font-size: 12px; color: var(--ink-3); }
.spec b { display: block; font-size: 15px; color: var(--ink); font-weight: 600; }

/* Experience timeline */
.timeline { border-left: 2px solid var(--line); margin-left: 6px; }
.t-item { position: relative; padding: 0 0 30px 28px; }
.t-item::before {
  content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
}
.t-item .when { font-size: 13px; color: var(--ink-3); }
.t-item h3 { font-size: 19px; margin: 2px 0; }
.t-item .role { color: var(--ink-2); font-size: 15px; margin-bottom: 6px; }
.t-item p { color: var(--ink-2); font-size: 15px; max-width: 46em; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.skill-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.skill-group h3 { font-size: 15px; margin: 6px 0 12px; }
.skill-group .tags { margin: 0; }

/* Contact */
.contact {
  background: var(--surface-2); color: var(--ink); border-radius: 12px; padding: 48px;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center;
}
.contact h2 { font-size: clamp(28px, 4vw, 36px); }
.contact p { color: var(--ink-2); margin-top: 12px; }
.contact-links { display: grid; gap: 10px; }
.contact-links a {
  display: flex; justify-content: space-between; align-items: center; text-decoration: none;
  padding: 14px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  font-size: 15px;
}
.contact-links a:hover { border-color: var(--ink); }
.contact-links span { font-size: 13px; color: var(--ink-3); }

footer { padding: 32px 0 48px; color: var(--ink-3); font-size: 13px; }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Project page ---------- */
.crumb { font-size: 13px; color: var(--ink-3); text-decoration: none; }
.crumb:hover { color: var(--ink); }
.p-hero { padding: 48px 0 24px; }
.p-hero h1 { font-size: clamp(36px, 6vw, 58px); margin: 14px 0 16px; }
.spec-table {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 32px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden;
}
.spec-table > div { padding: 16px 18px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); margin: -1px 0 0 -1px; }
.spec-table .k { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.spec-table .v { font-weight: 600; font-size: 16px; }

.prose { max-width: 720px; }
.prose h2 { font-size: 28px; margin: 6px 0 16px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--ink); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.figure { margin: 0; }
.figure .media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.figure video, .figure img { width: 100%; }
.figure figcaption { font-size: 14px; color: var(--ink-3); margin-top: 8px; }
.figure figcaption b { color: var(--ink); font-weight: 600; }
.media-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.media-row.wide { grid-template-columns: 1.4fr 1fr; }
.tall video, .tall img { aspect-ratio: 9/14; object-fit: cover; }
.two-col .figure:not(.tall) img { aspect-ratio: 4/5; object-fit: cover; object-position: center 70%; }

.log { position: relative; margin-top: 8px; }
.log::before { content: ""; position: absolute; left: 92px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.log-entry { display: grid; grid-template-columns: 92px 1fr; gap: 28px; padding-bottom: 28px; position: relative; }
.log-entry .date { font-size: 13px; color: var(--ink-3); padding-top: 18px; text-align: right; padding-right: 14px; }
.log-entry::after {
  content: ""; position: absolute; left: 87px; top: 22px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.log-entry.issue::after { background: var(--accent); }
.log-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-left: 14px; }
.log-card h3 { font-size: 18px; margin-bottom: 6px; }
.log-card p { color: var(--ink-2); font-size: 15px; margin-bottom: 8px; }
.log-card a { font-size: 13px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.showcase video { width: 100%; max-height: 640px; object-fit: contain; background: #000; }
.next-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important; }
.p-hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: end; }
.p-hero-grid > * { min-width: 0; }
.p-hero-img img { aspect-ratio: 4/5; object-fit: cover; object-position: center 30%; }
.log-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0 10px; }
.log-media img, .log-media video {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface-2);
}
.log-media a { display: block; transition: opacity .15s; }
.log-media a:hover { opacity: .85; }
.log-media video { grid-column: span 2; aspect-ratio: auto; max-height: 420px; object-fit: contain; background: #000; }
@media (max-width: 640px) { .log-media { grid-template-columns: 1fr 1fr; } .log-media video { grid-column: 1 / -1; } }
.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 8px; vertical-align: 2px; }

.arch {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); margin-top: 8px;
}
.arch .host { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.arch .box { border: 1px solid var(--line); background: var(--surface-2); border-radius: 6px; padding: 8px 10px; line-height: 1.4; }
.arch .box b { display: block; color: var(--ink); font-size: 13px; }
.arch .wire { color: var(--accent); }
.arch .bus { position: relative; margin: 18px 0 0; padding-top: 18px; }
.arch .bus::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 2px; background: var(--accent); }
.arch .bus-label { position: absolute; top: -22px; right: 0; color: var(--accent); }
.arch .nodes { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.arch .nodes .box { position: relative; }
.arch .nodes .box::before { content: ""; position: absolute; top: -19px; left: 50%; width: 2px; height: 18px; background: var(--accent); }
.arch .nodes .box.grip { border-style: dashed; }
.arch .note { margin-top: 14px; color: var(--ink-3); }
@media (max-width: 760px) {
  .arch .nodes { grid-template-columns: repeat(4, 1fr); } .arch .nodes .box::before { display: none; }
  .arch .bus { margin-top: 14px; padding-top: 12px; }
  .arch .bus-label { position: static; display: block; margin-bottom: 10px; }
}
@media (max-width: 420px) { .arch .nodes { grid-template-columns: repeat(2, 1fr); } }
.hero-grid > *, .two-col > *, .featured > *, .contact > * { min-width: 0; }
.next-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.next-grid .card p { color: var(--ink-2); font-size: 15px; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .featured, .contact, .two-col, .media-row.wide, .p-hero-grid { grid-template-columns: 1fr; }
  .p-hero-img { max-width: 420px; }
  .hero-media { max-width: 440px; }
  .cards, .next-grid { grid-template-columns: 1fr 1fr; }
  .skills { grid-template-columns: 1fr 1fr; }
  .spec-table { grid-template-columns: 1fr 1fr; }
  .featured-media { min-height: 280px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .nav-links a:not(.btn) { display: none; }
  .hero { padding: 40px 0 32px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cards, .skills, .next-grid, .media-row { grid-template-columns: 1fr; }
  .featured-body, .contact { padding: 24px; }
  section { padding: 44px 0; }
  .callout { left: 10px; }
  .log::before { left: 6px; }
  .log-entry { grid-template-columns: 1fr; gap: 6px; padding-left: 26px; }
  .log-entry::after { left: 1px; top: 4px; }
  .log-entry .date { text-align: left; padding: 0; }
  .log-card { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Experience blocks ---------- */
.xp { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 36px 0; border-top: 1px solid var(--line); }
.xp:first-of-type { border-top: 0; padding-top: 8px; }
.xp > * { min-width: 0; }
.xp .when { font-size: 14px; color: var(--ink-3); }
.xp h3 { font-size: 22px; margin: 4px 0 2px; }
.xp .role { color: var(--ink-2); font-weight: 500; margin-bottom: 12px; }
.xp p { color: var(--ink-2); }
.xp ul.points { margin: 0 0 18px; padding-left: 18px; color: var(--ink-2); font-size: 16px; }
.xp ul.points li { margin-bottom: 6px; }
.xp .spec { margin-top: 0; max-width: 360px; }
.xp-media { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.xp-media .span2 { grid-column: 1 / -1; }
.xp-media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.xp-media .span2 img { aspect-ratio: 16/9; }
.xp-media figcaption { font-size: 13px; }
.xp:only-child, .xp:not(:has(.xp-media)) { grid-template-columns: 1fr; }
.xp:not(:has(.xp-media)) .xp-text { max-width: 720px; }
@media (max-width: 900px) { .xp { grid-template-columns: 1fr; gap: 20px; } }
.media-row.three { grid-template-columns: repeat(3, 1fr); }
.media-row.three img, .media-row.three video { aspect-ratio: 4/3; object-fit: cover; width: 100%; background: #000; }
@media (max-width: 760px) { .media-row.three { grid-template-columns: 1fr; } }
.two-col .figure:not(.tall) video { max-height: 560px; object-fit: cover; }
.featured-body .card-spec { margin: 0 0 18px; padding-top: 14px; grid-template-columns: repeat(4, auto); justify-content: start; gap: 10px 28px; }
@media (max-width: 640px) { .featured-body .card-spec { grid-template-columns: 1fr 1fr; } }
.fm-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 2px; min-height: 0; }
.fm-stack img { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.intro p { font-size: 17px; line-height: 1.7; color: var(--ink-2); margin: 0 0 14px; max-width: 36em; }
.intro p:first-child { font-size: 19px; color: var(--ink); }

/* ---------- Home interactive demo ---------- */
.demo-section { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.demo-grid { display: grid; grid-template-columns: 0.8fr 1.4fr; gap: 32px; align-items: center; }
.demo-grid > * { min-width: 0; }
.demo-text p { color: var(--ink-2); }
.demo-text .muted { color: var(--ink-3); font-size: 15px; }
.demo-text .spec { margin: 18px 0 22px; }
.scene-box { border-radius: 12px; border: 1px solid var(--line); overflow: hidden; background: #f4f4f2; position: relative; }
#homeScene { width: 100%; aspect-ratio: 16/11; display: block; cursor: grab; }
@media (max-width: 900px) { .demo-grid { grid-template-columns: 1fr; } #homeScene { aspect-ratio: 4/4.2; } }

/* ---------- Arctos "why" callout ---------- */
.why-section { padding: 16px 0 40px; }
.why { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: start; background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: 12px; padding: 36px; }
.why > * { min-width: 0; }
.why h2 { font-size: clamp(26px, 3.4vw, 34px); margin: 6px 0 14px; }
.why h3 { font-size: 18px; margin: 22px 0 8px; }
.why p, .why li { color: var(--ink-2); }
.why ul { padding-left: 20px; margin: 0; }
.why li { margin-bottom: 8px; }
.why strong { color: var(--ink); }
.why .figure img { aspect-ratio: 1 / 1; object-fit: cover; }
.p-hero .lede strong { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) { .why { grid-template-columns: 1fr; padding: 24px; gap: 24px; } }
.motion-section { padding: 8px 0 40px; }
.motion-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.motion-row video { width: 100%; aspect-ratio: 4/5; object-fit: cover; background: #000; }
@media (max-width: 760px) { .motion-row { grid-template-columns: 1fr 1fr; } .motion-row figure:last-child { grid-column: 1 / -1; } .motion-row figure:last-child video { aspect-ratio: 16/10; } }
.featured-media video { width: 100%; height: 100%; object-fit: cover; background: #e9e8e4; }
.cad-section { padding: 8px 0 48px; }
.cad-intro { color: var(--ink-2); max-width: 44em; }
.cad-box { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #f4f4f2; }
#arctosCad { width: 100%; aspect-ratio: 16/9; display: block; }
@media (max-width: 640px) { #arctosCad { aspect-ratio: 4/5; } }
.dt-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.dt { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.dt th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); padding: 10px 12px; }
.dt td { padding: 10px 12px; border-top: 1px solid var(--line); color: var(--ink-2); }
.dt td:first-child { font-weight: 700; color: var(--ink); }
.dt td:nth-child(4), .dt td:last-child { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.spec-table { grid-template-columns: repeat(4, 1fr); }
.featured-media { grid-template-columns: 1fr; }
.featured-media video { object-position: 50% 40%; }
