:root {
  --bg: #0b0b0b;
  --panel: #0f0f0f;
  --text: #ffffff;
  --muted: #bdbdbd;
  --divider: #2a2a2a;
  --shadow: rgba(0, 0, 0, 0.45);

  --container: 1100px;

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;
  --space-8: 6rem;
  --space-9: 8rem;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 150ms var(--ease);
  --t: 220ms var(--ease);
}

/*
  Canela.light font setup:
  - If you already have Canela in your Next.js repo, this page will try:
      ../public/fonts/CanelaText-Light-Trial.otf
  - Otherwise, drop your real Canela.light file here:
      portfolio-minimal/fonts/canela-light.woff2
*/
@font-face {
  font-family: "Canela.light";
  src:
    local("Canela"),
    local("Canela Light"),
    local("CanelaText Light"),
    url("../public/fonts/CanelaText-Light-Trial.otf") format("opentype"),
    url("./fonts/canela-light.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Permanent Marker";
  src: url("./fonts/PermanentMarker-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(
    1200px 900px at 50% -10%,
    #121212 0%,
    var(--bg) 55%
  );
  color: var(--text);
  font-family:
    "Canela.light", ui-serif, Georgia, "Times New Roman", Times, serif;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(var(--container), calc(100% - 3rem));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 1rem;
  padding: 0.75rem 1rem;
  background: #ffffff;
  color: #000000;
  border: 1px solid #000000;
  border-radius: 0;
  z-index: 9999;
}

.skip-link:focus {
  left: 1rem;
}

.divider {
  height: 1px;
  background: var(--divider);
}

.section {
  padding-block: var(--space-9);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 11, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(42, 42, 42, 0.55);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.1rem;
}

.nav__logo {
  letter-spacing: 0.02em;
  font-size: 1.05rem;
  transition: color var(--t-fast);
}

.nav__logo:hover {
  color: #f7c547;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav__link {
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: color var(--t-fast);
  position: relative;
}

.nav__link:hover {
  color: #f7c547;
}

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

.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.65rem;
  height: 1px;
  background: rgba(255, 255, 255, 0.45);
}

/* ===== HERO SECTION (Editorial Layout) ===== */
.hero {
  background: #f7f7f7;
  color: #1a1a1a;
  padding-top: clamp(2rem, 4vw, 3rem);
  padding-bottom: var(--space-7);
  position: relative;
  overflow: hidden;
}

.hero__topline {
  margin: 0 0 var(--space-5) 0;
  padding-inline: clamp(1.5rem, 4vw, 4rem);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #555;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 380px) 1fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
  padding-inline: clamp(1.5rem, 4vw, 4rem);
  min-height: clamp(500px, 65vh, 700px);
}

/* Left column */
.hero__left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
  padding-block: var(--space-6);
}

.hero__label {
  margin: 0 0 var(--space-3) 0;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #666;
}

.hero__title {
  margin: 0;
  font-size: clamp(2.8rem, 5.5vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-weight: 300;
  text-transform: uppercase;
}

.hero__subtitle {
  margin: var(--space-6) 0 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #666;
}

/* Center column (portrait) */
.hero__center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__frame {
  position: relative;
  border: 1px solid #222;
  padding: 6px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

.hero__portrait {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  filter: grayscale(100%) contrast(1.1);
  transition: filter 0.4s ease;
}

.hero__frame:hover .hero__portrait {
  filter: grayscale(0%) contrast(1);
}

/* Right column */
.hero__right {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
  padding-block: var(--space-6);
  padding-left: clamp(1rem, 2vw, 2rem);
}

/* Dotted pattern background */
.hero__dots-bg {
  position: absolute;
  top: 0;
  right: -60px;
  bottom: 0;
  width: 300px;
  background-image: radial-gradient(
    circle,
    rgba(130, 110, 180, 0.5) 1.5px,
    transparent 1.5px
  );
  background-size: 18px 18px;
  pointer-events: none;
  z-index: 0;
}

.hero__skills {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0 0 var(--space-5) 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hero__skills li {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.hero__desc {
  position: relative;
  z-index: 1;
  margin: 0 0 var(--space-5) 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: #444;
  max-width: 280px;
}

.hero__actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Button styling for hero (light bg) */
.hero .button--outline {
  border: 1px solid #1a1a1a;
  color: #1a1a1a;
  background: transparent;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.9rem 1.5rem;
  border-radius: 0;
}

.hero .button--outline:hover {
  background: #1a1a1a;
  color: #fff;
}

/* ===== RESPONSIVE HERO ===== */
@media (max-width: 960px) {
  .hero__grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    min-height: auto;
  }

  .hero__left {
    grid-column: 1;
    grid-row: 1;
  }

  .hero__center {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .hero__right {
    grid-column: 1;
    grid-row: 2;
  }

  .hero__title {
    font-size: clamp(2rem, 4.5vw, 3.5rem);
  }

  .hero__dots-bg {
    width: 200px;
    right: -40px;
  }
}

@media (max-width: 700px) {
  .hero__grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    text-align: center;
    gap: var(--space-5);
  }

  .hero__topline {
    text-align: center;
  }

  .hero__left {
    grid-column: 1;
    grid-row: 1;
    align-items: center;
  }

  .hero__center {
    grid-column: 1;
    grid-row: 2;
  }

  .hero__right {
    grid-column: 1;
    grid-row: 3;
    align-items: center;
    padding-left: 0;
  }

  .hero__skills {
    align-items: center;
  }

  .hero__desc {
    max-width: 100%;
    text-align: center;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__dots-bg {
    display: none;
  }

  .hero__frame {
    max-width: 280px;
  }

  .hero__title {
    font-size: clamp(2.2rem, 8vw, 3rem);
  }
}

/* ===== BUTTON BASE (shared) ===== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.35rem;
  border-radius: 0;
  user-select: none;
  transition:
    background-color var(--t),
    color var(--t),
    border-color var(--t),
    transform var(--t);
  letter-spacing: 0.01em;
}

.button--outline {
  border: 1px solid rgba(255, 255, 255, 0.75);
  color: var(--text);
  background: transparent;
}

.button--outline:hover {
  background: #ffffff;
  color: #000000;
  transform: translateY(-1px);
}

.button--outline:active {
  transform: translateY(0);
}

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  padding-bottom: var(--space-8);
}

.section-head--centered {
  text-align: center;
  padding-bottom: var(--space-9);
}

/* Large editorial section title */
.section-head__title {
  margin: 0;
  font-family: "Permanent Marker", cursive;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
}

.projects-list {
  display: grid;
  gap: var(--space-9);
}

.project {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: var(--space-7);
  align-items: center;
  padding-top: var(--space-8);
  border-top: 1px solid var(--divider);
}

.project:first-child {
  padding-top: 0;
  border-top: 0;
}

.project__left {
  display: flex;
  flex-direction: column;
}

/* Individual project titles - smaller, minimal style */
.project__title {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 400;
  cursor: pointer;
  display: inline-block;
  transition: color var(--t-fast);
}

.project__title:hover,
.project__title:focus {
  outline: none;
  color: #fff;
}

.project__underline {
  width: 60px;
  height: 2px;
  background: rgba(255, 255, 255, 0.6);
  margin-top: 1.2rem;
  transition:
    width 220ms ease,
    background 220ms ease;
}

.project:hover .project__underline,
.project__title:hover ~ .project__underline,
.project__title:focus ~ .project__underline {
  width: 160px;
  background: #fff;
}

.project__meta {
  margin: 1.4rem 0 0 0;
  color: rgba(189, 189, 189, 0.8);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project__desc {
  margin: 1rem 0 0 0;
  color: rgba(189, 189, 189, 0.95);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 360px;
}

.project__icons {
  margin-top: 1.5rem;
}

.project__icons img {
  height: 32px;
  width: auto;
  opacity: 0.85;
  transition: opacity var(--t);
}

.project__icons img:hover {
  opacity: 1;
}

.project__buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.project__buttons .button {
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
}

/* Premium Download Button */
.button--download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #f5a623 0%, #f7c547 100%);
  border: 1px solid rgba(245, 166, 35, 0.5);
  color: #0a0a0a;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  border-radius: 0;
  cursor: pointer;
  transition:
    transform var(--t),
    box-shadow var(--t),
    background var(--t);
}

.button--download:hover {
  background: linear-gradient(135deg, #ffb833 0%, #ffd966 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 166, 35, 0.4);
}

.button--download:active {
  transform: translateY(0);
}

.button--download:focus {
  outline: 2px solid rgba(247, 197, 71, 0.7);
  outline-offset: 2px;
}

.button__icon {
  flex-shrink: 0;
}

/* Helper text for SmartScreen warning */
.project__helper-text {
  margin: 0.75rem 0 0 0;
  font-size: 0.72rem;
  color: rgba(189, 189, 189, 0.6);
  letter-spacing: 0.01em;
  line-height: 1.5;
  max-width: 320px;
}

.project__right {
  display: flex;
  justify-content: flex-end;
}

.project__image {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--panel);
  border: 1px solid rgba(42, 42, 42, 0.9);
  box-shadow: 0 30px 70px var(--shadow);
  transition:
    filter var(--t),
    transform var(--t);
}

.project__image:hover {
  transform: translateY(-4px);
}

.center {
  text-align: center;
  padding-block: var(--space-8);
}

.section-title {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.01em;
}

.about__text {
  margin: var(--space-4) auto 0 auto;
  max-width: 55rem;
  color: rgba(189, 189, 189, 0.95);
  font-size: 1.1rem;
  line-height: 1.75;
}

/* ===== NEW ABOUT SECTION (Editorial Style) ===== */
.about-new {
  background: #f7f7f7;
  background-image: radial-gradient(
    circle,
    rgba(150, 140, 160, 0.25) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
  color: #1a1a1a;
  padding-block: var(--space-9);
}

.about-new__container {
  width: min(var(--container), calc(100% - 3rem));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
}

.about-new__content {
  max-width: 520px;
}

.about-new__title {
  margin: 0 0 var(--space-5) 0;
  font-family: "Permanent Marker", cursive;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: #1a1a1a;
}

.about-new__text {
  margin: 0 0 var(--space-4) 0;
  font-size: 1.05rem;
  line-height: 1.75;
  color: #444;
}

.about-new__text:last-of-type {
  margin-bottom: 0;
}

.about-new__image-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-new__image {
  max-width: 100%;
  max-height: 450px;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid #ddd;
}

/* About section responsive */
@media (max-width: 820px) {
  .about-new__container {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    text-align: center;
  }

  .about-new__content {
    max-width: 100%;
  }

  .about-new__image {
    max-height: 350px;
  }
}

.contact__links {
  margin-top: var(--space-5);
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  color: rgba(189, 189, 189, 0.95);
}

.contact__link {
  position: relative;
  padding-block: 0.35rem;
  color: rgba(189, 189, 189, 0.95);
  transition: color var(--t-fast);
}

.contact__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.1rem;
  width: 100%;
  height: 1px;
  background: rgba(189, 189, 189, 0.45);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-fast);
}

.contact__link:hover {
  color: var(--text);
}

.contact__link:hover::after {
  transform: scaleX(1);
}

.contact__sep {
  color: rgba(189, 189, 189, 0.35);
}

/* ===== NEW CONTACT SECTION (Editorial Style) ===== */
.contact-new {
  background: #0a0a0a;
  color: #fff;
  padding-block: var(--space-9);
  border-top: 1px solid var(--divider);
}

.contact-new__container {
  width: min(var(--container), calc(100% - 3rem));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: start;
}

/* Left column: headline */
.contact-new__left {
  padding-top: var(--space-4);
}

.contact-new__headline {
  margin: 0;
  font-family: "Permanent Marker", cursive;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 400;
}

.contact-new__sub {
  margin: var(--space-5) 0 0 0;
  font-family: "Permanent Marker", cursive;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.6);
  font-style: normal;
}

/* Right column: links */
.contact-new__right {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.contact-new__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.contact-new__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.contact-new__link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition:
    color var(--t-fast),
    opacity var(--t-fast);
}

.contact-new__icon {
  flex-shrink: 0;
}

.contact-new__link--primary {
  color: #fff;
  font-size: 1rem;
}

.contact-new__link--primary:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact-new__muted {
  margin-top: var(--space-2);
}

.contact-new__link--secondary {
  color: #9a9a9a;
  font-size: 0.9rem;
}

.contact-new__link--secondary:hover {
  color: #bbb;
}

.contact-new__squiggle {
  display: flex;
  justify-content: flex-end;
  color: rgba(255, 255, 255, 0.25);
  margin-top: var(--space-3);
}

/* Contact section responsive */
@media (max-width: 820px) {
  .contact-new__container {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    text-align: center;
  }

  .contact-new__left {
    padding-top: 0;
  }

  .contact-new__headline {
    font-size: clamp(2rem, 6vw, 3rem);
  }

  .contact-new__links {
    align-items: center;
  }

  .contact-new__muted {
    display: flex;
    justify-content: center;
  }

  .contact-new__squiggle {
    justify-content: center;
  }
}

.footer {
  padding-block: var(--space-6);
  border-top: 1px solid rgba(42, 42, 42, 0.55);
}

.footer__inner {
  display: flex;
  justify-content: center;
}

.footer__text {
  margin: 0;
  color: rgba(189, 189, 189, 0.75);
  font-size: 0.95rem;
}

@media (max-width: 820px) {
  .container {
    width: min(var(--container), calc(100% - 2rem));
  }

  .nav__links {
    gap: 1.1rem;
  }

  .project {
    grid-template-columns: 1fr;
    gap: var(--space-5);
    padding-top: var(--space-6);
  }

  .project__title {
    font-size: clamp(2rem, 7vw, 3rem);
  }

  .project__underline {
    margin-top: 0.8rem;
  }

  .project__desc {
    max-width: 100%;
  }

  .project__right {
    justify-content: center;
  }

  .project__image {
    max-width: 100%;
  }

  .center {
    padding-block: var(--space-7);
  }
}

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

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== PROJECT MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.modal__container {
  position: relative;
  width: min(1100px, calc(100% - 3rem));
  max-height: calc(100vh - 4rem);
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
  padding: var(--space-7);
  transform: scale(0.98);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.modal.is-open .modal__container {
  transform: scale(1);
}

.modal__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  transition: color var(--t-fast);
  z-index: 10;
}

.modal__close:hover {
  color: #fff;
}

.modal__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
  align-items: start;
}

/* Modal Left Column */
.modal__left {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.modal__title {
  margin: 0;
  font-family: "Canela.light", ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 300;
  color: #fff;
}

.modal__summary {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
}

.modal__section {
  border-top: 1px solid #2a2a2a;
  padding-top: var(--space-4);
}

.modal__section-title {
  margin: 0 0 var(--space-3) 0;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.modal__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal__tech-badge {
  display: inline-block;
}

.modal__tech img {
  height: 30px;
  width: auto;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.modal__tech img:hover {
  transform: scale(1.05);
}

.modal__highlights {
  margin: 0;
  padding: 0;
  list-style: none;
}

.modal__highlights li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.6rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  line-height: 1.5;
}

.modal__highlights li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: rgba(255, 255, 255, 0.4);
}

/* Modal Right Column: Diagram */
.modal__right {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.modal__diagram {
  width: 100%;
}

.modal__diagram svg {
  width: 100%;
  height: auto;
  max-height: 400px;
}

/* Body scroll lock */
body.modal-open {
  overflow: hidden;
}

/* Modal responsive */
@media (max-width: 820px) {
  .modal__container {
    padding: var(--space-5);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }

  .modal__content {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .modal__right {
    min-height: 200px;
  }

  .modal__title {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
  }
}
