:root {
  --orange: #ff8000;
  --orange-dark: #e87300;
  --cream: #fff3df;
  --cream-strong: #ffe1ad;
  --ink: #16110c;
  --panel: #fff0d4;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: var(--orange);
  line-height: 1.5;
}

button,
a {
  color: inherit;
  font: inherit;
}

a {
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--cream);
  border: 3px solid var(--ink);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem clamp(1rem, 3vw, 2rem);
  background: var(--orange);
  border-bottom: 4px solid var(--ink);
}

.brand,
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand {
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  animation: markTick 5s steps(2) infinite;
}

.main-nav {
  flex-wrap: wrap;
  justify-content: center;
}

.main-nav a,
.button,
.project-console button,
.skill-button,
.contact-panel a {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  border: 3px solid var(--ink);
  background: var(--cream);
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.main-nav a:hover,
.button:hover,
.project-console button:hover,
.skill-button:hover,
.contact-panel a:hover {
  animation: none;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.main-nav a[aria-current] {
  background: var(--cream-strong);
}

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: center;
  padding: clamp(2rem, 7vw, 6rem) clamp(1rem, 4vw, 4rem);
}

.hero-copy {
  max-width: 58rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(3rem, 10vw, 8rem);
  line-height: 0.88;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 5px 5px 0 var(--ink);
  color: var(--cream);
  animation: titleBump 7s ease-in-out infinite;
}

h2 {
  margin-bottom: 0.4rem;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--cream);
  text-shadow: 4px 4px 0 var(--ink);
}

h3 {
  margin-bottom: 0.5rem;
  font-size: 1.35rem;
  line-height: 1.05;
}

.hero-copy p:not(.eyebrow) {
  max-width: 42rem;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--cream);
  border: 3px solid var(--ink);
  padding: 1rem;
  box-shadow: 5px 5px 0 var(--ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.current-note {
  display: inline-block;
  margin: 1rem 0 0;
  padding: 0.55rem 0.8rem;
  border: 3px solid var(--ink);
  background: var(--cream-strong);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 900;
}

.button.primary {
  background: var(--ink);
  color: var(--cream);
  animation: softLift 4.5s ease-in-out infinite;
}

.button.secondary {
  background: var(--cream-strong);
  animation: softLift 5.2s ease-in-out infinite 300ms;
}

.section {
  padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 4vw, 4rem);
  border-top: 5px solid var(--ink);
}

.section-title,
.content-panel,
.project-grid,
.project-detail,
.project-console,
.timeline,
.skill-panel,
.contact-panel {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  margin-bottom: 1.5rem;
}

.content-panel,
.project-card,
.project-detail,
.timeline article,
.skill-panel,
.contact-panel {
  border: 4px solid var(--ink);
  background: var(--panel);
  box-shadow: 7px 7px 0 var(--ink);
}

.content-panel {
  padding: clamp(1.2rem, 3vw, 2rem);
  font-weight: 700;
  animation: panelFloat 7.5s ease-in-out infinite;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
}

.project-card {
  min-height: 15rem;
  padding: 1rem;
  transform: rotate(var(--tilt, -1deg));
  animation: cardIdle 6s ease-in-out infinite;
  transition: transform 160ms ease;
}

.project-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 0.9rem;
  border: 3px solid var(--ink);
  background: var(--ink);
  object-fit: cover;
}

.project-card:nth-child(2) {
  --tilt: 1deg;
  animation-delay: 600ms;
}

.project-card:nth-child(3) {
  --tilt: -2deg;
  animation-delay: 1.2s;
}

.project-card:nth-child(4) {
  --tilt: 2deg;
  animation-delay: 1.8s;
}

.project-card:hover {
  animation: none;
  transform: rotate(0deg) translateY(-6px);
}

.project-stamp {
  display: inline-flex;
  margin-bottom: 1rem;
  padding: 0.25rem 0.45rem;
  border: 3px solid var(--ink);
  background: var(--orange);
  font-size: 0.82rem;
  font-weight: 900;
}

.project-card a {
  font-weight: 900;
}

.project-detail {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--cream-strong);
  animation: panelFloat 8s ease-in-out infinite 500ms;
}

.project-detail.is-swapping {
  animation: panelNudge 260ms ease;
}

.project-console {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.project-console p {
  margin: 0;
  font-weight: 800;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.timeline article {
  padding: 1.2rem;
  animation: panelFloat 7s ease-in-out infinite;
}

.timeline article:nth-child(2) {
  animation-delay: 700ms;
}

.timeline article:nth-child(3) {
  animation-delay: 1.4s;
}

.timeline span {
  display: inline-grid;
  place-items: center;
  width: 4.3rem;
  height: 4.3rem;
  margin-bottom: 0.8rem;
  border: 4px solid var(--ink);
  background: var(--orange);
  font-weight: 900;
}

.skill-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(7rem, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.skill-button {
  min-height: 5rem;
  background: var(--cream);
  animation: softLift 6s ease-in-out infinite;
}

.skill-button:nth-child(2) {
  animation-delay: 400ms;
}

.skill-button:nth-child(3) {
  animation-delay: 800ms;
}

.skill-button:nth-child(4) {
  animation-delay: 1.2s;
}

.skill-button:nth-child(5) {
  animation-delay: 1.6s;
}

.skill-button.is-selected {
  background: var(--cream-strong);
}

#skillOutput {
  grid-column: 1 / -1;
  min-height: 3rem;
  padding: 0.8rem;
  border: 4px solid var(--ink);
  background: var(--cream-strong);
  font-weight: 900;
}

.contact-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
}

.contact-panel a {
  min-width: 8rem;
  animation: softLift 5.5s ease-in-out infinite;
}

.contact-panel a:nth-child(2) {
  animation-delay: 500ms;
}

.contact-panel a:nth-child(3) {
  animation-delay: 1s;
}

.contact-panel a:nth-child(4) {
  animation-delay: 1.5s;
}

.contact-panel a:nth-child(5) {
  animation-delay: 2s;
}

.contact-panel a:nth-child(6) {
  animation-delay: 2.5s;
}

.project-article {
  max-width: 58rem;
  margin: 0 auto;
  padding: clamp(2rem, 7vw, 5rem) clamp(1rem, 4vw, 2rem);
}

.back-link {
  display: inline-flex;
  margin-bottom: 1.5rem;
  padding: 0.55rem 0.8rem;
  border: 3px solid var(--ink);
  background: var(--cream);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.article-header,
.article-section {
  border: 4px solid var(--ink);
  background: var(--panel);
  box-shadow: 7px 7px 0 var(--ink);
}

.article-header {
  margin-bottom: 1rem;
  padding: clamp(1.2rem, 4vw, 2rem);
}

.article-header h1 {
  font-size: clamp(2.5rem, 8vw, 5.8rem);
  color: var(--ink);
  text-shadow: 5px 5px 0 rgba(22, 17, 12, 0.32);
  animation-name: articleTitleBump;
}

.article-header p:not(.eyebrow) {
  max-width: 45rem;
  font-size: 1.08rem;
  font-weight: 700;
}

.article-visual {
  margin: 1.25rem 0 0;
}

.article-visual img {
  display: block;
  width: 100%;
  max-height: 28rem;
  border: 4px solid var(--ink);
  background: var(--ink);
  object-fit: contain;
}

.article-visual figcaption {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: 800;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.article-meta span {
  display: inline-flex;
  padding: 0.25rem 0.5rem;
  border: 3px solid var(--ink);
  background: var(--orange);
  font-weight: 900;
}

.article-section {
  margin-top: 1rem;
  padding: clamp(1.2rem, 3vw, 2rem);
}

.article-section h2 {
  font-size: clamp(1.7rem, 4vw, 3rem);
  color: var(--ink);
  text-shadow: none;
}

.article-section p {
  font-weight: 700;
}

.section.is-active {
  outline: 6px solid var(--cream);
  outline-offset: -12px;
}

@keyframes panelNudge {
  50% {
    transform: translateX(10px);
  }
}

@keyframes markTick {
  50% {
    transform: rotate(2deg);
  }
}

@keyframes titleBump {
  50% {
    transform: translateY(-4px);
    text-shadow: 7px 7px 0 var(--ink);
  }
}

@keyframes articleTitleBump {
  50% {
    transform: translateY(-4px);
    text-shadow: 7px 7px 0 rgba(22, 17, 12, 0.24);
  }
}

@keyframes softLift {
  50% {
    transform: translateY(-3px);
  }
}

@keyframes panelFloat {
  50% {
    transform: translateY(-5px);
  }
}

@keyframes cardIdle {
  0%,
  100% {
    transform: rotate(var(--tilt, -1deg)) translateY(0);
  }
  50% {
    transform: rotate(var(--tilt, -1deg)) translateY(-6px);
  }
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-grid,
  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skill-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .main-nav a {
    flex: 1 1 8rem;
  }

  .project-grid,
  .timeline {
    grid-template-columns: 1fr;
  }
}

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