:root{
  /* Palette */
  --green: #1A4833;
  --green2: #1AA260;
  --linen: #FAF0E6;
  --white: #FFFFFF;
  --black: #000000;

  /* Comic accents */
  --magenta: #ff4fd8;
  --cyan: #3de6ff;
  --sun: #ffd24a;

  /* Layout */
  --cols: 12;
  --gap: clamp(12px, 2vw, 18px);
  --radius: 22px;
  --stroke: 3px;
  --tile-min: 140px;

  /* Typography */
  --font: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* -------------------------
   Base / reset
------------------------- */
*{ box-sizing: border-box; }

html{
  min-height: 100%;
  background: #fff;
}

body{
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--black);
  background: transparent;
}

/* -------------------------
   Fixed site background
------------------------- */
.site-bg{
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 10% 10%, rgba(61,230,255,.20), transparent 60%),
    radial-gradient(900px 700px at 90% 25%, rgba(255,79,216,.18), transparent 55%),
    radial-gradient(1100px 900px at 55% 95%, rgba(255,210,74,.18), transparent 55%),
    linear-gradient(180deg, var(--linen), #fff);
  background-repeat: no-repeat;
}

.site-bg--paper{
  background:
    radial-gradient(1000px 700px at 15% 15%, rgba(26,162,96,.06), transparent 60%),
    radial-gradient(900px 650px at 85% 25%, rgba(0,0,0,.035), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, var(--linen) 100%);
  background-repeat: no-repeat;
}

/* -------------------------
   Layout: page + topbar
------------------------- */
.page{
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 28px);
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 50;

  flex-wrap: nowrap;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(14px, 2.5vw, 22px);

  background: rgba(255,255,255,.75);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(0,0,0,.12);
}

.nav__burger{
  flex-shrink: 0;
}

/* Brand */
.brand{
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__tag{
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--green);
  color: var(--linen);
  font-weight: 800;
  letter-spacing: .5px;
  box-shadow: 6px 6px 0 rgba(0,0,0,.12);
  border: var(--stroke) solid var(--black);
}

.brand__name{
  font-weight: 800;
  font-size: 18px;
  line-height: 1.1;
}

.brand__subtitle{
  font-size: 13px;
  opacity: .75;
}

/* -------------------------
   Navigation
   IMPORTANT: Desktop shows links, hides burger.
------------------------- */
.nav{
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* Wrapper for desktop links (recommended in HTML) */
.nav__links{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================
   Navigation – final version
   ========================= */

.nav__link{
  position: relative;
  padding: 0.35em 0.75em;
  border-radius: 6px;
  border: 2px solid transparent;

  text-decoration: none;
  background: transparent;

  /* neutralize browser link colors */
  color: #1a1a1a;

  font-weight: 500;

  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
}

/* kill browser link states explicitly */
.nav__link:link,
.nav__link:visited{
  color: #1a1a1a;
}

/* hover (inactive) */
.nav__link:hover{
  background: rgba(26, 72, 51, 0.06);
}

/* ACTIVE — matches logo & primary button */
.nav__link--active{
  background: #1A4833;
  border-color: #1A4833;

  /* THIS is the critical part */
  color: #ffffff !important;

  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* keep active stable */
.nav__link--active:hover{
  background: #1A4833;
  transform: translateY(1px);
}


/* Burger container hidden by default (desktop) */
.nav__mobile{ display: none; }

/* -------------------------
   Landing grid & tiles
------------------------- */
.grid{
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gap);
  align-items: stretch;
}

.tile{
  grid-column: span var(--c, 3);
  grid-row: span var(--r, 2);

  position: relative;
  border-radius: var(--radius);
  border: var(--stroke) solid var(--black);
  background: rgba(255,255,255,.72);
  box-shadow: 10px 10px 0 rgba(0,0,0,.12);
  overflow: hidden;
  min-height: var(--tile-min);

  transition: transform .15s ease, box-shadow .15s ease;
}

.tile:hover{
  transform: translateY(-2px);
  box-shadow: 12px 12px 0 rgba(0,0,0,.14);
}

.tile::after{
  content:"";
  position:absolute;
  inset:-40px;
  background: radial-gradient(circle at 1px 1px, rgba(0,0,0,.13) 1px, transparent 1.6px);
  background-size: 10px 10px;
  opacity: .22;
  transform: rotate(-6deg);
  pointer-events: none;
}

.tile__inner{
  position: relative;
  z-index: 1;
  height: 100%;
  padding: clamp(14px, 2.2vw, 20px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* -------------------------
   Hero tile
------------------------- */
.tile--hero{
  background:
    linear-gradient(135deg, rgba(26,162,96,.18), rgba(61,230,255,.14)),
    rgba(255,255,255,.75);
}

.kicker{
  display: inline-flex;
  align-self: flex-start;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 2px solid var(--black);
  background: var(--sun);
  box-shadow: 5px 5px 0 rgba(0,0,0,.12);
}

.headline{
  margin: 0;
  font-size: clamp(22px, 2.7vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.lead{
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  max-width: 62ch;
  opacity: .9;
}

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

.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  padding: 12px 14px;
  border-radius: 16px;
  border: 2px solid var(--black);
  box-shadow: 6px 6px 0 rgba(0,0,0,.12);
  transition: transform .12s ease, box-shadow .12s ease;
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: 7px 7px 0 rgba(0,0,0,.14);
}

.btn--primary{
  background: var(--green);
  color: var(--linen);
}

.btn--ghost{
  background: rgba(255,255,255,.7);
  color: var(--black);
}

.btn__icon{
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(0,0,0,.25);
}

.chips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.chip{
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,.22);
  background: rgba(255,255,255,.55);
}

/* -------------------------
   Profile tile
------------------------- */
.tile--profile{
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(135deg, rgba(255,79,216,.16), rgba(255,210,74,.12)),
    rgba(255,255,255,.75);
}

.profile{
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.profile__imgwrap{
  flex-shrink: 0;
  border-radius: 18px;
  border: 2px solid var(--black);
  overflow: hidden;
  box-shadow: 6px 6px 0 rgba(0,0,0,.12);
  background: #fff;
  aspect-ratio: 4 / 5;
}

.profile__imgwrap img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile__meta{
  display: grid;
  gap: 6px;
}

.profile__role{
  font-weight: 900;
  font-size: 16px;
}

.profile__where{
  font-weight: 700;
  font-size: 13px;
  opacity: .8;
}

.profile__links{
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.social-link{
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--black);
  font-weight: 900;
  font-size: 14px;

  padding: 12px 14px;
  border-radius: 16px;
  border: 2px solid var(--black);
  background: rgba(255,255,255,.65);
  box-shadow: 6px 6px 0 rgba(0,0,0,.12);

  transition: transform .12s ease, box-shadow .12s ease;
}

.social-link:hover{
  transform: translateY(-1px);
  box-shadow: 7px 7px 0 rgba(0,0,0,.14);
}

.social-link__icon{
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 2px solid rgba(0,0,0,.22);
  background: rgba(255,255,255,.7);
}

.social-link__icon svg{ display: block; }

.social-link--email{
  background: linear-gradient(135deg, rgba(255,210,74,.18), rgba(255,255,255,.6));
}
.social-link--ig{
  background: linear-gradient(135deg, rgba(255,79,216,.18), rgba(255,210,74,.14));
}
.social-link--in{
  background: linear-gradient(135deg, rgba(10,102,194,.22), rgba(0,65,130,.14));
}

/* -------------------------
   Link tiles
------------------------- */
.tile--link{
  background:
    linear-gradient(135deg, rgba(61,230,255,.12), rgba(255,255,255,.35)),
    rgba(255,255,255,.75);
}

.tile--accent{
  background:
    linear-gradient(135deg, rgba(26,72,51,.18), rgba(26,162,96,.12)),
    rgba(255,255,255,.75);
}

.tile__title{
  margin: 0;
  font-weight: 900;
  font-size: 18px;
}

.tile__text{
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: .9;
}

.tile__cta{
  margin-top: auto;
  align-self: flex-start;
  font-weight: 900;
  text-decoration: none;
  color: var(--black);

  padding: 10px 12px;
  border-radius: 14px;
  border: 2px solid var(--black);
  background: rgba(255,255,255,.6);
  box-shadow: 6px 6px 0 rgba(0,0,0,.12);
  transition: transform .12s ease, box-shadow .12s ease;
}

.tile__cta:hover{
  transform: translateY(-1px);
  box-shadow: 7px 7px 0 rgba(0,0,0,.14);
}

.tile--comic{
  background:
    linear-gradient(135deg, rgba(255,210,74,.22), rgba(255,79,216,.10)),
    rgba(255,255,255,.75);
}

/* Photo tile */
.tile--photo{
  background: #fff;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 0;
}

.tile--photo::after{ content: none; }

.tile--photo::before{
  content:"";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.22));
}

.tile__cta--photo{
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  margin-top: 0;
}

.mini-list{
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.mini-list li{ line-height: 1.35; }

.tile--footer{ min-height: auto; }

.footerline{
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.sep{ opacity: .4; }
.muted{ opacity: .7; }

/* -------------------------
   Responsive
------------------------- */
@media (max-width: 900px){
  :root{ --cols: 8; }

  /* Hide desktop links, show burger */
  .nav__links{ display: none; }
  .nav__mobile{
    display: block;
    position: relative;
  }

  /* Burger menu (details/summary) */
  .nav__mobile > summary{ list-style: none; }
  .nav__mobile > summary::-webkit-details-marker{ display: none; }

  .nav__burger{
    cursor: pointer;
    user-select: none;

    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 2px solid var(--black);
    background: rgba(255,255,255,.75);
    box-shadow: 6px 6px 0 rgba(0,0,0,.12);
    display: grid;
    place-items: center;
  }

  .nav__burger span{
    display: block;
    width: 20px;
    height: 3px;
    background: var(--black);
    border-radius: 99px;
    margin: 2px 0;
  }

  .nav__panel{
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 180px;

    border-radius: 18px;
    border: 2px solid var(--black);
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(10px);
    box-shadow: 10px 10px 0 rgba(0,0,0,.12);

    padding: 10px;
    display: grid;
    gap: 8px;

    transform-origin: top right;
    transform: scale(.98) translateY(-6px);
    opacity: 0;
    pointer-events: none;
    transition: transform .15s ease, opacity .15s ease;
  }

  .nav__mobile[open] .nav__panel{
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
  }

  .nav__item{
    text-decoration: none;
    color: var(--black);
    font-weight: 900;
    font-size: 14px;

    padding: 12px 12px;
    border-radius: 14px;
    border: 2px solid rgba(0,0,0,.22);
    background: rgba(255,255,255,.7);
  }

  .nav__item:hover{ border-color: rgba(0,0,0,.45); }

  /* Mobile: stack tiles */
  .grid{
    display: flex;
    flex-direction: column;
    gap: var(--gap);
  }

  .grid > .tile{ width: 100%; }

  /* Desired phone order */
  #t-profile{ order: 1; }
  #t-projects{ order: 2; }
  #t-welcome{ order: 3; }
  #photoTile{ order: 4; }
}

@media (max-width: 600px){
  :root{ --cols: 4; --stroke: 2px; --radius: 18px; }
}

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