/* ============================================================
   Miles Pletcher — personal website
   ============================================================ */

:root {
  --nav-h: 128px;
  --bg: #222222;
  --bg-alt: #1c1c1c;
  --text: #b8b8b8;
  --heading: #ffffff;
  --mint: #5effaf;
  --card-bg: #2a2a2a;
  --card-border: #333333;
  --purple: #9500ff;
  --divider: #2c2c2c;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: underline;
  transition: color .2s ease;
}

/* All hover styling is gated on (hover: hover). Touch browsers emulate a
   hover on tap and only clear it on the next tap elsewhere, which leaves
   buttons and links stuck in their hover state after being pressed. */
@media (hover: hover) {
  a:hover { color: var(--mint); }
}

:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}
.btn:focus-visible,
.scrollbtn:focus-visible { outline-color: var(--heading); }

/* Keyboard escape hatch past the sticky navbar (WCAG 2.4.1). */
.skip-link {
  position: absolute;
  top: 8px;
  left: -9999px;
  z-index: 200;
  background: var(--mint);
  color: #000000;
  padding: 12px 20px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 8px; }

sup {
  color: var(--mint)
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
}

.nav {
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: safe center; /* stays centered, but falls back to start when overflowing */
  gap: 64px;
  flex-wrap: nowrap;            
  overflow-x: auto;             
  scrollbar-width: none;        
}
.nav::-webkit-scrollbar { display: none; } /* hide scrollbar (WebKit) */

.nav-link {
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
}
@media (hover: hover) {
  .nav-link:hover { color: var(--heading); }
}
.nav-link.active {
  color: var(--mint);
  font-weight: 600;
}

/* ---------- Sections (each fills a full page) ---------- */
.section {
  min-height: calc(100vh - var(--nav-h));
  padding: 96px 32px;
}

.section--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Alternating band: Home and Portfolio keep --bg, Professional Info and
   Contact sit one shade darker. */
.section--alt { background: var(--bg-alt); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-heading {
  font-size: 40px;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 40px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--mint);
  margin: 0 0 24px;
}
.section-title--spaced { margin-top: 48px; }
.section-title--center { text-align: center; margin-bottom: 32px; }

/* ---------- Home / hero ---------- */
.hero {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hero__name {
  font-size: 64px;
  font-weight: 700;
  color: var(--heading);
  margin: 0;
}
.hero__role {
  font-size: 28px;
  font-weight: 600;
  color: var(--mint);
  margin: 0;
}
.hero__lead {
  font-size: 20px;
  margin: 16px 0 0;
}
.hero__bio {
  font-size: 20px;
  margin: 0;
}

/* ---------- Experience & Education ---------- */
.experience, .education { margin-bottom: 32px; }
.experience__head, .education__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.experience__title, .education__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--heading);
  margin: 0;
}
.experience__location, .education__location {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.experience__dates, .education__dates {
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
  margin: 0;
  white-space: nowrap;
}
.bullets {
  margin: 8px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bullets li {
  font-size: 16px;
  line-height: 1.5;
}

/* ---------- Skills ---------- */
.skills {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skill, .education__details {
  font-size: 16px;
  margin: 0;
}
.skill__label {
  color: var(--heading);
  font-weight: 700;
}

/* ---------- Portfolio ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.card {
  background: var(--card-bg);
  border: 4px solid var(--card-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s ease;
}
.card a,
.card a:hover {
  color: inherit;
  text-decoration: none;
}
@media (hover: hover) {
  .card:hover {
    border-width: 4px;
    border-color: var(--mint);
    cursor: pointer;
  }
  .card--placeholder:hover {
    cursor: default;
    border-color: var(--card-bg);
  }
}
/* The 4px border is the focus ring here, so drop the global :focus-visible
   outline to avoid a doubled-up mint ring. */
.card:focus-within {
  border-color: var(--mint);
  outline: none;
}
.card a:focus-visible { outline: none; }
.card__thumb {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #1e1e1e;
  color: #eeeeee;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.card__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  flex: none;
  object-fit: cover;
  object-position: left;
}
.card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card__title {
  font-size: 18px;
  color: var(--heading);
  margin: 0;
}
.card__desc {
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}
.card__tags {
  font-size: 13px;
  font-weight: 600;
  margin: 8px 0 0;
}

/* ---------- Contact ---------- */
.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.contact__title {
  font-size: 40px;
  font-weight: 700;
  color: var(--heading);
  margin: 0;
}
.contact__actions {
  display: flex;
  gap: 24px;
  margin-top: 8px;
}
.contact__desc {
  max-width: 520px;
  margin: 0;
  text-align: center;
  line-height: 1.5;
}

.contact__title + .contact__desc { margin-top: -14px; }
.contact__desc + .contact__desc { margin-top: -18px; }
.contact__desc + .field { margin-top: 8px; }

.field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.field__label {
  min-width: 110px;
  text-align: left;
  font-size: 18px;
  color: var(--heading);
}
.field__input {
  background: #ffffff;
  border: 2px solid #767676;
  padding: 8px 12px;
  width: 300px;
  font-size: 16px;
  font-family: inherit;
  color: #111111;
  transition: border-color .2s ease;
}

.field__input:focus,
.field__input:focus-visible {
  border-color: var(--mint);
  outline: none;
}
.invisible {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

/* ---------- Buttons (reusable) ---------- */
.btn {
  background: var(--mint);
  border: 2px solid transparent;
  padding: 12px 30px;
  cursor: pointer;
  transition: background-color .1s ease, border-color .1s ease;
}
@media (hover: hover) {
  .btn:hover {
    border: 2px solid var(--mint);
    background-color: var(--heading);
  }
}
.btn__label {
  color: #000000;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 900;
  transition: color .2s ease;
}

/* ---------- Page up / down buttons ---------- */
.scrollbtn {
  position: fixed;
  bottom: 24px;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--mint);
  color: #000000;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: opacity .2s ease, visibility .2s ease,
              background-color .2s ease, border-color .2s ease;
}
@media (hover: hover) {
  .scrollbtn:hover {
    border-color: var(--mint);
    background-color: var(--heading);
  }
}
.scrollbtn--up { left: 24px; }
.scrollbtn--down { right: 24px; }

.scrollbtn.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--divider);
  padding: 48px 32px;
}
.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 32px;
}
.footer__link,
.footer__social a {
  color: var(--text);
  text-decoration: none;
}
@media (hover: hover) {
  .footer__link:hover,
  .footer__social a:hover { color: var(--mint); }
}

.footer__link {
  font-size: 16px;
  font-weight: 500;
}
.footer__social {
  display: flex;
  gap: 24px;
}
.footer__social a {
  font-size: 26px;
  line-height: 1;
}
.footer__note {
  margin: 0;
  font-size: 14px;
  color: #7a7a7a;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .portfolio-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --nav-h: 96px; }
  .nav { gap: 20px; padding: 0 16px; }
  .nav-link { font-size: 15px; }
  .section { padding: 64px 20px; }
  .hero__name { font-size: 44px; }
  .hero__role { font-size: 22px; }
  .hero__lead,
  .hero__bio { font-size: 18px; }
  .experience__head { flex-direction: column; gap: 2px; }
  .contact__actions { flex-direction: column; width: 100%; max-width: 320px; }
  .footer { padding: 40px 20px; }
  .footer__links { gap: 10px 24px; }

  .contact { width: 100%; max-width: 380px; }
  .field {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
  }
  .field__label { min-width: 0; }
  .btn { width: 100%; }
  .field__input { width: 100%; }
}

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