/* ===========================
   Theme Variables
   =========================== */
:root {
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Light theme */
html[data-theme="light"] {
  --bg: #ffffff;
  --panel: #f7f8fa;
  --text: #1b1e24;
  --muted: #5b6370;
  --accent: #4460ff;
  --border: #e6e9ee;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Dark theme */
html[data-theme="dark"] {
  --bg: #0b0c0f;
  --panel: #121419;
  --text: #e7e9ee;
  --muted: #a2a8b3;
  --accent: #7c9cf5;
  --border: #1b1e25;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

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


html {
  scroll-behavior: smooth;
  /* this will be set dynamically to your header’s real height */
  scroll-padding-top: var(--header-h, 80px);
}


body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Anonymous Pro", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }

/* ===========================
   Layout
   =========================== */
main {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 18px 64px;
}

section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}
section:last-of-type { border-bottom: 0; }

h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; }

h1 {
  font-family: "Workbench", system-ui, -apple-system, Segoe UI, Roboto, Arial;
  font-size: clamp(28px, 4.6vw, 44px);
  letter-spacing: 0.3px;
}
h2 { font-size: clamp(20px, 3.2vw, 28px); color: var(--text); }
h3 { font-size: 18px; }

p { margin: 0 0 12px; color: var(--text); }
ul { margin: 8px 0 0; padding-left: 18px; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity .2s ease, color .2s ease, background .2s ease;
}
a:hover { opacity: 0.9; }
a:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ===========================
   Header + Nav
   =========================== */
header {
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
header .nav {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header .brand {
  font-family: "Workbench", system-ui;
  font-size: 20px;
  letter-spacing: .3px;
}
.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text);
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--panel);        /* always highlighted */
  border: 1px solid var(--border);
  opacity: 1;
  line-height: 1.6;
  display: flex;
  align-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-links a:hover {
  background: var(--accent);
  color: #fff;
}


/* ===========================
   About
   =========================== */
#about p {
  color: var(--muted);
  max-width: 70ch;
}

.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: background 0.2s ease, transform 0.2s ease;
}

.resume-btn:hover {
  background: #3652d9; /* darker blue */
  transform: translateY(-2px);
}

.about-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 10px;
}

.about-row p {
  margin: 0;
  flex: 1 1 0%;
}

.about-gif {
  width: 150px;
  height: auto;
  display: block;
  transform: scaleX(-1);
}

.about-gif--desktop {
  margin-left: 50px;
  display: block;
}

.about-gif--mobile {
  display: none;
}

.about-btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 600px) {
  .about-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .about-gif--desktop {
    display: none;
  }
  .about-gif--mobile {
    display: block;
    width: 60px;
    height: auto;
    transform: scaleX(-1);
    margin-top:5px;
  }
}


/* ===========================
   Projects
   =========================== */
.project-list {
  display: grid;  /* stacked by default */
  gap: 20px;
}

.project {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.project:hover { transform: translateY(-2px); }
.project h3 { margin-top: 0; }

.github-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  transition: opacity .2s;
  
}
.github-btn:hover {
  background: #3652d9;
  opacity: .9;
  transform: translateY(-2px);
}
.github-btn .icon { width: 18px; height: 18px; filter: invert(1); }

/* ===========================
   Contact
   =========================== */
.contact-links {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--accent);      /* solid blue background */
  border: none;                   /* no border, looks like your GitHub button */
  border-radius: 8px;
  color: #fff;                    /* white text */
  font-weight: 500;
  text-decoration: none;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* subtle shadow */
  transition: background 0.2s ease, transform 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}

.contact-btn:hover {
  background: #3652d9;            /* slightly darker blue on hover */
  transform: translateY(-2px);
}

.contact-btn .icon {
  width: 18px;
  height: 18px;
  filter: invert(1);              /* makes icons white */
}

.fax-icon-white {
  filter: brightness(100) invert(1) grayscale(0) contrast(2.5);
}


/* ===========================
   Footer
   =========================== */
/* Full-width footer (edge to edge) */
footer {
  width: 100%;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Constrained content inside footer */
.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0px 18px 0px;  /* <= adjust right padding if you want it closer to the edge */
  display: flex;
  justify-content: space-between;
  align-items: flex-end;    /* anchor items to the bottom of the footer */
  gap: 12px;
}

.footer-gif {
  height: 100px;            /* tweak size */
  width: auto;
  object-fit: contain;
  display: block;
  align-self: flex-end;     /* ensure it hugs the footer bottom */
}

/* Make sure the footer sits at the bottom of the page */
html, body { height: 100%; }
body {
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

/* Optional: on small screens, stack neatly */
@media (max-width: 480px) {
  .footer-inner {
    flex-direction: row;     /* stay in a row */
    padding-bottom: 0px;    /* a bit tighter on mobile */
  }
  .footer-gif { height: 72px; }
}


.footer-gif {
  height: 100px;         
  width: auto;          
  object-fit: contain;  
  align-self: flex-end; 
}


/* ===========================
   Theme Toggle
   =========================== */
#theme-toggle {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* subtle shadow */
  transition: background 0.2s ease, color 0.2s ease, 
              transform 0.15s ease, box-shadow 0.15s ease;
}

#theme-toggle:hover {
  background: var(--accent);
  color: #fff;
}

/* Theme icon transitions */
.theme-icon {
  position: absolute;
  transition: opacity .25s ease, transform .25s ease;
}

/* Place icons nicely inside the button */
#theme-toggle {
  position: relative;
  width: 40px;              /* fixed size for nice layout */
  height: 40px;
  padding: 0;               /* we’ll center via flex */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Default (light): show sun, hide moon */
html[data-theme="light"] .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
html[data-theme="light"] .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.8);
}

/* Dark: show moon, hide sun */
html[data-theme="dark"] .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.8);
}
html[data-theme="dark"] .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Guarantee small icons inside buttons/links */
img.icon,
.contact-btn img,
.github-btn img,
.footer-gif,
.about-gif {
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}

/* Mobile header: single row (brand | links | toggle) */
@media (max-width: 640px) {
  header .nav {
    display: grid;
    grid-template-columns: auto 1fr auto; /* brand | links | toggle */
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
  }

  /* Keep your name on one line */
  header .brand {
    font-size: 16px;
    line-height: 1;
    flex-direction: column; 
    white-space: normal;  
    letter-spacing: 0.2px;
  }

  /* Links live in the middle column (no extra grid-column rule) */
  .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* Make the pills a bit smaller on phones */
  .nav-links a {
    font-size: 15px;
    padding: 4px 8px;
    border-radius: 8px;
  }

  /* Compact theme toggle on the right */
  #theme-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    justify-self: end;
    box-shadow: none; /* reduce visual bulk */
  }
}


/* Mobile contact buttons: single column, full width */
@media (max-width: 640px) {
  .contact-links {
    display: grid;
    grid-template-columns: 1fr; /* stack */
    gap: 12px;
  }
  .contact-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 14px;
  }
}

/* ===========================
   Speech Bubble
   =========================== */
.speech-bubble {
  background: #eaeaea;
  color: #222;
  border-radius: 16px;
  padding: 8px 16px;
  font-family: 'Anonymous Pro', monospace;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border: 2px solid #888;
  position: absolute;
  white-space: nowrap;
  z-index: 2;
}
.speech-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: #eaeaea transparent transparent transparent;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.10));
}

@media (max-width: 640px) {
  .speech-bubble {
    top: 120%;
    bottom: auto !important;
  }
  .speech-bubble::after {
    top: auto;
    bottom: 100%;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent #eaeaea transparent;
    transform: translateX(-50%) rotate(180deg);
  }
}

/* ===========================
   User Select None
   =========================== */
.resume-btn,
.github-btn,
.contact-btn,
#theme-toggle,
.nav-links a {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}

.footer-gif,
.about-gif {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
