/* Practical work first. Shared finishing layer for the existing portfolio. */
:root {
  color-scheme: dark;
  --bg-main: #0b1020;
  --bg-main-alt: #121a2a;
  --bg-elevated: #121a2a;
  --bg-elevated-hover: #172238;
  --text-main: #f8fafc;
  --text-muted: #b6c2d3;
  --accent: #7c3aed;
  --accent-2: #7dd3fc;
  --content-max: 1120px;
}
body { font-size: 1.0625rem; line-height: 1.65; }
body::before, body::after { animation: none; opacity: .12; }
.grain-overlay, .scanline { display: none; }
a, button, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent-2) !important; outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: 8px; left: 16px; transform: translateY(-150%); z-index: 2000; padding: 12px 18px; border-radius: 8px; background: #121a2a; color: #fff; }
.skip-link:focus { transform: none; }
.container, nav { width: min(1120px, calc(100% - 48px)); }
.container { padding-top: 2.5rem; }
.nav-wrapper { background: rgba(11,16,32,.94); }
nav { min-height: 76px; height: auto; gap: 16px; }
.nav-left { min-height: 44px; flex-shrink: 0; }
.nav-logo { box-shadow: none; }
.nav-title { font-weight: 600; }
.nav-links { gap: 4px; }
.nav-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; }
.nav-links a.active { background: #252345; border-color: #a78bfa; }
.nav-menu-button { display: none; min-width: 72px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--border-subtle); border-radius: 10px; color: var(--text-main); background: #121a2a; }
.btn { min-height: 48px; padding: 12px 22px; line-height: 1.4; border-radius: 12px; background: #7c3aed; color: #fff; box-shadow: none; font-size: 1rem; font-weight: 600; }
.btn:hover { background: #6d28d9; transform: none; box-shadow: none; }
.btn.btn-outline { background: transparent; color: var(--text-main); border: 1px solid var(--border-subtle); }
.btn.btn-outline:hover { background: #172238; }
.hero { min-height: 0; padding: 48px 0 24px; }
.hero .container { padding-top: 0; padding-bottom: 32px; }
.hero-grid { gap: 56px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.hero-heading { font-size: clamp(2.25rem, 3.3vw, 3rem); line-height: 1.12; max-width: 100%; letter-spacing: -.045em; margin: 18px 0 22px; }
.hero-heading span { color: #a78bfa; background: none; -webkit-text-fill-color: currentColor; }
.hero-subtitle { font-size: 1.0625rem; line-height: 1.65; max-width: 52ch; }
.eyebrow { color: var(--accent-2); font-size: .875rem; letter-spacing: .04em; font-weight: 600; margin-bottom: 12px; }
.hero-actions { gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-meta { margin-top: 20px; font-size: .875rem; gap: 8px 20px; }
.profile-card, .card, .section-card, .highlight-card, .project-card, .contact-card, .form-card { background: var(--bg-elevated); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.profile-card { transform: none !important; }
.profile-card:hover, .project-card:hover { transform: none; box-shadow: none; }
.profile-card .profile-inner { align-items: center; }
.profile-photo { width: 104px; height: 104px; flex: 0 0 104px; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-text p { font-size: .9375rem; line-height: 1.6; }
.profile-stat-label { font-size: .75rem; letter-spacing: .02em; }
.profile-stat-value { font-size: .875rem; }
.profile-tag { font-size: .75rem; }
.section-heading-row { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.section-heading-row .section-title { margin: 0; }
.text-link { color: var(--accent-2); text-decoration: underline; text-underline-offset: 4px; display: inline-flex; align-items: center; min-height: 44px; }
.featured-work { padding-bottom: 24px; }
.featured-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.featured-project { display: flex; flex-direction: column; border: 1px solid var(--border-glass-highlight); background: var(--bg-elevated); border-radius: 18px; overflow: hidden; }
.featured-project > a { display: block; }
.featured-project img { aspect-ratio: 16/10; width: 100%; object-fit: cover; object-position: top; }
.featured-project-body { padding: 22px; display: flex; flex: 1; flex-direction: column; }
.featured-project h3 { font-family: 'Space Grotesk',system-ui,sans-serif; font-size: 1.25rem; line-height: 1.3; margin: 4px 0 12px; }
.featured-project p { color: var(--text-muted); font-size: 1rem; line-height: 1.6; }
.featured-project .text-link { margin-top: auto; padding-top: 14px; }
.project-kind { font-size: .8125rem; color: var(--accent-2); }
.contact-invitation { padding: 30px; border: 1px solid var(--border-glass-highlight); border-radius: 18px; background: #121a2a; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.contact-invitation p { color: var(--text-muted); margin-top: 8px; }
.contact-invitation h2 { font-size: 1.5rem; line-height: 1.3; }
.grid.grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.project-filters { flex-wrap: wrap; white-space: normal; overflow: visible; gap: 8px; }
.filter-btn { min-height: 44px; font-size: .875rem; padding: 10px 16px; }
.project-title-row { display: block; }
.project-title { font-size: 1.1875rem; line-height: 1.35; }
.project-meta { display: block; font-size: .8125rem; margin: 8px 0 12px; color: var(--accent-2); }
.project-desc { font-size: 1rem; line-height: 1.6; }
.project-body { padding: 20px; }
.project-thumb { aspect-ratio: 16/10; }
.project-thumb img { object-position: top; }
.project-tag { font-size: .8125rem; padding: 4px 9px; }
.project-cta { display: inline-flex; align-items: center; min-height: 44px; font-size: .9375rem; text-decoration: underline; text-underline-offset: 4px; }
.featured-badge { color: #d8c9ff; font-size: .8125rem; font-weight: 600; margin-bottom: 12px; }
.project-results { color: var(--text-muted); font-size: .875rem; margin: 10px 0 0; line-height: 1.5; }
.project-count { color: var(--text-muted); font-size: .875rem; margin-bottom: 18px; }
.case-study { max-width: 960px; }
.case-study h1 { font-family: 'Space Grotesk',system-ui,sans-serif; font-size: clamp(2rem,4vw,3.25rem); line-height: 1.15; margin: 16px 0; letter-spacing: -.025em; }
.case-intro { font-size: 1.125rem; color: var(--text-muted); max-width: 64ch; }
.case-screenshot { margin: 32px 0; border: 1px solid var(--border-glass-highlight); border-radius: 16px; overflow: hidden; background: #121a2a; }
.case-screenshot img { width: 100%; max-height: 560px; object-fit: contain; }
.case-screenshot figcaption { padding: 14px 20px; font-size: .875rem; color: var(--text-muted); }
.case-sections { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; margin: 32px 0; }
.case-sections h2 { font-size: 1.25rem; margin-bottom: 12px; }
.case-sections p { font-size: 1rem; color: var(--text-muted); }
.about-grid .section-subtitle { font-size: 1.0625rem; }
.about-grid h1.section-title { font-size: 2rem; }
.contact-layout { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); }
.form-field input, .form-field textarea { font-size: 1rem; min-height: 48px; background: #0b1020; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #a1afc2; opacity: 1; }
.form-help { color: var(--text-muted); font-size: .875rem; margin-top: 14px; }
.contact-list a { color: var(--accent-2); text-decoration: underline; overflow-wrap: anywhere; }
.form-status { color: var(--text-muted); margin-top: 16px; }
footer { margin-top: 24px; }
.footer-inner { padding-bottom: 88px; font-size: .875rem; gap: 20px; }
#chatbot-toggle { box-shadow: none; background: #7c3aed; }
#chatbot-container { width: 380px; height: min(560px,calc(100dvh - 120px)); max-width: calc(100% - 40px); background: #121a2a; box-shadow: 0 20px 60px #0006; border-color: #6c7890; }
#chatbot-container.is-open { display: flex; }
#chatbot-header { display: flex; justify-content: space-between; align-items: center; background: #252345; padding: 10px 16px; gap: 8px; }
#chatbot-header h2 { font-size: 1rem; margin: 0; line-height: 1.4; }
#chatbot-close { flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: #fff; font-size: 1.5rem; }
#chatbot-messages { background: #121a2a; padding: 16px; font-size: .9375rem; }
.chat-intro { color: var(--text-muted); font-size: .9375rem; line-height: 1.6; margin-bottom: 16px; }
.chat-suggestions { display: grid; gap: 8px; margin-bottom: 18px; }
.chat-suggestions button { text-align: left; min-height: 44px; padding: 10px 12px; font-size: .875rem; color: var(--text-main); background: #172238; border: 1px solid var(--border-subtle); border-radius: 10px; }
.message { line-height: 1.6; white-space: pre-wrap; max-width: 96%; padding: 12px; margin-bottom: 12px; }
.message.user { background: #47238a; color: #fff; }
.message.bot { background: #172238; color: #f8fafc; }
.message a { color: var(--accent-2); text-decoration: underline; display: block; margin-top: 8px; }
#chatbot-input input { min-width: 0; min-height: 48px; font-size: 1rem; }
#chatbot-input button { flex: 0 0 52px; min-width: 52px; min-height: 48px; }
#send-btn:disabled { opacity: .6; cursor: wait; }
.chat-footer { padding: 8px 16px; font-size: .75rem; color: var(--text-muted); border-top: 1px solid var(--border-subtle); }
.telemetry-note { color: var(--text-muted); font-size: .9375rem; max-width: 76ch; margin-top: 18px; }
.telemetry-status { color: var(--text-muted); font-size: .875rem; margin: 16px 0 24px; }
.cyber-tag, .cyber-heading { text-transform: none; letter-spacing: .02em; }
.glitch-title::before, .glitch-title::after { display: none; }
.hero-heading.cyber-heading { max-width: none; font-size: clamp(2rem,4vw,3rem); }
.ip-modal-close { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: #fff; }
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0,1fr); gap: 32px; }
  .profile-card { max-width: 580px; }
  .featured-grid, .grid.grid-3 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .case-sections { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 860px) {
  nav { flex-direction: row; flex-wrap: wrap; min-height: 68px; padding: 10px 0; align-items: center; }
  .nav-left { width: auto; margin: 0; }
  .nav-menu-button { display: inline-flex; justify-content: center; align-items: center; margin-left: auto; }
  .nav-links { display: none; width: 100%; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; padding: 8px 0; }
  .nav-links.is-open { display: grid; }
  .nav-links li { flex: none; width: auto; }
  .nav-links a { width: 100%; min-height: 48px; font-size: 1rem; border-radius: 10px; }
  .contact-layout { grid-template-columns: minmax(0,1fr); }
  .hero-grid[style] { grid-template-columns: minmax(0,1fr) !important; }
}
@media (max-width: 640px) {
  .container, nav { width: calc(100% - 40px); }
  .container { padding-top: 28px; padding-bottom: 28px; }
  .hero { padding-top: 32px; }
  .hero-heading { font-size: clamp(2.25rem,9.5vw,3rem); }
  .hero-actions { flex-direction: row; }
  .hero-actions .btn { width: auto; flex: 1 1 140px; }
  .hero-meta { flex-direction: column; align-items: flex-start; }
  .featured-grid, .grid.grid-3 { grid-template-columns: minmax(0,1fr); }
  .section-heading-row { display: block; }
  .section-heading-row .text-link { margin-top: 6px; }
  .contact-invitation { padding: 24px; align-items: flex-start; flex-direction: column; }
  .profile-card { padding: 24px; }
  .profile-inner { flex-wrap: wrap; }
  .profile-text { min-width: 0; }
  .profile-stats { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .section-card { padding: 20px; }
  .form-card, .contact-card { padding: 22px; }
  .form-row { grid-template-columns: minmax(0,1fr); }
  #chatbot-container { right: 12px; max-width: calc(100% - 24px); width: calc(100% - 24px); bottom: 80px; height: min(560px,calc(100dvh - 108px)); }
  .highlights-grid { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .animate-fade-up, [data-reveal] { opacity: 1 !important; transform: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav-wrapper { background: #0b1020; backdrop-filter: none; -webkit-backdrop-filter: none; }
  body::before, body::after { display: none; }
}
@media (prefers-contrast: more) {
  :root { --text-muted: #f8fafc; --border-glass-highlight: #a1afc2; --border-subtle: #a1afc2; }
}
