:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-2: #eef2ef;
  --text: #16201d;
  --muted: #596863;
  --line: #dce3de;
  --brand: #0f766e;
  --brand-2: #b45309;
  --brand-3: #334155;
  --focus: #0f766e;
  --shadow: 0 18px 55px rgba(22, 32, 29, 0.11);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(180, 83, 9, 0.05) 1px, transparent 1px),
    var(--bg);
  background-size: 52px 52px;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0;
}

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), white 30%);
  outline-offset: 3px;
}

.site-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 10px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(22, 32, 29, 0.08);
}

.brand-mark svg { width: 24px; height: 24px; }
.brand-name { display: block; font-weight: 750; line-height: 1.1; }
.brand-domain { display: block; color: var(--muted); font-size: 0.9rem; line-height: 1.35; }

.lang-control { position: relative; flex: 0 0 auto; }
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: none;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lang-control.is-open .lang-menu { display: grid; gap: 4px; }
.lang-option {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}
.lang-option:hover { background: var(--surface-2); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  min-height: calc(100dvh - 80px);
  padding: 26px 0 56px;
}

.main-compact {
  min-height: calc(100dvh - 80px);
  padding-bottom: 32px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.65;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  gap: 9px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.command.primary { background: var(--text); color: white; border-color: var(--text); }
.command:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(22, 32, 29, 0.12); }

.visual {
  position: relative;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 20%, rgba(15, 118, 110, 0.2), transparent 26%),
    linear-gradient(135deg, #ffffff, #e9efeb 55%, #d7e2dc);
  box-shadow: var(--shadow);
}

.visual::before {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(22, 32, 29, 0.16);
  border-radius: 6px;
}

.visual.profile-visual {
  display: grid;
  min-height: auto;
  aspect-ratio: 16 / 9;
  background: var(--surface);
}

.visual.profile-visual::before { display: none; }

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.instrument {
  position: absolute;
  border: 1px solid rgba(22, 32, 29, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 48px rgba(22, 32, 29, 0.12);
  backdrop-filter: blur(10px);
}
.instrument.one { left: 44px; top: 54px; width: 220px; height: 132px; }
.instrument.two { right: 42px; top: 150px; width: 190px; height: 210px; }
.instrument.three { left: 94px; bottom: 52px; width: 240px; height: 86px; }
.instrument::after {
  content: "";
  display: block;
  width: 62%;
  height: 2px;
  margin: 28px 18px;
  background: var(--brand);
  box-shadow: 0 18px 0 var(--brand-2), 0 36px 0 var(--brand-3);
}

.directory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.tile, .panel, .project-card, .skill-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface), transparent 3%);
}

.tile {
  display: grid;
  min-height: 168px;
  padding: 20px;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile small { color: var(--brand); font-weight: 750; text-transform: uppercase; }
.tile strong { margin-top: 14px; font-size: 1.3rem; }
.tile span { margin-top: 10px; color: var(--muted); line-height: 1.55; }

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 34px;
}
.tab-button {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}
.tab-button[aria-selected="true"] { color: white; background: var(--brand-3); border-color: var(--brand-3); }

.content-area { padding: 24px 0 64px; }
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.panel { padding: 22px; }
.panel h2, .panel h3 { margin: 0 0 12px; }
.panel p, .panel li { color: var(--muted); line-height: 1.65; }

.image-panel {
  position: relative;
  min-height: 260px;
  padding: clamp(20px, 4vw, 30px);
  overflow: hidden;
  isolation: isolate;
  color: white;
  background-color: #111816;
  background-image:
    linear-gradient(90deg, rgba(8, 12, 11, 0.88), rgba(8, 12, 11, 0.58)),
    var(--panel-image);
  background-size: auto, 112%;
  background-position: center, center calc(50% + var(--panel-shift, 0px));
  box-shadow: 0 18px 42px rgba(22, 32, 29, 0.16);
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition:
    opacity 420ms ease,
    transform 420ms ease,
    box-shadow 220ms ease,
    background-position 120ms linear,
    background-size 380ms ease;
}

.image-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.32), transparent 48%);
}

.image-panel.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.image-panel:hover {
  box-shadow: 0 24px 58px rgba(22, 32, 29, 0.25);
  background-size: auto, 116%;
}

.image-panel h2,
.image-panel h3,
.image-panel p,
.image-panel li {
  position: relative;
  color: white;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.72);
}

.image-panel p,
.image-panel li {
  color: rgba(255, 255, 255, 0.88);
}
.project-grid, .skills-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.project-card { padding: 18px; }
.project-card a { color: var(--brand); font-weight: 750; }
.skill-chip { padding: 13px 14px; color: var(--muted); }

.contact-list { display: grid; gap: 10px; padding: 0; list-style: none; }
.contact-list a { color: var(--brand); font-weight: 750; }

.footer {
  padding: 24px 0 36px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .image-panel {
    opacity: 1;
    transform: none;
    background-position: center, center;
  }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .visual { min-height: 320px; }
  .directory, .content-grid, .project-grid, .skills-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
}

@media (max-width: 460px) {
  .site-shell { width: min(100% - 22px, 1120px); }
  .brand-domain { display: none; }
  h1 { font-size: 2.2rem; line-height: 1.04; }
  .visual { min-height: 260px; }
  .instrument.one { left: 24px; top: 42px; width: 180px; }
  .instrument.two { right: 20px; top: 132px; width: 150px; height: 150px; }
  .instrument.three { left: 36px; bottom: 34px; width: 190px; }
}
