/* ================================================================
   EGELAND.DEV — GUI PORTFOLIO
   ================================================================ */

/* === VARIABLES === */
:root {
  --bg:          #0C0C16;
  --surface:     #13131F;
  --elevated:    #1A1B26;
  --text:        #C0CAF5;
  --dim:         #565F89;
  --muted:       #3B4261;
  --accent:      #00FFB3;
  --accent-dim:  #00B37F;
  --blue:        #00D4FF;
  --purple:      #BB9AF7;
  --yellow:      #E0AF68;
  --red:         #F7768E;
  --border:      #1F2035;

  --mono: 'IBM Plex Mono', 'Fira Code', 'Courier New', monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;

  --nav-h:   64px;
  --max-w:   1100px;
  --gap-sec: 110px;
  --r:       8px;
  --r-lg:    12px;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul[role="list"] { list-style: none; }
img { display: block; max-width: 100%; }

/* === CANVAS === */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.28;
}

/* === ABOVE CANVAS === */
nav, section, footer { position: relative; z-index: 1; }

/* ================================================================
   NAVBAR
   ================================================================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(12, 12, 22, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s, box-shadow 0.3s;
}
#navbar.scrolled {
  border-bottom-color: rgba(31, 32, 53, 0.9);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-brand {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--text);
  flex-shrink: 0;
}
.nav-brand .acc { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--dim);
  transition: color 0.2s;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); }
.nav-links a.active { border-bottom-color: var(--accent); }

/* hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* mobile dropdown */
.mobile-nav {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 2rem 1.25rem;
  gap: 0.875rem;
  border-top: 1px solid var(--border);
  background: rgba(12, 12, 22, 0.95);
}
.mobile-nav[hidden] { display: none !important; }
.mobile-nav a {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--dim);
  transition: color 0.2s;
}
.mobile-nav a:hover { color: var(--text); }

/* ================================================================
   CONTAINER
   ================================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ================================================================
   SECTION HEADERS
   ================================================================ */
.section-header {
  margin-bottom: 3rem;
}
.section-num {
  display: block;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}
.section-header h2 {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 400;
  color: var(--text);
}

/* ================================================================
   HERO
   ================================================================ */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 5rem) 2rem 5rem;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}

.hero-name {
  font-family: var(--mono);
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 1rem;
}

/* GLITCH */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
}
.glitch::before {
  color: var(--blue);
  animation: glitch-a 8s infinite;
}
.glitch::after {
  color: var(--red);
  animation: glitch-b 8s infinite;
}

@keyframes glitch-a {
  0%, 88%, 100% { opacity: 0; transform: none; }
  89% { opacity: 0.85; transform: translate(-4px, 1px); clip-path: polygon(0 15%, 100% 15%, 100% 35%, 0 35%); }
  90% { opacity: 0; }
  91% { opacity: 0.7;  transform: translate(4px, -1px); clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%); }
  92% { opacity: 0; }
}
@keyframes glitch-b {
  0%, 88%, 100% { opacity: 0; transform: none; }
  89.5% { opacity: 0.65; transform: translate(4px, -1px); clip-path: polygon(0 40%, 100% 40%, 100% 55%, 0 55%); }
  90.5% { opacity: 0; }
  91.5% { opacity: 0.6;  transform: translate(-4px, 1px); clip-path: polygon(0 0, 100% 0, 100% 18%, 0 18%); }
  92.5% { opacity: 0; }
}

.hero-role {
  font-family: var(--mono);
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  min-height: 1.8em;
}
.cursor-bar {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

.hero-bio {
  color: var(--dim);
  font-size: 0.9375rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  max-width: 460px;
}
.hero-bio a {
  color: var(--blue);
  border-bottom: 1px solid rgba(0, 212, 255, 0.3);
  transition: border-color 0.2s;
}
.hero-bio a:hover { border-color: var(--blue); }

.hero-cta {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.btn-terminal {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  position: relative;
  overflow: hidden;
  margin-top: 0.25rem;
}
.btn-terminal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-101%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}
.btn-terminal:hover::before { transform: translateX(0); }
.btn-terminal:hover {
  color: var(--bg);
  box-shadow: 0 0 28px rgba(0, 255, 179, 0.35), 0 0 8px rgba(0, 255, 179, 0.2);
}
.btn-terminal > * { position: relative; z-index: 1; }
.btn-term-prompt {
  font-weight: 700;
  transition: color 0.28s;
}
.btn-terminal:hover .btn-term-prompt { color: var(--bg); }

/* NAV TERMINAL BUTTON */
.nav-terminal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.3rem 0.75rem;
  border-radius: var(--r);
  text-decoration: none;
  margin-left: 1.25rem;
  letter-spacing: 0.03em;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.nav-terminal-btn:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 18px rgba(0, 255, 179, 0.3);
}

/* MOBILE NAV TERMINAL LINK */
.mobile-terminal-link {
  color: var(--accent) !important;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 0.75rem !important;
  font-family: var(--mono);
  font-size: 0.85rem;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  padding: 0.625rem 1.375rem;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 500;
}
.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 22px rgba(0, 255, 179, 0.25);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ================================================================
   MOCK TERMINAL (HERO RIGHT)
   ================================================================ */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-glow {
  position: absolute;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(0, 255, 179, 0.07) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

.mock-terminal {
  width: 100%;
  max-width: 500px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 255, 179, 0.05),
    0 24px 64px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255,255,255,0.025);
}

.mt-bar {
  background: var(--elevated);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.mt-dots { display: flex; gap: 7px; }
.mt-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mt-dot.close    { background: #FF5F57; }
.mt-dot.minimize { background: #FEBC2E; }
.mt-dot.maximize { background: #28C840; }

.mt-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--dim);
  flex: 1;
  text-align: center;
}

.mt-body {
  padding: 1.125rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.775rem;
  line-height: 1.85;
  min-height: 255px;
  overflow: hidden;
}
.mt-line {
  display: block;
  animation: fade-in-line 0.08s ease forwards;
  white-space: pre;
}

/* terminal content colours */
.mt-p   { color: var(--accent); }
.mt-d   { color: var(--dim); }
.mt-cmd { color: var(--text); }
.mt-dim { color: var(--dim); }
.mt-port { color: var(--blue); }
.mt-open { color: var(--accent); }
.mt-svc  { color: var(--purple); }
.mt-ver  { color: var(--yellow); }
.mt-cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

/* ================================================================
   ABOUT
   ================================================================ */
#about { padding: var(--gap-sec) 0; }

.about-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: start;
}
.about-bio p {
  color: var(--dim);
  line-height: 1.85;
  margin-bottom: 1.1rem;
  font-size: 0.9375rem;
}
.about-bio p:last-child { margin-bottom: 0; }
.about-bio strong { color: var(--text); font-weight: 500; }
.about-bio .hl {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.875em;
}

.about-facts {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.fact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.875rem 1.125rem;
  transition: border-color 0.2s;
}
.fact-card:hover { border-color: rgba(0, 255, 179, 0.25); }
.fact-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1rem;
  flex-shrink: 0;
}
.fact-title {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.fact-sub { font-size: 0.775rem; color: var(--dim); }

/* ================================================================
   SKILLS
   ================================================================ */
#skills { padding: var(--gap-sec) 0; }

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.skill-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.375rem 1.5rem;
  transition: border-color 0.2s, transform 0.25s;
}
.skill-box:hover {
  border-color: rgba(0, 255, 179, 0.2);
  transform: translateY(-2px);
}
.skill-box-hd {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.125rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--text);
}
.skill-box-hd i { color: var(--accent); width: 18px; }

.badges { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.badge {
  font-family: var(--mono);
  font-size: 0.725rem;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  background: rgba(0, 255, 179, 0.06);
  color: var(--accent);
  border: 1px solid rgba(0, 255, 179, 0.18);
  transition: background 0.2s;
}
.badge:hover { background: rgba(0, 255, 179, 0.12); }
.badge-purple {
  background: rgba(187, 154, 247, 0.06);
  color: var(--purple);
  border-color: rgba(187, 154, 247, 0.18);
}
.badge-purple:hover { background: rgba(187, 154, 247, 0.12); }
.badge-blue {
  background: rgba(0, 212, 255, 0.06);
  color: var(--blue);
  border-color: rgba(0, 212, 255, 0.18);
}
.badge-blue:hover { background: rgba(0, 212, 255, 0.12); }

/* ================================================================
   PROJECTS
   ================================================================ */
#projects { padding: var(--gap-sec) 0; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.25s, box-shadow 0.25s;
}
.project-card:hover {
  border-color: rgba(0, 255, 179, 0.28);
  transform: translateY(-4px);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.4);
}
.pc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.pc-icon {
  font-size: 1.5rem;
  color: var(--accent);
}
.pc-gh {
  font-size: 1.1rem;
  color: var(--dim);
  transition: color 0.2s;
}
.pc-gh:hover { color: var(--text); }

.pc-name {
  font-family: var(--mono);
  font-size: 0.975rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.pc-desc {
  font-size: 0.875rem;
  color: var(--dim);
  line-height: 1.75;
  flex: 1;
  margin-bottom: 1.25rem;
}
.pc-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ptag {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: rgba(86, 95, 137, 0.15);
  color: var(--dim);
  border: 1px solid rgba(86, 95, 137, 0.25);
}
.projects-more { text-align: center; }

/* ================================================================
   CERTIFICATIONS
   ================================================================ */
#certs { padding: var(--gap-sec) 0; }

.certs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.875rem;
}
.cert-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.875rem 1.125rem;
  transition: border-color 0.2s, background 0.2s;
  cursor: default;
  color: inherit;
}
a.cert-row {
  cursor: pointer;
}
a.cert-row:hover {
  border-color: rgba(0, 212, 255, 0.28);
  background: var(--elevated);
}
.cert-ico {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: rgba(0, 212, 255, 0.07);
  border: 1px solid rgba(0, 212, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: 0.875rem;
  flex-shrink: 0;
}
.cert-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}
.cert-name {
  font-family: var(--mono);
  font-size: 0.825rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cert-meta { font-size: 0.75rem; color: var(--dim); }
.cert-ext {
  color: var(--muted);
  font-size: 0.65rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* ================================================================
   CONTACT
   ================================================================ */
#contact { padding: var(--gap-sec) 0; }

.contact-intro {
  color: var(--dim);
  font-size: 0.9375rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  max-width: 480px;
}
.social-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
}
.social-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.825rem 1.125rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--dim);
  transition: all 0.2s;
}
.social-row:hover {
  border-color: rgba(0, 255, 179, 0.25);
  color: var(--text);
  background: var(--elevated);
}
.social-row i {
  width: 18px;
  text-align: center;
  color: var(--accent);
  font-size: 0.9375rem;
  flex-shrink: 0;
}

/* ================================================================
   FOOTER
   ================================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  position: relative;
  z-index: 1;
}
.footer-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
.footer-name {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--dim);
}
.footer-name .acc { color: var(--accent); }

/* ================================================================
   REVEAL ANIMATION
   ================================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   EASTER EGG: KONAMI OVERLAY
   ================================================================ */
#konami-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 22, 0.97);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#konami-overlay.active {
  opacity: 1;
  pointer-events: all;
}
#konami-terminal {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--accent);
  max-width: 560px;
  width: 90%;
  padding: 2rem 2.25rem;
  border: 1px solid var(--accent);
  border-radius: var(--r);
  box-shadow: 0 0 60px rgba(0,255,179,0.15), 0 0 120px rgba(0,255,179,0.06), inset 0 0 40px rgba(0,255,179,0.03);
}
.kt-line { line-height: 2; white-space: pre; }
.kt-line.dim { color: var(--dim); }
.kt-line.success {
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-shadow: 0 0 24px rgba(0,255,179,0.7);
  animation: kt-pulse 1s ease infinite alternate;
}
.kt-line.flag { color: var(--yellow); }
@keyframes kt-pulse {
  from { text-shadow: 0 0 12px rgba(0,255,179,0.5); }
  to   { text-shadow: 0 0 32px rgba(0,255,179,0.9), 0 0 60px rgba(0,255,179,0.4); }
}

/* ================================================================
   KEYFRAMES
   ================================================================ */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
@keyframes fade-in-line {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: none; }
}

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
  :root { --gap-sec: 80px; }

  #hero {
    grid-template-columns: 1fr;
    min-height: unset;
    padding-top: calc(var(--nav-h) + 3rem);
    padding-bottom: 3rem;
    text-align: center;
  }
  .hero-bio { max-width: 100%; }
  .hero-cta { justify-content: center; }
  .btn-terminal { align-self: center; }
  .hero-visual { order: -1; }
  .mock-terminal { max-width: 520px; width: 100%; }
  .hero-glow { display: none; }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .skills-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }

  .nav-links { display: none; }
  .nav-terminal-btn { display: none; }
  .hamburger { display: flex; }
}

@media (max-width: 600px) {
  .container, #hero { padding-left: 1.25rem; padding-right: 1.25rem; }
  .hero-name { font-size: 2rem; }
  .certs-list { grid-template-columns: 1fr; }
  .footer-wrap { text-align: center; }
  .mt-body { font-size: 0.7rem; }
}
