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

:root {
  --bg: #080808;
  --bg-elevated: #111111;
  --panel: #141414;
  --card: #161616;
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(212, 168, 83, 0.35);
  --text: #f4f4f5;
  --dim: #a1a1aa;
  --muted: #71717a;
  --accent: #d4a853;
  --accent-hover: #e8c078;
  --accent-dim: rgba(212, 168, 83, 0.12);
  --aws-orange: #ff9900;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-display: 'Fraunces', Georgia, serif;
}

html {
  scroll-behavior: smooth;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  overflow: visible;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(212, 168, 83, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255, 255, 255, 0.02), transparent);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.025) 2px,
    rgba(0, 0, 0, 0.025) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

.window {
  max-width: 880px;
  margin: 48px auto;
  padding: 0 20px 64px;
  filter: drop-shadow(var(--shadow));
}

.shell {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dots {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

.title-text {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.tabs {
  display: flex;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab {
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 2px solid transparent;
  background: transparent;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.tab:hover {
  color: var(--accent-hover);
  background: var(--accent-dim);
}

.tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tab.active {
  color: var(--accent);
  background: var(--bg);
  border-bottom-color: var(--accent);
  font-weight: 500;
}

.terminal {
  background: var(--bg);
  padding: 36px 40px;
  min-height: 520px;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.section.active > * {
  animation: fadeIn 0.35s ease both;
}

.section.active > *:nth-child(2) { animation-delay: 0.04s; }
.section.active > *:nth-child(3) { animation-delay: 0.08s; }
.section.active > *:nth-child(4) { animation-delay: 0.12s; }
.section.active > *:nth-child(5) { animation-delay: 0.16s; }
.section.active > *:nth-child(6) { animation-delay: 0.2s; }

/* —— Home dashboard —— */
.home {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-hero {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 24px 28px;
  align-items: start;
  margin-bottom: 0;
}

.home-hero.card:hover {
  transform: none;
}

.home-avatar {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 34px;
  font-weight: 300;
  color: var(--accent);
  background: linear-gradient(160deg, rgba(212, 168, 83, 0.12) 0%, var(--card) 100%);
  border: 1px solid var(--border-accent);
}

.home-hero__main {
  min-width: 0;
}

.home-hero .big-name {
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
  line-height: 1.3;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.home-hero .name-surname {
  color: var(--aws-orange);
}

.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 12px;
}

.home-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
}

.home-hero .role-line {
  margin-bottom: 14px;
}

.home-hero .role-line::before {
  content: none;
}

.home-hero .bio {
  margin-bottom: 12px;
  max-width: none;
}

.home-location {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 20px;
}

.home-actions {
  margin-top: 4px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
}

.home-card-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 16px;
}

.home-card-label::before {
  content: '# ';
  color: var(--muted);
}

.home-metrics,
.home-stack {
  margin-bottom: 0;
}

.home-metrics__list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 16px;
}

.home-metrics__list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-metrics__list strong {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  font-family: var(--font-mono);
}

.home-metrics__list span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.home-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.home-chip {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--dim);
  background: rgba(255, 255, 255, 0.02);
}

.home-link-more {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.home-link-more:hover {
  color: var(--accent-hover);
}

.home-link-more:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#home .card:hover {
  transform: none;
}

.prompt {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 28px;
  font-size: 12px;
}

.prompt-user { color: var(--dim); }
.prompt-at,
.prompt-sep,
.prompt-dollar { color: var(--muted); }
.prompt-host { color: var(--text); }
.prompt-path { color: var(--accent); }
.prompt-dollar { margin-left: 4px; margin-right: 8px; }
.prompt-cmd { color: var(--text); }

.comment {
  color: var(--muted);
  font-style: italic;
  margin-bottom: 16px;
  font-size: 12px;
}

.comment::before {
  content: '# ';
}

.card,
.skill-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.card {
  padding: 24px;
}

.card:hover,
.skill-block:hover {
  border-color: var(--border-accent);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.skill-block {
  padding: 18px 20px;
}


.big-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(36px, 7vw, 48px);
  font-weight: 600;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.big-name span {
  color: var(--accent);
}

.role-line {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 20px;
}

.role-line::before {
  content: '→ ';
  color: var(--muted);
}

.bio {
  color: var(--dim);
  max-width: 52ch;
  line-height: 1.75;
  margin-bottom: 0;
  font-size: 13px;
}

.kv-list {
  margin-bottom: 0;
}

.kv {
  display: flex;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 0;
}

.kv-key {
  color: var(--accent);
  min-width: 120px;
  flex-shrink: 0;
}

.kv-eq {
  color: var(--muted);
  margin: 0 10px;
}

.kv-val {
  color: var(--text);
  word-break: break-word;
}

.kv-val a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.kv-val a:hover {
  color: var(--accent-hover);
}

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

.cmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
  border: 1px solid;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.cmd-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cmd-btn-primary {
  border-color: var(--accent);
  color: var(--accent);
}

.cmd-btn-primary:hover {
  background: var(--accent);
  color: var(--bg);
}

.cmd-btn-secondary {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--dim);
}

.cmd-btn-secondary:hover {
  border-color: var(--dim);
  color: var(--text);
}

.terminal-cursor {
  margin-top: 32px;
  color: var(--muted);
  font-size: 12px;
}

.terminal-cursor--tight {
  margin-top: 16px;
}

.terminal-cursor--loose {
  margin-top: 24px;
}

.blink {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 4px;
  opacity: 1;
  animation: terminal-blink 1s step-end infinite;
}

.exp-block {
  position: relative;
  margin-bottom: 32px;
  padding-left: 28px;
}

.exp-block::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.exp-block::after {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 9px;
  height: 9px;
  background: var(--accent);
  border: 2px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.exp-title-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.exp-role {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.exp-period {
  font-size: 11px;
  color: var(--muted);
}

.exp-company {
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 12px;
}

.exp-company::before {
  content: '@ ';
  color: var(--muted);
}

.exp-points {
  list-style: none;
  padding: 0;
}

.exp-points li {
  color: #d4d4d8;
  font-size: 12px;
  line-height: 1.75;
  padding-left: 16px;
  position: relative;
  margin-bottom: 4px;
}

.exp-points li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 10px;
  top: 3px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

.skill-category {
  color: var(--dim);
  font-size: 11px;
  margin-bottom: 10px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.skill-category::before,
.skill-category::after {
  color: var(--muted);
}

.skill-category::before { content: '['; }
.skill-category::after { content: ']'; }

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stag {
  padding: 5px 12px;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--dim);
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

/* —— Projects & academic (compact cards) —— */
.projects-list,
.academic-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-item,
.academic-item {
  position: relative;
  padding: 14px 16px 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.project-item::before,
.academic-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(to bottom, var(--accent), transparent);
  opacity: 0.65;
}

.project-item:hover,
.academic-item:hover {
  border-color: var(--border-accent);
  background: rgba(22, 22, 22, 0.95);
}

.project-item__head,
.academic-item__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.project-item__num,
.academic-item__num {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.project-item__title,
.academic-item__title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.project-item__link {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.project-item__link:hover {
  color: var(--accent-hover);
}

.academic-item__status {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.academic-item__status::before {
  content: '● ';
  font-size: 8px;
  vertical-align: middle;
}

.academic-item__status--muted {
  color: var(--muted);
}

.academic-item__status--muted::before {
  content: none;
}

.project-item__desc,
.academic-item__desc {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.65;
  margin-bottom: 10px;
  max-width: 62ch;
}

.academic-item__desc:last-child {
  margin-bottom: 0;
}

.project-item__tags,
.academic-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-item__tags .stag,
.academic-item__tags .stag {
  font-size: 10px;
  padding: 2px 8px;
}

.academic-group {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  margin: 4px 0 0;
}

.academic-group::before {
  content: '# ';
}

.academic-group:not(:first-child) {
  margin-top: 8px;
}

.academic-item--resume {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 18px;
}

.academic-item--resume::before {
  opacity: 0.4;
}

.academic-item--resume:hover {
  background: var(--card);
}

/* —— Contact (modern premium) —— */
.contact-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-hero {
  position: relative;
  padding: 22px 22px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse 100% 80% at 0% 0%, rgba(212, 168, 83, 0.1), transparent 55%),
    var(--card);
  overflow: hidden;
}

.contact-hero__glow {
  position: absolute;
  top: -40%;
  right: -20%;
  width: 55%;
  height: 120%;
  background: radial-gradient(circle, rgba(212, 168, 83, 0.08), transparent 70%);
  pointer-events: none;
}

.contact-hero__top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.contact-hero__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.contact-hero__label::before {
  content: '// ';
  color: var(--accent);
}

.contact-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #d4f4dd;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08);
}

.contact-hero__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.contact-hero__title {
  position: relative;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.25rem, 4vw, 1.55rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 10px;
}

.contact-hero__title em {
  font-style: italic;
  color: var(--accent-hover);
}

.contact-hero__text {
  position: relative;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.65;
  max-width: 46ch;
  margin-bottom: 18px;
}

.contact-hero__cta {
  position: relative;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.contact-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
  min-height: 104px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(8px);
  transition:
    border-color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.contact-tile--static {
  cursor: default;
}

.contact-tile:not(.contact-tile--static):hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  background: rgba(24, 22, 18, 0.95);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.contact-tile:not(.contact-tile--static):hover .contact-tile__icon {
  border-color: var(--border-accent);
  color: var(--accent-hover);
}

.contact-tile:not(.contact-tile--static):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.contact-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 11px;
  flex-shrink: 0;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--accent-dim);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-tile__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.contact-tile__value {
  font-size: 10px;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.contact-tile__value--stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-tile__muted {
  color: var(--muted);
  font-size: 9px;
}

.contact-tile--portfolio .contact-tile__value {
  word-break: break-all;
}

.contact-tile:not(.contact-tile--static) .contact-tile__value {
  color: var(--dim);
  transition: color 0.2s ease;
}

.contact-tile:not(.contact-tile--static):hover .contact-tile__value {
  color: var(--accent-hover);
}

.card-actions {
  margin-top: 0;
}

.statusbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 18px;
  font-size: 11px;
  color: var(--muted);
  background: var(--panel);
  border-top: 1px solid var(--border);
}

.statusbar span:nth-child(2) {
  color: var(--accent);
}

@keyframes terminal-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .section.active > *,
  body::after {
    animation: none;
  }

  /* Keep terminal cursor blinking — core UI, not decorative motion */
  .blink {
    animation: terminal-blink 1s step-end infinite;
  }

  .cmd-btn:hover,
  .card:hover,
  .skill-block:hover,
  .contact-tile:not(.contact-tile--static):hover {
    transform: none;
  }
}

@media (max-width: 820px) and (min-width: 601px) {
  .contact-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .contact-tile:nth-child(4) {
    grid-column: 1;
  }

  .contact-tile--portfolio {
    grid-column: 2 / 4;
  }
}

@media (max-width: 600px) {
  .window {
    margin: 0;
    padding: 0 0 40px;
    filter: none;
  }

  .shell {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .titlebar {
    border-radius: 0;
  }

  .terminal {
    padding: 24px 20px;
    min-height: 400px;
  }

  .kv-key {
    min-width: 96px;
  }

  .project-item__head,
  .academic-item__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-item__link,
  .academic-item__status {
    margin-left: 0;
  }

  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
    overflow-x: visible;
  }

  .contact-tile--portfolio {
    grid-column: 1 / -1;
  }

  .contact-hero {
    padding: 18px 16px;
  }

  .contact-hero__top {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-hero__cta {
    width: 100%;
    justify-content: center;
  }

  .statusbar {
    font-size: 10px;
    padding: 8px 14px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .home-hero__main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .home-hero .big-name {
    font-size: clamp(1.15rem, 5vw, 1.5rem);
    white-space: normal;
  }

  .home-actions {
    justify-content: center;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .home-metrics__list strong {
    font-size: 24px;
  }
}
