:root {
  --bg: #0b0d10;
  --card: #14181d;
  --text: #e9eef5;
  --muted: #a3b1c6;
  --accent: #66d9ef;
  --btn: #0f1216;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 70% 0%, #10151b, var(--bg));
}

.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(11,13,16,0.9), rgba(11,13,16,0.7), rgba(11,13,16,0));
  backdrop-filter: saturate(120%) blur(8px);
}
.brand { font-weight: 700; letter-spacing: 0.5px; }
.site-nav { display: flex; align-items: center; gap: 12px; }
.site-nav .nav-links { display: flex; gap: 16px; align-items: center; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); }
.lang-switch { margin-left: 8px; display: inline-flex; gap: 4px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,0.06); }
.lang-switch button {
  appearance: none; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.03);
  color: var(--muted); padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 12px;
}
.lang-switch button:hover { color: var(--text); border-color: rgba(255,255,255,0.28); }
.lang-switch button.active { color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 1px rgba(102,217,239,0.2) inset; }

/* Hamburger */
.hamburger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }

@media (max-width: 820px), (orientation: portrait) {
  .hamburger { display: block; }
  .site-nav { position: absolute; top: 56px; left: 0; right: 0; padding: 10px 16px; display: grid; grid-template-columns: 1fr; gap: 12px; background: rgba(11,13,16,0.9); border-bottom: 1px solid rgba(255,255,255,0.06); transform-origin: top; transform: scaleY(0); opacity: 0; pointer-events: none; transition: transform .18s ease, opacity .18s ease; }
  .site-header.open .site-nav { transform: scaleY(1); opacity: 1; pointer-events: auto; }
  .site-nav .nav-links { display: grid; gap: 10px; }
}

.section { padding: 80px 20px; }
.section-narrow { max-width: 980px; margin: 0 auto; }
.section-lead { margin-top: 6px; color: var(--muted); }

.hero {
  position: relative; height: 88vh; display: grid; place-items: center; overflow: hidden;
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-content { position: relative; text-align: center; z-index: 1; }
.hero h1 { font-size: clamp(28px, 6vw, 56px); margin: 0 0 8px; }
.hero p { margin: 0; color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); background: var(--btn); color: var(--text); text-decoration: none; font-size: 14px; }
.btn:hover { border-color: rgba(255,255,255,0.25); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-primary { background: linear-gradient(180deg, #1a90a1, #137284); border-color: rgba(102,217,239,0.45); }
.btn-primary:hover { box-shadow: 0 6px 24px rgba(102,217,239,0.25); }

.services-list { list-style: none; padding: 0; margin: 0; }
.services-list { display: none; }

/* Panel system (Services, Projects, Contact) */
.panels { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
@media (min-width: 720px) { .panels { grid-template-columns: repeat(2, 1fr); } }
.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.00));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 18px;
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  /* Circular hover glow that follows cursor */
  background:
    radial-gradient(circle 140px at var(--mx, 50%) var(--my, 0%), rgba(120,220,255,0.14), rgba(102,217,239,0) 65%),
    radial-gradient(circle 80px at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,0.10), rgba(255,255,255,0) 70%);
  /* Always present; JS sets --glow-boost based on cursor distance */
  opacity: calc(var(--glow-base, 0) + var(--glow-boost, 0));
  transition: opacity 180ms ease;
}
.panel:hover::before { opacity: calc(var(--glow-base, 0) + var(--glow-boost, 0)); }
.panel::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none; padding: 1.2px; border-radius: 14px;
  /* Strong metallic border shimmer, strictly in the border ring */
  background:
    /* Tight bright specular highlight following cursor */
    conic-gradient(from 0deg at var(--mx, 50%) var(--my, 0%),
      rgba(255,255,255,0.00) 0deg,
      rgba(250,252,255,0.90) 6deg,
      rgba(190,205,220,0.55) 12deg,
      rgba(90,100,110,0.25) 18deg,
      rgba(30,34,38,0.00) 26deg,
      rgba(255,255,255,0.00) 360deg
    ),
    /* Cyan-tinted glow near cursor to suggest anodized metal */
    radial-gradient(circle 120px at var(--mx, 50%) var(--my, 0%), rgba(102,217,239,0.75), rgba(102,217,239,0) 70%),
    /* Subtle warm-cool sweep to mimic metal anisotropy */
    linear-gradient(135deg, rgba(255,255,255,0.18), rgba(120,130,140,0.10) 40%, rgba(20,24,30,0.06) 60%, rgba(255,255,255,0.12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  /* Base sheen + JS-boosted intensity (always on) */
  opacity: calc(var(--o-base, 0.22) + var(--o-boost, 0));
  transition: opacity 160ms ease;
  will-change: opacity, background-position;
}
.panel:hover::after { opacity: calc(var(--o-base, 0.22) + var(--o-boost, 0)); }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: var(--text); }
.panel-head h3 { margin: 0; font-size: 18px; }
.panel p { margin: 6px 0 10px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.tags li { border: 1px solid rgba(255,255,255,0.10); color: var(--muted); padding: 6px 10px; border-radius: 999px; font-size: 12px; }

/* Cursor-reactive highlight */
.panel { --mx: 50%; --my: 0%; }

/* Painterly ambiance over hero */
.hero::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(1200px 800px at 70% 0%, rgba(24,30,38,0.35), rgba(11,13,16,0) 70%),
    /* stronger canvas/grain + brush strokes */
    repeating-conic-gradient(from 0deg at 40% 40%, rgba(255,255,255,0.028) 0 8deg, rgba(0,0,0,0.028) 8deg 16deg),
    repeating-linear-gradient(18deg, rgba(255,255,255,0.03) 0 5px, rgba(0,0,0,0.03) 5px 10px),
    radial-gradient(800px 600px at 30% 60%, rgba(20,24,30,0.25), rgba(0,0,0,0) 70%),
    radial-gradient(600px 500px at 70% 40%, rgba(16,20,26,0.22), rgba(0,0,0,0) 70%);
  mix-blend-mode: soft-light;
  opacity: 0.9;
}
.hero-content { z-index: 2; }

/* Contact icons */
.contact-icons { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--text); text-decoration: none; position: relative; }
.icon-btn::before {
  content: ""; position: absolute; inset: 0; border-radius: 10px; padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.03));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.7;
}
.icon-btn:hover::before { opacity: 1; }
.icon-btn svg { width: 20px; height: 20px; opacity: 0.9; }
.icon-btn:hover svg { opacity: 1; filter: drop-shadow(0 0 12px rgba(102,217,239,0.35)); }

/* Projects */
.panels-projects { grid-template-columns: 1fr; }
@media (min-width: 960px) { .panels-projects { grid-template-columns: repeat(3, 1fr); } }
.project-card { display: grid; grid-template-rows: auto 1fr; padding: 0; }
.project-card .thumb { aspect-ratio: 16/9; background: radial-gradient(800px 300px at 30% 20%, rgba(102,217,239,0.18), rgba(255,255,255,0) 60%), linear-gradient(180deg, #141a21, #0f1318); border-bottom: 1px solid rgba(255,255,255,0.06); display: grid; place-items: center; }
.project-card .thumb img { border-radius: 8px; max-width: 56%; max-height: 70%; width: auto; height: auto; object-fit: contain; display: block; filter: drop-shadow(0 4px 18px rgba(0,0,0,0.35)); }
.project-body { padding: 16px; display: grid; gap: 10px; }
.project-body h3 { margin: 0; font-size: 18px; }
.project-body p { margin: 0; color: var(--muted); }
.project-card .actions { margin-top: 4px; }
.project-card [aria-disabled="true"] { opacity: 0.6; cursor: default; }
/* make card feel interactive (modal opens on card click) */
.project-card { cursor: pointer; }
.project-card a { cursor: pointer; }
.project-card:focus { outline: 2px solid rgba(102,217,239,0.6); outline-offset: 2px; }

/* Contact */
.panels-contact { grid-template-columns: 1fr; }
@media (min-width: 720px) { .panels-contact { grid-template-columns: 1fr; } }
.panel-contact .contact { display: grid; gap: 14px; }
.contact-main { display: flex; align-items: center; gap: 12px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); }
.muted { color: var(--muted); }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.contact-list a { color: var(--text); text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

.contact-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .contact-grid { grid-template-columns: 1.3fr 0.7fr; } }
.contact-photo img { width: 140px; height: 140px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); object-fit: cover; }

.site-footer { text-align: center; padding: 32px 10px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,1px,1px); white-space: nowrap; border: 0; }

/* End */

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8,10,12,0.65); backdrop-filter: blur(6px) saturate(120%); }
.modal-dialog {
  position: relative; margin: 48px auto; max-width: 980px; width: calc(100% - 32px);
  background: rgba(18,22,28,0.92);
  border: 1px solid rgba(255,255,255,0.10); border-radius: 16px; overflow: hidden;
  display: grid; grid-template-columns: minmax(300px, 40%) 1fr;
  box-shadow: 0 14px 60px rgba(0,0,0,0.45);
}
.modal-media { background: radial-gradient(800px 300px at 30% 20%, rgba(102,217,239,0.14), rgba(255,255,255,0) 60%), linear-gradient(180deg, #12171e, #0f1318); min-height: 260px; }
.modal-content { padding: 20px; display: grid; gap: 12px; align-content: start; }
.modal-content h3 { margin: 0; font-size: 22px; }
.modal-actions { margin-top: 4px; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.18); background: rgba(0,0,0,0.25); color: var(--text); cursor: pointer; font-size: 20px; line-height: 1; }
.modal-close:hover { border-color: rgba(255,255,255,0.32); }

/* Portrait/Small-screen: full-screen sheet layout */
@media (max-width: 820px), (orientation: portrait) {
  .modal-dialog { margin: 0; width: 100%; height: 100%; border-radius: 0; grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .modal-media { min-height: 38vh; }
  .modal-content { padding: 18px; }
  .modal-close { top: 12px; right: 12px; width: 40px; height: 40px; font-size: 24px; }
}

/* Carousel */
.carousel { position: relative; height: 100%; }
.carousel-track { height: 100%; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: grid; place-items: center; background: linear-gradient(180deg, #151a21, #0e1217); }
.carousel-slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25); background: rgba(0,0,0,0.35); color: var(--text); cursor: pointer; }
.carousel-btn:hover { border-color: rgba(255,255,255,0.45); }
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 6px; }
.carousel-dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.35); padding: 0; cursor: pointer; }
.carousel-dots button.active { background: var(--accent); }
