*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Disable highlighting/selection globally for app-like feel */
*, *::before, *::after {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Allow selection where users need to type/edit */
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* Make accidental selections invisible */
::selection {
  background: transparent;
}

::-moz-selection {
  background: transparent;
}

/* Responsive type scale */
:root {
  font-size: 16px;
}

@media (max-width: 900px) {
  :root { font-size: 17px; }
}

@media (max-width: 700px) {
  :root { font-size: 18px; }
}

/* ── DARK MODE (default) ─────────────────────────────────────── */
:root {
  --bg:            #1a1625;
  --bg2:           #241d35;
  --bg3:           #2e2548;
  --nav-bg:        #1f1830;
  --sidebar-bg:    #1d1630;
  --addr-bg:       #17112a;
  --btn-bg:        #332850;
  --text:          #ede8f5;
  --muted:         rgba(210,200,235,0.6);
  --border:        rgba(210,200,235,0.12);
  --accent:        #9b7fbd;
  --accent-dim:    rgba(155,127,189,0.15);
  --accent-border: rgba(155,127,189,0.4);
  --font-term:     'Share Tech Mono', monospace;
  --font-crt:      'VT323', monospace;
}

/* ── LIGHT MODE ───────────────────────────────────────────────── */
:root.light {
  --bg:            #f0ecf8;
  --bg2:           #e6dff5;
  --bg3:           #dbd2ef;
  --nav-bg:        #ede5fa;
  --sidebar-bg:    #e8e0f5;
  --addr-bg:       #dfd5ef;
  --btn-bg:        #d4c8ea;
  --text:          #1a1030;
  --muted:         rgba(40,25,70,0.6);
  --border:        rgba(40,25,70,0.12);
  --accent:        #6b44a0;
  --accent-dim:    rgba(107,68,160,0.12);
  --accent-border: rgba(107,68,160,0.4);
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-term);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: crosshair;
  position: relative;
  transition: background 0.3s, color 0.3s;
}

/* Grain texture */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* Subtle vignette */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9998;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.25) 100%);
}

/* Keyframes */
@keyframes blink        { 0%,100%{opacity:1} 50%{opacity:0} }
@keyframes scandown     { from{top:-10%} to{top:110%} }
@keyframes shake        { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-2px)} 75%{transform:translateX(2px)} }
@keyframes bracketPulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
@keyframes fadeIn       { from{opacity:0} to{opacity:1} }
@keyframes glitch {
  0%,100% { clip-path:none; transform:none; }
  5%      { clip-path:inset(12% 0 82% 0); transform:translate(-3px,0); color:var(--accent); }
  6%      { clip-path:inset(42% 0 52% 0); transform:translate(3px,0); }
  7%      { clip-path:none; transform:none; color:var(--text); }
  44%     { clip-path:inset(62% 0 22% 0); transform:translate(2px,0); color:var(--accent); }
  45%     { clip-path:none; transform:none; color:var(--text); }
}

/* Scan beam */
.scan-beam {
  position: fixed; left:0; right:0; height:3px;
  background: linear-gradient(transparent, rgba(155,127,189,0.06), transparent);
  animation: scandown 8s linear infinite;
  pointer-events: none; z-index: 9997;
}

#page-wrap { opacity: 1; padding-top: 70px; }


/* Launch polish */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* Desktop experience upgrade overlay */
#desktop-upgrade-overlay {
  position: fixed;
  inset: 0;
  z-index: 100200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(12, 8, 18, 0.86);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

#desktop-upgrade-overlay.is-active {
  display: flex;
}

.desktop-upgrade-shell {
  min-width: min(520px, calc(100vw - 48px));
  max-width: 680px;
  border: 1px solid var(--accent-border);
  background: linear-gradient(180deg, rgba(36,29,53,0.96), rgba(20,15,31,0.98));
  box-shadow: 0 0 28px rgba(155,127,189,0.18);
  padding: 18px 20px;
  font-family: var(--font-term);
}

.desktop-upgrade-title {
  color: var(--accent);
  font-size: 14px;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.desktop-upgrade-title::before {
  content: '> ';
}

.desktop-upgrade-line {
  color: var(--text);
  opacity: 0.9;
  font-size: 12px;
  letter-spacing: .08em;
  line-height: 1.75;
}

.desktop-upgrade-line:nth-child(2)::before,
.desktop-upgrade-line:nth-child(3)::before,
.desktop-upgrade-line:nth-child(4)::before {
  content: '[OK] ';
  color: #31d07a;
}

@media (max-width: 700px) {
  #desktop-upgrade-overlay {
    display: none !important;
  }

  #desktop-upgrade-overlay.is-active {
    display: flex !important;
  }
}


/* v81 bidirectional experience transitions */
#desktop-upgrade-overlay {
  transition: opacity 0.14s ease;
}

#desktop-upgrade-overlay:not(.is-active) {
  opacity: 0;
  pointer-events: none;
}

#desktop-upgrade-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}


/* Compact mode note in header */
#compact-mode-note {
  display: none;
  flex: 1 1 auto;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-term);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

html.compact-mode #compact-mode-note {
  display: block;
}

html.desktop-mode #compact-mode-note,
html.mobile-mode #compact-mode-note {
  display: none;
}


/* Compact mode notice enhancement */
#compact-mode-note {
  display: none;
}

html.compact-mode #compact-mode-note {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  margin: 0 16px;
  padding: 8px 14px;
  min-height: 40px;
  border: 1px solid var(--accent-border);
  background: linear-gradient(180deg, rgba(155,127,189,0.14), rgba(155,127,189,0.06));
  color: var(--text);
  font-family: var(--font-term);
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  box-shadow: 0 0 18px rgba(155,127,189,0.12);
  white-space: normal;
}

html.compact-mode #compact-mode-note::before {
  content: 'NOTICE';
  display: inline-block;
  margin-right: 10px;
  padding: 3px 7px;
  border: 1px solid rgba(49,208,122,0.35);
  color: #31d07a;
  background: rgba(49,208,122,0.08);
  font-size: 10px;
  letter-spacing: .12em;
  flex: 0 0 auto;
}

@media (min-width: 701px) and (max-width: 1280px) {
  html.compact-mode nav {
    gap: 10px;
    align-items: center;
  }

  html.compact-mode .gvzo-brand {
    flex: 0 0 auto;
  }

  html.compact-mode #theme-toggle {
    flex: 0 0 auto;
  }
}

/* Targeted mobile font scaling (About Me, Services, Projects only) */
@media (max-width: 700px) {

  /* About Me, Services, Projects content areas */
  .explorer-detail,
  .explorer-content {
    font-size: 1.1rem !important;
    line-height: 1.6 !important;
  }

  .explorer-detail h1,
  .explorer-detail h2,
  .explorer-detail h3 {
    font-size: 1.25rem !important;
  }

  .explorer-detail p,
  .explorer-detail li {
    font-size: 1.1rem !important;
  }

  .explorer-detail button {
    font-size: 1.1rem !important;
    padding: 10px 12px !important;
  }

}






/* v106: no safe-area driven mobile offsets */
:root {
  --safe-top: 0px !important;
  --safe-bottom: 0px !important;
}


/* v109 LIGHT MODE OVERHAUL */
:root.light {
  --bg:            #f3eef9;
  --bg2:           #ebe3f6;
  --bg3:           #dfd2ef;
  --nav-bg:        rgba(244,238,251,0.96);
  --sidebar-bg:    #e7ddf3;
  --addr-bg:       #ddd2ee;
  --btn-bg:        #d7caea;
  --text:          #241537;
  --muted:         rgba(56,34,86,0.72);
  --border:        rgba(78,51,118,0.16);
  --accent:        #7d56bb;
  --accent-dim:    rgba(125,86,187,0.12);
  --accent-border: rgba(125,86,187,0.38);
}

:root.light body {
  background:
    radial-gradient(circle at top, rgba(160,126,216,0.10), transparent 44%),
    linear-gradient(180deg, #f6f1fb 0%, #efe7f8 100%);
  color: var(--text);
}

:root.light body::before {
  opacity: 0.022;
}

:root.light body::after {
  background: radial-gradient(ellipse at center, transparent 60%, rgba(80,54,122,0.07) 100%);
}

:root.light .scan-beam {
  background: linear-gradient(transparent, rgba(125,86,187,0.08), transparent);
}

:root.light #page-wrap {
  background: transparent;
}


/* Header/background continuity */
html,
body {
  background-color: var(--bg);
}


/* Mobile content font tuning for About Me / Services / Projects */
@media (max-width: 700px) {
  #mobile-content .explorer-detail,
  #mobile-content .explorer-content {
    font-size: 1rem !important;
    line-height: 1.55 !important;
  }

  #mobile-content .explorer-detail h1,
  #mobile-content .explorer-detail h2,
  #mobile-content .explorer-detail h3 {
    font-size: 1.12rem !important;
    line-height: 1.35 !important;
  }

  #mobile-content .explorer-detail p,
  #mobile-content .explorer-detail li,
  #mobile-content .explorer-detail td,
  #mobile-content .explorer-detail th {
    font-size: 1rem !important;
    line-height: 1.55 !important;
  }

  #mobile-content .explorer-detail .spec-table td,
  #mobile-content .explorer-detail .spec-table th {
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }

  #mobile-content .proj-card,
  #mobile-content .service-card {
    padding: 15px 16px !important;
  }

  #mobile-content .proj-card-name,
  #mobile-content .service-card h3 {
    font-size: 1rem !important;
    line-height: 1.35 !important;
  }

  #mobile-content .proj-card-desc,
  #mobile-content .service-card p,
  #mobile-content .proj-tag,
  #mobile-content .proj-card-status {
    font-size: 0.96rem !important;
    line-height: 1.5 !important;
  }

  #mobile-content .proj-card-tags {
    gap: 8px !important;
  }
}
