:root {
  --parchment: #f1e7c4;
  --paper: #f8f0d3;
  --ink: #282015;
  --heading: var(--ink);
  --muted: #595650;
  --photo-border: #776a4d;
  --olive: #73733d;
  --olive-dark: #454626;
  --brass: #a68d43;
  --red: #b20d0d;
  --line: rgba(72, 58, 31, 0.24);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--parchment);
}

body {
  position: relative;
  display: flow-root;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background: var(--parchment);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a, button { color: inherit; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  padding: 9px 12px;
  color: var(--paper);
  background: var(--ink);
  font: 700 10px/1 var(--mono);
  transform: translateY(-180%);
}

.skip-link:focus { transform: none; }

.site {
  width: min(640px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 40px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.decoder {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  margin: 0;
  padding: 7px 2px;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 8px 7px rgba(58,45,20,.18));
  cursor: default;
  perspective: 500px;
}

.decoder::after {
  position: absolute;
  right: 31px;
  bottom: 0;
  left: 31px;
  height: 7px;
  border-radius: 50%;
  background: rgba(62,49,23,.18);
  content: "";
  filter: blur(4px);
}

.cap {
  position: relative;
  z-index: 2;
  width: 31px;
  height: 50px;
  border-radius: 40% / 12%;
  background: linear-gradient(to bottom, #393c22 0%, #89874b 13%, #c6bd7b 28%, #a5a060 42%, #777841 65%, #42482a 88%, #292f1c 100%);
  box-shadow: inset 0 1px 1px #e0d698, inset 0 -2px 2px rgba(24,29,14,.65), 0 2px 2px rgba(34,32,15,.3);
}

/* Elliptical end faces and raised collars give the handles real thickness. */
.cap::before,
.cap::after {
  position: absolute;
  content: "";
}

.cap::before {
  top: 0;
  width: 48%;
  height: 100%;
  border: 1px solid #555735;
  border-radius: 50%;
  background: radial-gradient(ellipse at 35% 27%, #bbb478 0%, #8b8b51 38%, #62693d 70%, #353e25 100%);
  box-shadow: inset 1px 1px 1px rgba(238,226,166,.65), inset -2px -2px 2px rgba(30,37,17,.6);
}

.cap::after {
  top: -2px;
  width: 24%;
  height: calc(100% + 4px);
  border-radius: 45% / 10%;
  background: linear-gradient(to bottom, #44482a, #d8ce8c 25%, #a9a364 44%, #777943 65%, #353d23 95%);
  box-shadow: inset 1px 0 1px rgba(239,224,157,.65), inset -1px 0 1px rgba(34,38,19,.65), 1px 0 2px rgba(31,33,15,.4);
}

.cap-left {
  margin-right: -2px;
}

.cap-right {
  margin-left: -2px;
}

.cap-left::before { left: -2px; }
.cap-left::after { right: 0; }
.cap-right::before { right: -2px; }
.cap-right::after { left: 0; }

.dials {
  position: relative;
  z-index: 3;
  display: flex;
  height: 61px;
  border-block: 3px solid var(--olive-dark);
  border-radius: 8px;
  background: var(--olive-dark);
  overflow: hidden;
}

.dials::after {
  position: absolute;
  z-index: 4;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(37,35,17,.64), rgba(37,35,17,.12) 22%, transparent 38%, rgba(255,255,255,.15) 46%, transparent 59%, rgba(37,35,17,.15) 78%, rgba(37,35,17,.65));
}

.dial {
  position: relative;
  width: 39px;
  height: 55px;
  border-right: 2px solid var(--olive-dark);
  border-left: 1px solid var(--brass);
  background: linear-gradient(90deg, rgba(70,65,30,.26), transparent 12%, rgba(255,255,255,.18) 18%, transparent 24% 80%, rgba(70,65,30,.28)), linear-gradient(to bottom, #817a43, #c4ba7b 20%, #eee2ad 48%, #c4ba7b 77%, #817a43);
}

.dial:first-child { border-left: 2px solid var(--olive-dark); }

.dial-window {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.dial-track {
  position: absolute;
  inset: 0;
  display: block;
  transform: rotateX(0deg);
  transform-style: preserve-3d;
  will-change: transform;
}

.dial-track span {
  position: absolute;
  top: calc(50% - 11px);
  left: 0;
  display: grid;
  width: 100%;
  height: 22px;
  place-items: center;
  color: var(--ink);
  font: 700 23px/1 var(--serif);
  text-shadow: 0 1px rgba(255,255,255,.45);
  backface-visibility: hidden;
}

main {
  display: flow-root;
  margin-top: 34px;
}

.navigation {
  display: flex;
  gap: 12px;
}

.navigation a {
  color: var(--muted);
  font: 400 12px/1.5 var(--sans);
  text-decoration: none;
  text-underline-offset: 5px;
}

.navigation a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.portfolio-section {
  clear: both;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.portfolio-section h2 {
  margin: 0 0 12px;
  color: var(--heading);
  font: 400 24px/1.2 var(--serif);
}

.academic-subcategory + .academic-subcategory {
  margin-top: 20px;
}

.academic-subcategory h3 {
  margin: 0 0 6px;
  color: var(--heading);
  font: 500 14px/1.6 var(--sans);
}

.portfolio-section p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.portfolio-section .security-belt,
.portfolio-section .disclosures-link {
  margin-top: 12px;
}

.certifications {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  gap: 0 24px;
}

.portfolio-section .certifications p {
  margin: 0;
  overflow-wrap: anywhere;
}

#ai p + p {
  margin-top: 1.6em;
}

.ctf-events {
  margin: 1.6em 0;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  list-style: none;
}

.ctf-events li { display: inline; }
.ctf-events li + li::before { content: " · "; }

.ctf-highlights {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.ctf-highlights > div {
  flex: 1 1 260px;
  min-width: 0;
}

.ctf-results {
  margin-left: auto;
  text-align: left;
}

#socials {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.social-links {
  display: flex;
  align-items: center;
  gap: clamp(10px, 3vw, 24px);
}

#socials .copyright,
#socials .social-links {
  margin: 0;
  font-size: 12px;
  white-space: nowrap;
}

.profile-photo {
  float: right;
  width: clamp(88px, 22vw, 120px);
  aspect-ratio: 1;
  margin: 0 0 16px 24px;
  border: 4px solid var(--photo-border);
  background: rgba(72, 58, 31, 0.04);
  object-fit: cover;
}

.intro {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.75;
}

.sr-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 620px) {
  .site {
    width: calc(100% - 32px);
    padding: 24px 0 32px;
  }

  header {
    flex-direction: column;
    gap: 16px;
  }

  .dial { width: clamp(30px, 8vw, 39px); }
  .cap { width: clamp(24px, 6vw, 31px); }

  .navigation {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 8px;
  }

  .navigation a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 3px;
    font-size: 14px;
  }

  main { margin-top: 24px; }

  .profile-photo {
    display: block;
    float: none;
    width: 112px;
    height: 112px;
    margin: 0 auto 20px;
  }

  .intro {
    font-size: 16px;
    line-height: 1.7;
  }

  .portfolio-section {
    margin-top: 24px;
    padding-top: 24px;
    overflow-wrap: anywhere;
  }

  .portfolio-section p,
  .academic-subcategory h3,
  .ctf-events {
    font-size: 15px;
    line-height: 1.65;
  }

  .portfolio-section p + p { margin-top: 8px; }
  .certifications { row-gap: 8px; }
  .academic-subcategory h3 { margin-bottom: 10px; }
  .portfolio-section .security-belt { margin-top: 16px; }

  .ctf-highlights {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .ctf-highlights > div { flex: none; }
  .ctf-results { margin-left: 0; }

  .ctf-events {
    display: grid;
    gap: 10px;
  }

  .ctf-events li { display: block; }
  .ctf-events li + li::before { content: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
