:root {
  --ink: #1A1A1A;
  --paper: #FAF9F6;
  --parchment: #F0EDE6;
  --red: #C0392B;
  --green: #2D6A4F;
  --gray: #6B6B6B;
  --line: #D8D4CC;
  --slate: #2C2C2C;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--parchment);
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray);
}

/* Progress bar */
#portcv-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--red);
  z-index: 1000;
  transition: width 0.1s linear;
}

/* Back to top */
#back-to-top {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 999;
}
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
#back-to-top:hover {
  background: var(--red);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(250, 249, 246, 0.95);
  backdrop-filter: blur(5px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
}

.brand-mark {
  font-size: 1.5rem;
  color: var(--red);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  position: relative;
  padding: 0.5rem 0;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--red);
  transition: width 0.3s;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

/* Sections */
section {
  padding: 6rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--gray);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--paper);
  transform: translateY(100%);
  transition: transform 0.8s var(--ease-out-expo);
}

.section-title.revealed::after {
  transform: translateY(0);
}

.section-intro {
  font-size: 1.1rem;
  color: var(--gray);
  max-width: 700px;
  margin-bottom: 3rem;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 60% 40%;
  align-items: center;
  gap: 2rem;
  padding: 8rem 2rem 4rem;
  position: relative;
}

.hero-content {
  animation: fadeUp 1s var(--ease-out-expo) both;
}

.hero-metadata {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--gray);
  margin-bottom: 2rem;
  animation: typeIn 1s steps(30) both;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1;
  margin-bottom: 1rem;
  animation: maskReveal 1s var(--ease-out-expo) both;
}

.reg-mark {
  font-size: 0.5em;
  vertical-align: super;
  color: var(--red);
  display: inline-block;
  cursor: help;
  transition: transform 0.3s;
}

.reg-mark:hover {
  transform: rotate(15deg);
}

.hero-specialization {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--slate);
  margin-bottom: 1.5rem;
  animation: fadeUp 1s 0.4s var(--ease-out-expo) both;
}

.hero-value {
  font-size: 1.1rem;
  color: var(--gray);
  max-width: 600px;
  margin-bottom: 2rem;
  animation: fadeUp 1s 0.6s var(--ease-out-expo) both;
}

.hero-proof {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--green);
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
  animation: fadeUp 1s 0.8s var(--ease-out-expo) both;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 0.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  animation: fadeUp 1s 1s var(--ease-out-expo) both;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  border: 1px solid var(--ink);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.btn-primary:hover::before,
.btn-primary:focus-visible::before {
  transform: scaleX(1);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--parchment);
}

.hero-image {
  position: relative;
  animation: fadeIn 1s 1.2s var(--ease-out-expo) both;
}

.photo-frame {
  border: 2px solid var(--ink);
  outline: 1px solid var(--line);
  outline-offset: 4px;
  padding: 0.5rem;
  background: var(--paper);
  max-width: 300px;
  margin: 0 auto;
}

.photo-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/5;
  object-fit: cover;
  filter: sepia(0.2) contrast(1.05);
}

.photo-frame figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.photo-note {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gray);
  margin-top: 1rem;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  animation: pulse 2s ease-in-out infinite;
}

.scroll-line {
  display: block;
  width: 1px;
  height: 40px;
  background: var(--ink);
  margin: 0 auto 0.5rem;
}

.scroll-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--gray);
}

.hero-next {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gray);
  letter-spacing: 0.1em;
}

/* Specialization */
.specialization {
  background: var(--parchment);
}

.class-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

.class-entry {
  background: var(--paper);
  padding: 2rem;
  border: 1px solid var(--line);
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}

.class-entry::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--red);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s;
}

.class-entry:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.class-entry:hover::before {
  transform: scaleY(1);
}

.class-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gray);
  letter-spacing: 0.1em;
}

.class-entry h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0.5rem 0;
}

.class-entry p {
  color: var(--gray);
  font-size: 0.95rem;
}

.status-stamp {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--green);
  border: 2px solid var(--green);
  padding: 0.2rem 0.5rem;
  transform: rotate(-5deg);
  opacity: 0.8;
  transition: transform 0.3s;
}

.class-entry:hover .status-stamp {
  transform: rotate(0deg) scale(1.1);
}

/* Process */
.process {
  position: relative;
}

.process-timeline {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
}

.timeline-rail {
  position: relative;
}

.rail-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
  transform: translateX(-50%);
}

.rail-line::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0%;
  background: var(--red);
  transition: height 0.1s linear;
}

.timeline-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.6s, transform 0.6s;
}

.step.visible {
  opacity: 1;
  transform: translateX(0);
}

.step-number {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--red);
  flex-shrink: 0;
}

.step-content h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.step-content p {
  color: var(--gray);
}

/* Experience */
.experience {
  background: var(--parchment);
}

.experience-files {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.file-entry {
  display: grid;
  grid-template-columns: 200px 1fr 100px;
  gap: 2rem;
  align-items: center;
  background: var(--paper);
  padding: 2rem;
  border: 1px solid var(--line);
  position: relative;
  transition: box-shadow 0.3s;
}

.file-entry:hover {
  box-shadow: var(--shadow);
}

.file-meta {
  display: flex;
  flex-direction: column;
}

.file-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gray);
}

.file-role {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-top: 0.5rem;
  position: relative;
}

.file-role::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--red);
  transition: width 0.3s;
}

.file-entry:hover .file-role::after {
  width: 100%;
}

.file-description p {
  color: var(--gray);
}

.file-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.8rem;
  border: 2px solid;
  text-align: center;
  transform: rotate(-5deg);
}

.file-status:first-of-type {
  color: var(--green);
  border-color: var(--green);
}

.file-status:not(:first-of-type) {
  color: var(--gray);
  border-color: var(--gray);
}

/* Filings */
.filings-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-auto-rows: minmax(300px, auto);
  gap: 1.5rem;
}

.filing-item {
  background: var(--paper);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}

.filing-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.filing-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  filter: sepia(0.2) contrast(1.05);
  transition: transform 0.3s;
}

.filing-item:hover img {
  transform: scale(1.05);
}

.filing-content {
  padding: 1.5rem;
}

.filing-ref {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gray);
  letter-spacing: 0.1em;
}

.filing-content h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0.5rem 0;
}

.filing-content p {
  color: var(--gray);
  font-size: 0.9rem;
}

.filing-large {
  grid-row: span 2;
}

.filing-large img {
  height: 400px;
}

.filing-medium {
  grid-column: 2;
}

.filing-small {
  grid-column: 2;
}

/* Skills */
.skills-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.skill-group {
  padding: 2rem;
  background: var(--paper);
  border: 1px solid var(--line);
}

.group-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--red);
  margin-bottom: 1.5rem;
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skill-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  padding-left: 1.5rem;
  transition: padding-left 0.3s;
}

.skill-list li::before {
  content: '®';
  position: absolute;
  left: 0;
  color: var(--red);
  opacity: 0;
  transition: opacity 0.3s;
}

.skill-list li:hover,
.skill-list li:focus-within {
  padding-left: 2rem;
}

.skill-list li:hover::before,
.skill-list li:focus-within::before {
  opacity: 1;
}

/* Contact */
.contact {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  background: var(--slate);
  color: var(--paper);
}

.contact-rail {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-watermark {
  font-size: 8rem;
  color: var(--red);
  opacity: 0.2;
  line-height: 1;
}

.contact-content {
  max-width: 600px;
}

.contact .section-title {
  color: var(--paper);
}

.contact .section-intro {
  color: var(--line);
}

#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--line);
}

.form-group input,
.form-group textarea {
  padding: 0.8rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--red);
}

#button-contact-form {
  padding: 1rem;
  background: var(--red);
  color: var(--paper);
  border: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.3s;
}

#button-contact-form:hover {
  background: var(--ink);
}

.contact-alt {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--line);
}

.contact-alt a {
  color: var(--red);
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-mark {
  font-size: 2rem;
  color: var(--red);
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes maskReveal {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes typeIn {
  from {
    width: 0;
    overflow: hidden;
  }
  to {
    width: 100%;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--paper);
    padding: 4rem 2rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }

  .nav-toggle {
    display: block;
    z-index: 100;
  }

  .nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 6rem;
    text-align: center;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .hero-image {
    order: -1;
    margin-bottom: 2rem;
  }

  .hero-next {
    display: none;
  }

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

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

  .timeline-rail {
    display: none;
  }

  .file-entry {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .file-status {
    justify-self: start;
  }

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

  .filing-large,
  .filing-medium,
  .filing-small {
    grid-column: auto;
    grid-row: auto;
  }

  .filing-large img {
    height: 200px;
  }

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

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

  .contact-rail {
    flex-direction: row;
    align-items: center;
  }

  .contact-watermark {
    font-size: 4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .step {
    opacity: 1;
    transform: none;
  }
}
button:not(:disabled),[role="button"]{cursor:pointer}button:disabled{cursor:not-allowed}