@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap");

:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --accent: #e10600;
  --border: rgba(245, 245, 245, 0.12);
  --font-display: "Syne", sans-serif;
  --font-body: "Manrope", sans-serif;
  --space: clamp(1rem, 2vw, 2rem);
  --wrap: min(1120px, calc(100% - 2 * var(--space)));
  --header-h: 4rem;
  /* Wide hexagon: flatter tips (shorter side points) */
  --frame-hex: polygon(5% 0%, 95% 0%, 100% 50%, 95% 100%, 5% 100%, 0% 50%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(225, 6, 0, 0.12), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(245, 245, 245, 0.04), transparent 50%),
    var(--bg);
  line-height: 1.6;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.wrap {
  width: var(--wrap);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space);
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--text);
  font: 600 0.9rem/1 var(--font-body);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--text);
  font: 600 0.95rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn--disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
  border-color: var(--border);
  background: transparent;
  color: var(--text-muted);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
  min-height: var(--header-h);
}

.mark {
  font: 700 1rem/1 var(--font-display);
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
}

.nav a {
  position: relative;
  color: var(--text-muted);
  text-decoration: none;
  font: 500 0.9rem/1 var(--font-body);
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--text);
}

.nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.55rem;
  left: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav a.is-active {
  color: var(--text);
}

.nav a.is-active::after {
  transform: scaleX(1);
}

.lang-toggle {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
}

.lang-toggle button {
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: 600 0.8rem/1 var(--font-body);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.lang-toggle button + button {
  border-left: 1px solid var(--border);
}

.lang-toggle button[aria-pressed="true"] {
  background: var(--bg-elevated);
  color: var(--text);
}

.lang-toggle button:hover:not([aria-pressed="true"]) {
  color: var(--text);
}

/* Hero */

.hero {
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--header-h));
  padding-block: clamp(2rem, 6vw, 4rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

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

.hero--ready .hero-copy > * {
  animation: hero-enter 0.65s ease both;
}

.hero--ready .hero-copy > :nth-child(2) {
  animation-delay: 0.1s;
}

.hero--ready .hero-copy > :nth-child(3) {
  animation-delay: 0.2s;
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.hero h1 {
  margin: 0 0 1rem;
  font: 800 clamp(2.75rem, 8vw, 5.5rem) / 0.95 var(--font-display);
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-summary {
  margin: 0 0 1.75rem;
  max-width: 34ch;
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-portrait {
  margin: 0;
  justify-self: end;
  max-width: min(100%, 22rem);
}

.hero-portrait img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
}

/* Sections */

.section {
  padding-block: clamp(3rem, 8vw, 6rem);
}

.section h2 {
  margin: 0 0 2rem;
  font: 700 clamp(1.75rem, 4vw, 2.5rem) / 1.1 var(--font-display);
  letter-spacing: -0.02em;
}

.subsection-title {
  margin: 2.5rem 0 1.5rem;
  font: 600 1.1rem/1.3 var(--font-display);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.subsection-title:first-of-type {
  margin-top: 0;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Projects */

.project {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(16rem, 0.9fr);
  align-items: start;
  gap: clamp(1.5rem, 5vw, 5rem);
  padding-block: clamp(2.5rem, 6vw, 5rem);
  border-top: 1px solid var(--border);
}

.project--flip .project-media {
  order: 2;
}

.project-copy {
  max-width: 38rem;
}

.project-tag {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font: 600 0.75rem/1.2 var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-copy h3 {
  margin: 0;
  font: 700 clamp(1.45rem, 3vw, 2.15rem) / 1.08 var(--font-display);
  letter-spacing: -0.02em;
}

.project-copy > p:not(.project-tag) {
  margin: 1rem 0 0;
  color: var(--text-muted);
}

.project-copy ul {
  display: grid;
  gap: 0.55rem;
  margin: 1.35rem 0 1.6rem;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.project-copy li {
  position: relative;
  padding-left: 1rem;
}

.project-copy li::before {
  content: "";
  position: absolute;
  top: 0.75em;
  left: 0;
  width: 0.35rem;
  height: 1px;
  background: var(--accent);
}

.project-media {
  min-width: 0;
}

.project-figure {
  margin: 0;
}

.project-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border: 0;
  background: transparent;
  overflow: hidden;
  clip-path: var(--frame-hex);
  -webkit-clip-path: var(--frame-hex);
}

.project-main {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.project-caption {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
  min-height: 2.8em;
}

.gallery-dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.gallery-dots button {
  width: 1.05rem;
  height: 2px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(245, 245, 245, 0.28);
  transform: skewX(-18deg);
  cursor: pointer;
}

.gallery-dots button[aria-selected="true"] {
  background: var(--accent);
  width: 1.45rem;
}

.gallery-dots button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.project-main.is-switching {
  opacity: 0.35;
  transition: opacity 0.25s ease;
}

.project-main.is-visible-slide {
  opacity: 1;
  transition: opacity 0.35s ease;
}

.placeholder {
  display: grid;
  place-items: center;
  min-height: clamp(14rem, 30vw, 23rem);
  aspect-ratio: 16 / 9;
  padding: 2.25rem 6%;
  border: 0;
  background:
    linear-gradient(115deg, rgba(225, 6, 0, 0.16), transparent 42%),
    var(--bg-elevated);
  color: var(--text-muted);
  font: 600 clamp(1rem, 2vw, 1.25rem) / 1.35 var(--font-display);
  text-align: center;
  clip-path: var(--frame-hex);
  -webkit-clip-path: var(--frame-hex);
}

/* About */

#about {
  border-top: 1px solid var(--border);
}

.about-summary {
  max-width: 76ch;
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.75;
}

.about-block {
  margin-top: clamp(2.75rem, 6vw, 4.5rem);
}

.about-block > h3 {
  margin: 0 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  font: 600 0.85rem/1.2 var(--font-display);
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.about-block h4 {
  margin: 0;
  font: 600 1.05rem/1.35 var(--font-display);
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.skills-grid h4 {
  margin-bottom: 0.8rem;
  color: var(--text);
}

.compact-list,
.timeline-entry ul,
.other-projects,
.certification-list,
.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.compact-list li {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.timeline-entry {
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.timeline-entry:first-child {
  padding-top: 0;
}

.timeline-heading {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.timeline-heading p,
.education-entry p {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
}

.timeline-date {
  flex: 0 0 auto;
  font-size: 0.875rem;
}

.timeline-entry ul {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
  color: var(--text-muted);
}

.timeline-entry li {
  position: relative;
  padding-left: 1rem;
}

.timeline-entry li::before {
  content: "";
  position: absolute;
  top: 0.75em;
  left: 0;
  width: 0.35rem;
  height: 1px;
  background: var(--accent);
}

.about-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 6vw, 5rem);
}

.entry-meta {
  font-size: 0.875rem;
}

.other-projects {
  display: grid;
  gap: 1rem;
}

.other-projects li {
  display: grid;
  gap: 0.2rem;
}

.other-projects strong {
  font-size: 0.95rem;
}

.other-projects span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.certification-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.certification-list li {
  min-width: 0;
  padding: 0.8rem 1rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

/* Contact */

.contact-section {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(10rem, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(2rem, 8vw, 7rem);
}

.contact-grid h2 {
  margin-bottom: 0;
}

.contact-list {
  display: grid;
}

.contact-list li {
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.contact-list li:first-child {
  padding-top: 0;
}

.contact-list a {
  color: var(--text);
  text-decoration-color: var(--accent);
  text-underline-offset: 0.25em;
}

.contact-list a:hover {
  color: var(--text-muted);
}

.site-footer {
  padding-block: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

@media (max-width: 800px) {
  .project {
    grid-template-columns: 1fr;
  }

  .project--flip .project-media {
    order: initial;
  }

  .header-inner {
    flex-wrap: wrap;
    padding-block: 0.75rem;
  }

  .nav {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
  }

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

  .hero-portrait {
    justify-self: start;
    max-width: min(100%, 16rem);
    order: -1;
  }

  .skills-grid,
  .about-split,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .timeline-heading {
    display: grid;
    gap: 0.5rem;
  }

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

@media (max-width: 480px) {
  .certification-list {
    grid-template-columns: 1fr;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
