:root {
    --paper: #FFF8EC;
    --ink: #1A1A1A;
    --orange: #FF4D2E;
    --blue: #1E4FFF;
    --yellow: #FFD23F;
    --paper-shade: #F3E9D6;
    --display: 'Fraunces', serif;
    --body: 'Space Grotesk', sans-serif;
  }

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

  html { scroll-behavior: smooth; }

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

  /* Texture overlay - subtle paper grain via noise pattern */
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(0,0,0,0.035) 1px, transparent 1px);
    background-size: 3px 3px;
    z-index: 1000;
    opacity: 0.6;
  }

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

  .wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 32px;
  }

  /* ---------- NAV ---------- */
  nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,248,236,0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #E3D9C4;
  }

  nav .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
  }

  .nav-mark {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
  }

  .nav-mark span {
    color: var(--orange);
  }

  .nav-links {
    display: flex;
    gap: 36px;
    font-size: 0.92rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .nav-links a {
    position: relative;
    padding: 4px 0;
  }

  .nav-links a::after {
    content: "";
    position: absolute;
    left: 0; bottom: -2px;
    width: 0%;
    height: 3px;
    background: var(--orange);
    transition: width 0.25s ease;
  }

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

  .nav-status {
    display: none;
  }

  @media (min-width: 720px) {
    .nav-status {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.82rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
  }

  .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2BB673;
    box-shadow: 0 0 0 0 rgba(43,182,115,0.6);
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(43,182,115,0.55); }
    70% { box-shadow: 0 0 0 7px rgba(43,182,115,0); }
    100% { box-shadow: 0 0 0 0 rgba(43,182,115,0); }
  }

  /* ---------- HERO ---------- */
  .hero {
    position: relative;
    padding: 96px 0 80px;
    border-bottom: 1px solid #E3D9C4;
    overflow: hidden;
  }

  .hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #555;
    background: #fff;
    border: 1px solid #E3D9C4;
    padding: 7px 16px;
    border-radius: 999px;
    margin-bottom: 28px;
  }

  .hero-name {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(3rem, 10vw, 7.5rem);
    line-height: 0.92;
    letter-spacing: -0.02em;
  }

  .hero-name em {
    font-style: italic;
    font-weight: 400;
    color: var(--orange);
  }

  .hero-stamp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 26px;
    font-family: var(--body);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #555;
  }

  .hero-stamp::before {
    content: "";
    width: 28px;
    height: 2px;
    background: var(--orange);
  }

  .hero-sub {
    max-width: 560px;
    margin-top: 32px;
    font-size: 1.15rem;
    line-height: 1.6;
    color: #3a3a3a;
  }

  .hero-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 40px;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--body);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 15px 28px;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
  }

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

  .btn-fill:hover, .btn-fill:focus-visible {
    background: var(--orange);
    border-color: var(--orange);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255,77,46,0.28);
  }

  .btn-line:hover, .btn-line:focus-visible {
    background: var(--ink);
    color: var(--paper);
    transform: translateY(-2px);
  }

  /* ---------- 3D TILT SYSTEM ---------- */
  .hero {
    perspective: 1200px;
  }

  .tilt-stage {
    transform-style: preserve-3d;
    will-change: transform;
  }

  .tilt-stage > * {
    transform: translateZ(0);
    will-change: transform;
    transition: transform 0.15s ease-out;
  }

  .hero-name {
    transform-style: preserve-3d;
  }

  .blob {
    will-change: transform;
    transition: transform 0.2s ease-out;
  }

  @media (prefers-reduced-motion: reduce) {
    .tilt-stage, .tilt-stage > *, .blob {
      transition: none !important;
    }
  }

  /* card 3D hover */
  .work-grid {
    perspective: 1400px;
  }

  .card {
    transform-style: preserve-3d;
    will-change: transform;
  }

  .blob {
    position: absolute;
    border-radius: 50%;
    z-index: -1;
    filter: blur(2px);
  }
  .blob-1 {
    width: 280px; height: 280px;
    background: var(--blue);
    opacity: 0.18;
    top: -80px; right: -60px;
  }
  .blob-2 {
    width: 180px; height: 180px;
    background: var(--orange);
    opacity: 0.15;
    bottom: -40px; right: 18%;
  }

  /* ---------- SECTION LABEL ---------- */
  .section-label {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 48px;
  }

  .section-label .tag {
    font-family: var(--body);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--blue);
    border: 1.5px solid var(--blue);
    padding: 5px 13px;
    border-radius: 999px;
    white-space: nowrap;
  }

  .section-label h2 {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    letter-spacing: -0.01em;
  }

  /* ---------- WORK ---------- */
  .work {
    padding: 100px 0;
    border-bottom: 1px solid #E3D9C4;
  }

  .work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 48px 40px;
  }

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

  .card {
    position: relative;
    background: #fff;
    border: 1px solid #E3D9C4;
    border-radius: 4px;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 1px 2px rgba(26,26,26,0.04);
    transform: translateZ(0);
  }

  .card.tilting {
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 24px 40px rgba(26,26,26,0.14);
    border-color: var(--ink);
  }

  /* fallback for touch devices / reduced motion where JS tilt is disabled */
  @media (hover: hover) and (pointer: fine) {
    .no-3d .card:hover, .no-3d .card:focus-within {
      transform: translateY(-4px);
      box-shadow: 0 16px 32px rgba(26,26,26,0.10);
      border-color: var(--ink);
      transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    }
  }

  .card-tag {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--ink);
    color: var(--paper);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 5px 11px;
    border-radius: 999px;
    z-index: 2;
  }

  .card-image {
    height: 220px;
    background: var(--paper-shade);
    border-bottom: 1px solid #E3D9C4;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 4px 4px 0 0;
    transform: translateZ(0);
    transition: transform 0.2s ease-out;
  }

  .card-image span {
    font-family: var(--body);
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8a8a8a;
  }

  .card-body {
    padding: 22px 24px 26px;
  }

  .card-body h3 {
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
  }

  .card-body p {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #444;
    margin-bottom: 14px;
  }

  .card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .pill {
    font-size: 0.73rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--paper-shade);
    color: #555;
    border-radius: 999px;
    padding: 4px 12px;
  }

  /* ---------- ABOUT / SKILLS ---------- */
  .about {
    padding: 100px 0;
    border-bottom: 1px solid #E3D9C4;
    background: var(--paper-shade);
  }

  .about-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
    align-items: start;
  }

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

  .about-text p {
    font-size: 1.08rem;
    line-height: 1.75;
    color: #2c2c2c;
    margin-bottom: 18px;
  }

  .about-text p:first-child {
    font-family: var(--display);
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ink);
  }

  .skills-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid #D9CBAE;
  }

  .skill-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 4px;
    border-bottom: 1px solid #D9CBAE;
  }

  .skill-row .name {
    font-family: var(--display);
    font-size: 1.1rem;
    font-weight: 500;
  }

  .skill-row .bars {
    display: flex;
    width: 110px;
    height: 6px;
    background: #E3D9C4;
    border-radius: 999px;
    overflow: hidden;
  }

  .skill-row .bars i {
    display: block;
    height: 100%;
    background: var(--orange);
    border-radius: 999px;
  }

  /* ---------- CONTACT ---------- */
  .contact {
    padding: 110px 0 90px;
    text-align: center;
    position: relative;
  }

  .contact-eyebrow {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--blue);
    margin-bottom: 18px;
  }

  .contact h2 {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2.2rem, 6vw, 4rem);
    line-height: 1.08;
    letter-spacing: -0.01em;
    max-width: 680px;
    margin: 0 auto;
  }

  .contact h2 em {
    font-style: italic;
    color: var(--orange);
  }

  .contact-cta {
    margin-top: 40px;
  }

  .big-link {
    font-family: var(--body);
    font-weight: 600;
    font-size: 1.3rem;
    border-bottom: 4px solid var(--ink);
    padding-bottom: 4px;
    transition: color 0.2s ease, border-color 0.2s ease;
  }

  .big-link:hover, .big-link:focus-visible {
    color: var(--orange);
    border-color: var(--orange);
  }

  footer {
    border-top: 1px solid #E3D9C4;
    padding: 28px 0;
  }

  footer .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #555;
  }

  footer .social {
    display: flex;
    gap: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.78rem;
  }

  footer .social a {
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
    transition: border-color 0.2s ease;
  }

  footer .social a:hover, footer .social a:focus-visible {
    border-color: var(--orange);
  }

  /* reveal-on-scroll */
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .reveal.in {
    opacity: 1;
    transform: translateY(0);
  }

  @media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .dot { animation: none; }
    * { scroll-behavior: auto !important; }
  }

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