/* COLORS AND FONTS I REUSE A LOT */
:root {
  --bg: #161009;
  --panel: #241a10;
  --panel-alt: #2e2013;
  --border: #4a3620;
  --text: #ecdfc0;
  --text-dim: #a89e8c;
  --accent: #c9a227;
  --accent-red: #ff3b3b;
  --danger: #d1495b;

  --font-mono: 'Cinzel', serif;
  --font-body: 'EB Garamond', serif;
}

/* default spacing on everything */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at top, rgba(201, 162, 39, 0.06), transparent 60%),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.15) 0px, rgba(0,0,0,0.15) 1px, transparent 1px, transparent 3px);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.08rem;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

section {
  padding: 6rem 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* the small roman numeral/heading at the top of each section */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.section-index {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9rem;
}

.section-head h2 {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  letter-spacing: 0.02em;
}

/* TOP NAV BAR */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(22, 16, 9, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
}

.logo-dot {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.75rem;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  position: relative;
  padding-bottom: 0.3rem;
  transition: color 0.2s ease;
}

.nav-link span {
  margin-left: 0.35rem;
}

/* underline that appears in on hover/active */
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--accent);
}

.nav-link.active::after {
  width: 100%;
}

/* hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* HERO SECTION */
.hero {
  height: 100vh;
  max-width: none;
  width: 100%;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
  display: flex;
  align-items: center;
  padding-top: 4rem;
  background-image:
    linear-gradient(rgba(22, 16, 9, 0.55), rgba(22, 16, 9, 0.85)),
    url('jbpics/homeimg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-inner {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* text animations */
@keyframes fadeRight {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.eyebrow {
  font-family: var(--font-mono);
  color: var(--accent-red);
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  animation: fadeRight 0.8s ease-in;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 1.25rem;
  animation: fadeUp 1s ease-in-out;
}

.hero-sub {
  color: var(--text-dim);
  max-width: 34rem;
  font-size: 1.09rem;
  margin-bottom: 2rem;
  animation: fadeUp 0.6s ease-in-out;
}

/* typewriter text animation*/
.trace-console {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 4px;
  padding: 1rem 1.4rem;
  max-width: 34rem;
  margin-bottom: 2.25rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--accent);
  min-height: 2.6rem;
  box-shadow: inset 0 1px 12px rgba(0, 0, 0, 0.35);
}

/* blinking cursor in the typewriter text */
.cursor {
  display: inline-block;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.85rem 1.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  display: inline-block;
}

.btn-primary {
  background: var(--accent);
  color: #08110f;
  border-color: var(--accent);
  font-weight: 600;
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ABOUT SECTION */


.about-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-areas:
    "portrait text"
    "portrait stats";
  gap: 2rem 3rem;
  align-items: start;
}

.portrait-frame {
  grid-area: portrait;
  position: relative;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
}

/* thin gold line in frame */
.portrait-frame::before {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  bottom: 4px;
  left: 4px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  pointer-events: none;
  opacity: 0.6;
}

.portrait-placeholder {
  aspect-ratio: 3 / 4;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(45deg, var(--panel-alt) 0px, var(--panel-alt) 10px, var(--panel) 10px, var(--panel) 20px);
  border: 1px dashed var(--border);
  border-radius: 2px;
}

.portrait-img {
  aspect-ratio: 3 / 4;
  width: 100%;
  object-fit: cover;
  display: block;
  border-radius: 2px;
}

.portrait-monogram {
  font-family: var(--font-mono);
  font-size: 2.75rem;
  color: var(--text-dim);
  opacity: 0.5;
}

.about-text {
  grid-area: text;
  color: var(--text-dim);
  font-size: 1.02rem;
}

.stat-grid {
  grid-area: stats;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem;
  position: relative;
}

/* little colored dot in the corner of each stat card */
.stat-dot {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-gold {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.dot-amber {
  background: var(--accent-red);
  box-shadow: 0 0 6px var(--accent-amber);
  animation: flicker 2.6s ease-in-out infinite;
}

/* amber dot flicker animation */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  45% { opacity: 0.75; }
  55% { opacity: 1; }
  70% { opacity: 0.85; }
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.stat-value {
  font-weight: 600;
  font-size: 0.95rem;
}

/* PROJECTS SECTION */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.project-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.project-card h3 {
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
}

.project-card p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tags li {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  padding: 0.25rem 0.55rem;
  border-radius: 5px;
  color: var(--text-dim);
}

/* colorchanger card */
.project-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* CONTACT SECTION */
.contact {
  max-width: none;
  width: 100%;
  margin: 0;
  background-image:
    linear-gradient(rgba(22, 16, 9, 0.75), rgba(22, 16, 9, 0.9)),
    url('jbpics/missiveimg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.contact-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.contact-lede {
  color: var(--text-dim);
  margin-bottom: 2rem;
  max-width: 32rem;
}

.contact-form {
  display: grid;
  gap: 1.25rem;
  max-width: 32rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.field input,
.field textarea {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.15s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* invalid red border in js */
.field.invalid input,
.field.invalid textarea {
  border-color: var(--danger);
}

.error-msg {
  font-size: 0.78rem;
  color: var(--danger);
  min-height: 1rem;
}

.contact-form .btn {
  justify-self: start;
}

.form-status {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--accent);
  min-height: 1.2rem;
}

/* FOOTER */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-dim);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

/* SMALL SCREEN LAYOUT */
@media (max-width: 720px) {
  /* stack photo, text, and stats */
  .about-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "portrait"
      "text"
      "stats";
  }

  .portrait-frame {
    max-width: 220px;
  }

  /* from nav to dropdown menu under hamburger button */
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav.open {
    max-height: 260px;
  }

  .nav-link {
    padding: 1rem 1.5rem;
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  .nav-toggle {
    display: flex;
  }
}