/* Shared components. Hero and profile layout live in field-note.css. */

/* Glass header and navigation */
.header {
  position: sticky;
  top: var(--header-offset);
  z-index: 30;
  width: min(var(--container), calc(100% - 2 * var(--page-gutter)));
  margin: var(--header-offset) auto 0;
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
  transition: box-shadow .2s ease;
}

.header.is-scrolled {
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  min-height: var(--header-height);
  padding: 10px 16px;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  white-space: nowrap;
  color: var(--accent);
  font: 700 20px / 1.3 var(--font-mono);
  letter-spacing: -.055em;
}

.brand-mark .brand-syntax { color: var(--accent); }
.brand-mark .brand-name { padding-inline: .12em; color: var(--text); }
.brand { white-space: nowrap; }
.brand-mark { white-space: nowrap; }

@media (max-width: 520px) {
  .brand-mark { font-size: 18px; }
}

.navigation {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  opacity: 0;
  transition: transform .32s ease, width .32s ease, height .32s ease, opacity .16s ease;
}

.nav-indicator.is-visible {
  opacity: 1;
}

.navigation a {
  position: relative;
  z-index: 1;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  transition: color .2s, background-color .2s, border-color .2s;
}

.navigation a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.navigation a[aria-current="location"] {
  border-color: var(--glass-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: 600 14px / 1 var(--font-mono);
}

.icon-button:hover {
  border-color: var(--accent);
}

.menu-button {
  display: none;
}

.scroll-track {
  position: absolute;
  bottom: -1px;
  left: 22px;
  width: calc(100% - 44px);
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
}

#scroll-progress {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 650;
  transition: transform .2s, border-color .2s;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface-2);
}

.button-secondary:hover {
  border-color: var(--accent);
}

.text-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.skill-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px;
  border: 1px solid rgb(128 214 197 / 17%);
  border-radius: 20px;
  background: var(--surface);
  transition: transform .2s, border-color .2s;
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.skill-symbol {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--accent);
  font: 700 14px / 1 var(--font-mono);
}

.skill-card:nth-child(2) .skill-symbol {
  color: var(--gold);
}

.skill-card:nth-child(3) .skill-symbol {
  color: var(--blue);
}

.skill-card h3 {
  min-height: 2.4em;
  margin-bottom: 9px;
  font-size: 17px;
}

.skill-card p {
  color: var(--muted);
  font-size: 14px;
}

.skill-card .tags {
  margin-top: auto;
}

.skill-card .tag {
  padding: 3px 7px;
  border-color: rgb(128 214 197 / 18%);
  border-radius: 999px;
  color: #80d6c5;
  font-size: 9px;
}

.skills-marquee {
  display: grid;
  gap: 9px;
  margin-top: 22px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.skill-marquee-row { overflow: hidden; }
.skill-marquee-track {
  display: flex;
  width: max-content;
  gap: 10px;
  animation: skills-marquee 58s linear infinite;
}
.skill-marquee-row.is-reverse .skill-marquee-track { animation-direction: reverse; animation-duration: 64s; }
.skill-marquee-group { display: flex; flex: 0 0 auto; gap: 10px; }
.skill-marquee-tag {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 5px 11px;
  border: 1px solid rgb(128 214 197 / 15%);
  border-radius: 999px;
  background: rgb(23 37 59 / 78%);
  color: #80d6c5;
  font: 10px / 1.2 var(--font-mono);
  white-space: nowrap;
}
.skill-marquee-tag::before { width: 4px; height: 4px; margin-right: 7px; border-radius: 50%; background: #80d6c5; content: ""; }
.skill-marquee-tag.is-accent { color: #e4b77a; border-color: rgb(228 183 122 / 24%); }
.skill-marquee-tag.is-accent::before { background: #e4b77a; }
@keyframes skills-marquee { to { transform: translateX(calc(-50% - 5px)); } }
@media (prefers-reduced-motion: reduce) { .skill-marquee-track { animation: none; } }

.lab-research { scroll-margin-top: calc(var(--header-height) + 34px); }
.research-focus-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.research-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 250px; padding: clamp(20px, 2.5vw, 28px); border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, var(--accent-soft), transparent 46%), var(--surface); transition: border-color .2s, transform .2s; }
.research-card:hover { transform: translateY(-3px); border-color: var(--glass-border); }
.research-index { margin-bottom: 18px; color: var(--accent); font: 12px / 1 var(--font-mono); }
.research-card h3 { margin-bottom: 12px; font-size: clamp(17px, 1.5vw, 20px); }
.research-card p { flex: 1; color: var(--muted); font-size: 14px; line-height: 1.75; }
.research-card .tags { margin-top: 12px; }
.research-status { position: absolute; top: 16px; right: 14px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--gold); font: 9px / 1.3 var(--font-mono); }

/* Reveal content only after JavaScript has initialized the observer. */
.reveal-enabled [data-reveal] {
  opacity: 0;
  translate: 0 18px;
  transition: opacity .5s ease, translate .5s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-enabled [data-reveal].is-visible {
  opacity: 1;
  translate: 0 0;
}

/* Projects */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-button {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}

.filter-button:hover,
.filter-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

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

.certifications-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
}

.certification-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.certification-image {
  width: 100%;
  max-height: 220px;
  border-bottom: 1px solid var(--line);
  object-fit: cover;
}

.certification-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: flex-start;
  padding: 22px;
}

.certification-issuer {
  margin-bottom: 8px;
  color: var(--accent);
  font: 11px / 1.6 var(--font-mono);
  text-transform: uppercase;
}

.certification-body h3 {
  margin-bottom: 12px;
  font-size: 20px;
}

.certification-description {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.certification-meta {
  display: grid;
  gap: 12px;
  width: 100%;
  margin: auto 0 18px;
}

.certification-meta > div {
  min-width: 0;
}

.certification-meta dt {
  color: var(--muted);
  font: 10px / 1.5 var(--font-mono);
  text-transform: uppercase;
}

.certification-meta dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.certification-empty-state {
  grid-column: 1 / -1;
}

.project-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .2s, border-color .2s;
}

.project-card::before,
.project-card::after { z-index: 0; pointer-events: none; }
.project-art,
.project-body { position: relative; z-index: 1; }

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.project-art {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 180px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse at 90% 15%, var(--accent-soft), transparent 70%), var(--surface-2);
}

.project-art-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 1;
  z-index: 0;
}

.project-art-fallback {
  position: relative; z-index: 0; display: grid; gap: 9px; width: 100%; min-height: 180px;
  align-content: center; padding: 16px 18px; border: 1px solid rgb(128 214 197 / 20%); border-radius: 12px;
  background: linear-gradient(145deg, rgb(8 20 31 / 96%), rgb(13 29 43 / 96%)); color: #b8d8d2;
  font: 10px / 1.5 var(--font-mono); box-shadow: inset 0 0 30px rgb(31 176 145 / 9%);
}
.project-art-fallback[hidden] { display: none; }
.project-art-fallback-header { display: flex; justify-content: space-between; color: #80d6c5; }
.project-art-fallback-status { color: #e4b77a; }
.project-art-fallback-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.project-art-fallback-grid span { padding: 6px 8px; border: 1px solid rgb(128 214 197 / 14%); background: rgb(128 214 197 / 4%); }
.project-art-fallback-bar { height: 5px; border-radius: 99px; background: linear-gradient(90deg, #36c5a1 68%, rgb(128 214 197 / 12%) 68%); }
.project-art-fallback-log { color: #829aab; }
.project-art-fallback-log b { color: #e4b77a; }

.project-art-github {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(8 15 29 / 94%);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 6px));
  transition: opacity .2s, transform .2s, border-color .2s;
  white-space: nowrap;
}

.project-card:hover .project-art-github,
.project-card:focus-within .project-art-github {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.project-art-github:hover {
  border-color: var(--accent);
}

@media (hover: none) {
  .project-art-github {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%);
  }
}

.project-detail-figure {
  margin: 24px 0 28px;
}

.project-detail-image {
  width: 100%;
  max-height: min(56vh, 460px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  object-fit: contain;
  object-position: top center;
}

.project-detail-figure figcaption {
  margin-top: 9px;
  color: var(--muted);
  font: 11px / 1.6 var(--font-mono);
}

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
}

.project-category {
  margin-bottom: 14px;
  color: var(--accent);
  font: 11px / 1.7 var(--font-mono);
}

.project-body h3 {
  margin-bottom: 14px;
  font-size: 23px;
  overflow-wrap: anywhere;
}

.project-body > p {
  color: var(--muted);
  font-size: 14px;
}

.project-body .tags {
  margin-top: auto;
  padding-top: 8px;
}

.project-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
  font-size: 14px;
}

.project-button span:last-child {
  color: var(--accent);
  font-size: 22px;
}

/* CTF dashboard */
.ctf-dashboard {
  padding: clamp(16px, 2.2vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--accent-soft), transparent 42%), var(--surface);
}

.ctf-dashboard-header,
.ctf-dashboard-meta,
.ctf-team-identity {
  display: flex;
  align-items: center;
}

.ctf-dashboard-header {
  justify-content: space-between;
  gap: 16px;
}

.ctf-dashboard-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.ctf-dashboard-header .panel-label {
  margin: 0;
  color: var(--accent);
}

.ctf-updated {
  margin: 0;
  color: var(--muted);
  font: 11px / 1.5 var(--font-mono);
}

.ctf-dashboard-meta {
  display: grid;
  grid-template-columns: minmax(190px, .8fr) minmax(0, 1.8fr);
  align-items: center;
  gap: 20px;
  margin-block: 18px 20px;
}

.ctf-team-identity {
  min-width: 0;
  gap: 14px;
}

.team-emblem {
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--bg);
  color: var(--accent);
  font: 24px / 1 var(--font-mono);
}

.ctf-team-identity h3 {
  margin: 0 0 3px;
  font-size: 21px;
}

.ctf-team-meta {
  margin: 0;
  color: var(--muted);
  font: 12px / 1.5 var(--font-mono);
}

.ctf-country-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 5px;
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.ctf-country-flag {
  border: 0;
  padding: 0;
  background: transparent;
}

.ctf-country-flag-image {
  display: inline-block;
  width: auto;
  height: 14px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.stat {
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 0;
  min-height: 62px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgb(8 15 29 / 55%);
  text-align: center;
}

.stat strong {
  color: var(--accent);
  font: 700 20px / 1.25 var(--font-mono);
}

.stat-rating strong {
  color: var(--blue);
}

.stat-placement strong {
  color: var(--gold);
}

.stat-global strong {
  color: var(--accent);
}

.stat span {
  margin-top: 4px;
  color: var(--muted);
  font: 9px / 1.4 var(--font-mono);
  letter-spacing: .04em;
}

.ctf-stream-label {
  margin: 0 0 9px;
  color: var(--muted);
  font: 11px / 1.5 var(--font-mono);
  letter-spacing: .1em;
}

.ctf-stream-label span {
  color: var(--accent);
}

.ctf-records {
  display: grid;
  gap: 7px;
  width: 100%;
  min-width: 0;
}

.ctf-record {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .6fr) 64px minmax(0, 100px);
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgb(8 15 29 / 55%);
  transition: border-color .2s, background-color .2s;
}

.ctf-record:hover {
  border-color: var(--accent);
  background: var(--bg);
}

.ctf-record h3 {
  min-width: 0;
  overflow-wrap: anywhere;
  margin: 0 0 2px;
  font-size: 14px;
}

.ctf-record time {
  color: var(--muted);
  font: 10px / 1.4 var(--font-mono);
}

.ctf-points strong,
.ctf-points span {
  display: block;
  font-family: var(--font-mono);
}

.ctf-points strong {
  color: var(--blue);
  font-size: 12px;
}

.ctf-points span {
  color: var(--accent);
  font-size: 10px;
}

.ctf-rank {
  color: var(--accent);
  font: 700 13px / 1.4 var(--font-mono);
  text-align: right;
}
.ctf-rank.is-top-rank { color: var(--gold); }

.ctf-row-link {
  min-width: 0;
  text-align: right;
}

.ctf-row-link .text-link {
  font: 11px / 1.4 var(--font-mono);
}
.ctf-row-link .ctf-scoreboard-link { display: inline; padding: 0; border: 0; border-radius: 0; background: transparent; text-decoration: none; white-space: nowrap; }
.footer .footer-handle { font-family: var(--font-mono); font-weight: 700; letter-spacing: .02em; }

.ctf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ctf-actions:empty {
  display: none;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  font-size: 14px;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

/* Contact and footer */
.contact-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 4vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--accent-soft), transparent 75%), var(--surface);
}

.contact-panel > :not(.contact-decoration) {
  position: relative;
}

.contact-panel h2 {
  max-width: 720px;
}

.contact-panel > p:not(.eyebrow) {
  max-width: 580px;
  color: var(--muted);
}

.contact-decoration {
  position: absolute;
  top: 24px;
  right: 32px;
  color: var(--line);
  font-size: clamp(70px, 10vw, 130px);
  line-height: 1;
  pointer-events: none;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-block: 26px 18px;
}

.social-link {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  transition: transform .2s, border-color .2s;
}

.social-link svg {
  width: 23px;
  height: 23px;
}

.social-link[href]:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  color: var(--accent);
}

.social-link[aria-disabled="true"] {
  opacity: .45;
}

#contact-note {
  margin-bottom: 0;
}

#contact-note:empty {
  display: none;
}

.contact-form {
  display: grid;
  gap: 18px;
  max-width: 880px;
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.contact-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.contact-form h3 {
  margin-bottom: 0;
  font-size: 20px;
}

.contact-form-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.contact-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font: 11px / 1.6 var(--font-mono);
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: 14px / 1.6 var(--font-sans);
  transition: border-color .2s, background-color .2s;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
  color: var(--muted);
  opacity: .72;
}

.contact-field input:focus,
.contact-field textarea:focus {
  border-color: var(--accent);
  background: var(--surface-2);
  outline: none;
}

.contact-field textarea {
  min-height: 132px;
  resize: vertical;
}

.contact-field-message {
  grid-column: 1 / -1;
}

.contact-form-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.contact-form-hint,
.contact-form-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.contact-form-status:not(:empty) {
  margin-top: 6px;
  color: var(--accent);
}

@media (max-width: 600px) {
  .contact-form-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-field-message {
    grid-column: auto;
  }

  .contact-form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .contact-form-footer .button {
    justify-content: center;
  }
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 26px 32px;
  border-top: 1px solid var(--line);
}

.footer p,
.footer > a:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* Project dialog */
dialog {
  position: fixed;
  width: min(680px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  padding: 36px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgb(5 12 23 / 78%);
  backdrop-filter: blur(5px);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 25px;
}

#dialog-content {
  padding-top: 28px;
}

#dialog-content h2 {
  font-size: clamp(26px, 4vw, 32px);
}

#dialog-content h3 {
  margin-top: 26px;
  font-size: 18px;
}

#dialog-content p,
#dialog-content li {
  color: var(--muted);
  font-size: 15px;
}

#dialog-content ul {
  padding-left: 22px;
}

#dialog-content li {
  margin-bottom: 10px;
}

/* Breakpoints change layout only; component appearance stays above. */
@media (max-width: 1100px) {
  .skills-grid,
  .projects-grid,
  .certifications-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .research-focus-grid { grid-template-columns: minmax(0, 1fr); }
  .ctf-dashboard-meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .ctf-record { grid-template-columns: minmax(0, 1fr) auto auto; gap: 9px; }
  .ctf-record > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .header-inner {
    gap: 12px;
    padding: 9px 12px;
  }

  .header-actions {
    margin-left: auto;
  }

  .menu-button {
    display: inline-grid;
  }

  .navigation {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: none;
    align-items: stretch;
    gap: 4px;
    max-height: calc(100dvh - 110px);
    margin: 0;
    padding: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .navigation.is-open {
    display: grid;
  }

  .navigation a {
    min-height: 46px;
    padding: 10px 14px;
  }

}

@media (max-width: 600px) {
  .skills-grid,
  .projects-grid,
  .certifications-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ctf-record {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px;
  }
  .ctf-record > div:first-child { grid-column: 1 / -1; }
  .ctf-points { grid-column: 1; min-width: 0; overflow-wrap: anywhere; }
  .ctf-rank { grid-column: 2; grid-row: 2; }
  .ctf-row-link { grid-column: 1 / -1; text-align: left; }

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

  .ctf-record > div:first-child {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    grid-column: 1 / -1;
    gap: 8px;
  }

  .ctf-record time {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .ctf-dashboard-header {
    align-items: flex-start;
  }

  .ctf-dashboard-tools {
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
  }

  .ctf-points strong {
    font-size: 11px;
  }

  .ctf-rank {
    font-size: 12px;
  }

  .ctf-row-link .text-link {
    font-size: 10px;
  }

  .contact-decoration {
    right: 20px;
  }

  .footer {
    justify-content: center;
    text-align: center;
  }

  .footer p {
    width: 100%;
  }

  dialog {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-enabled [data-reveal] {
    opacity: 1;
    translate: none;
    transition: none;
  }

  .skill-card:hover,
  .project-card:hover,
  .button:hover,
  .social-link[href]:hover {
    transform: none;
  }
}
