:root {
  --navy: #022a45;
  --sidebar: #181818;
  --yellow: #ffd700;
  --yellow-dim: #8a7a1c;
  --text: #ffffff;
  --muted: #8d949b;
  --sidebar-w: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--navy);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 24px;
  z-index: 200; /* stays above the loader */
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.logo span {
  font-family: "Sacramento", cursive;
  color: var(--yellow-dim);
  font-size: 1.05rem;
  margin-top: -6px;
}

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a {
  display: grid;
  place-items: center;
  width: var(--sidebar-w);
  height: 52px;
  color: #5b5b5b;
  font-size: 1.3rem;
  transition: color .2s;
}
.nav a:hover { color: #d9d9d9; }
.nav a.active { color: var(--yellow); }

.socials { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.socials a { color: #5b5b5b; font-size: 1rem; transition: color .2s; }
.socials a:hover { color: var(--yellow); }

/* ---------- Main area ---------- */
.main {
  position: relative;
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  padding: 0 4vw;
}

/* handwritten code tags */
.tag {
  position: absolute;
  font-family: "Sacramento", cursive;
  color: var(--yellow-dim);
  font-size: 1.35rem;
  line-height: 1;
  pointer-events: none;
}
.main > .tag-body     { top: 24px; left: 48px; }
.main > .tag-body-end { bottom: 40px; left: 48px; }
.main > .tag-html-end { bottom: 14px; left: 28px; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
  padding: 4rem 0 4rem 3.5rem;
}

.hero-text { position: relative; }
.tag-h1 { top: -48px; left: 14px; font-size: 1.2rem; }
.tag-h1-end { position: absolute; right: -52px; bottom: 6px; font-size: 1.2rem; }

h1 {
  position: relative;
  margin: 0;
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.04em;
  width: max-content;
  max-width: 100%;
}
.accent { color: var(--yellow); }

.role {
  margin: 1.6rem 0 2.4rem;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn {
  display: inline-block;
  padding: .75rem 1.2rem;
  border: 1px solid var(--yellow);
  color: var(--yellow);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .2em;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--yellow); color: var(--navy); }

.hero-photo { display: flex; justify-content: center; }
.hero-photo img {
  width: min(100%, 450px);
  height: auto;
  display: block;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    inset: auto 0 0 0;
    width: 100%;
    height: 56px;
    flex-direction: row;
    padding: 0;
    justify-content: center;
  }
  .logo, .socials { display: none; }
  .nav { flex-direction: row; gap: 0; width: 100%; }
  .nav a { flex: 1; width: auto; height: 56px; }

  .main { padding: 0 1.5rem 72px; }
  .main > .tag-body { left: 1.5rem; }
  .main > .tag-body-end, .main > .tag-html-end { display: none; }

  .hero {
    grid-template-columns: 1fr;
    padding: 5rem 0 2rem;
    gap: 3rem;
  }
  .tag-h1-end { display: none; }
  .hero-photo { order: -1; }
  .hero-photo img { width: min(100%, 320px); }
}

/* =====================================================
   Nav hover labels (icon swaps to the page name)
   ===================================================== */
.nav .label {
  display: none;
  font-family: var(--serif);
  font-size: .5rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--yellow);
}
@media (hover: hover) {
  .nav a:hover i,
  .nav a:focus-visible i { display: none; }
  .nav a:hover .label,
  .nav a:focus-visible .label { display: block; }
}

/* =====================================================
   Inner pages (About, Portfolio, Skills, Contact)
   ===================================================== */
:root {
  --display: "Lilita One", "Arial Black", sans-serif;
  --serif: "Times New Roman", Times, serif;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.page {
  padding-top: 3.2rem;
  padding-bottom: 7rem;
  padding-left: calc(4vw + 3.5rem);
}

/* page titles with the <h1> tags above and below */
.title-wrap { margin-bottom: 1.6rem; }
.title-wrap .tag { position: static; display: block; font-size: 1.2rem; }
.title-wrap .tag-h1 { margin-left: .2rem; }
.page-title {
  margin: .3rem 0;
  font-family: var(--display);
  font-weight: 400;
  color: var(--yellow);
  font-size: clamp(2.4rem, 4.5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  width: auto;
}
.page-title.sans {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -.045em;
}

.subhead {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .06em;
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 520px) 1fr;
  gap: 3rem;
  align-items: center;
}
.about .subhead { margin-bottom: .15rem; font-size: 1.2rem; }
.sub-role {
  margin: 0 0 1.1rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .04em;
  color: #b5a52b;
}
.about p:not(.sub-role) {
  max-width: 480px;
  margin: 0 0 1rem;
  font-size: .85rem;
  line-height: 1.6;
}
.about .btn { margin-top: .6rem; }

/* spinning logo cube */
.cube-scene {
  --size: 150px;
  perspective: 800px;
  width: 100%;
  height: 340px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 14px rgba(255, 255, 210, .55)); /* glow lives here: a filter on .cube would flatten the 3D */
}
.cube {
  position: relative;
  width: var(--size);
  height: var(--size);
  transform-style: preserve-3d;
  animation: cube-spin 16s linear infinite;
}
.face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(168, 180, 191, .88);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, .45);
}
.face img { width: 58%; height: 58%; object-fit: contain; }
.face.front  { transform: translateZ(calc(var(--size) / 2)); }
.face.back   { transform: rotateY(180deg) translateZ(calc(var(--size) / 2)); }
.face.right  { transform: rotateY(90deg) translateZ(calc(var(--size) / 2)); }
.face.left   { transform: rotateY(-90deg) translateZ(calc(var(--size) / 2)); }
.face.top    { transform: rotateX(90deg) translateZ(calc(var(--size) / 2)); }
.face.bottom { transform: rotateX(-90deg) translateZ(calc(var(--size) / 2)); }
@keyframes cube-spin {
  from { transform: rotateX(-24deg) rotateY(0deg); }
  to   { transform: rotateX(-24deg) rotateY(360deg); }
}

/* ---------- Portfolio ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 400px));
  gap: 16px;
}
.project {
  position: relative;
  aspect-ratio: 400 / 255;
  overflow: hidden;
  /* the image + gradient fallback are set inline on each card in the HTML */
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.shade {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 1.4rem;
  background: rgba(2, 42, 69, .86);
  opacity: 0;
  transition: opacity .3s ease;
}
.project:hover .shade,
.project:focus-within .shade { opacity: 1; }
.shade h3, .shade p {
  align-self: flex-start;
  margin: 0;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--yellow);
}
.preview {
  padding: .8rem 1.2rem;
  border: 1px solid var(--yellow);
  color: var(--yellow);
  font-family: var(--serif);
  font-size: .95rem;
  letter-spacing: .18em;
  transition: background .2s, color .2s;
}
.preview:hover, .preview:focus-visible { background: var(--yellow); color: var(--navy); }
@media (hover: none) {
  .shade { opacity: 1; background: linear-gradient(transparent 35%, rgba(2, 42, 69, .92)); justify-content: flex-end; gap: .3rem; }
  .shade h3 { order: 1; }
  .preview { order: 3; align-self: flex-start; padding: .45rem .8rem; font-size: .8rem; margin-top: .4rem; }
  .shade p { order: 2; }
}

/* ---------- Skills ---------- */
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 22px 20px;
  max-width: 620px;
}
.tools li { width: 82px; height: 82px; display: grid; place-items: center; }
.tools img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .2s ease;
}
.tools li:hover img { transform: scale(1.08); }

/* ---------- Contact ---------- */
.main-contact { padding: 0; }
.contact {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  min-height: 100vh;
}
.contact-info { padding: 3.2rem 1.6rem 7rem 4.4rem; }
.contact-copy {
  max-width: 480px;
  margin: 0 0 1.4rem;
  font-size: .8rem;
  line-height: 1.55;
}

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 480px;
}
.form .wide, .form .actions { grid-column: 1 / -1; }
.form input, .form textarea {
  width: 100%;
  padding: .95rem 1rem;
  border: 0;
  background: #0f5276;
  color: var(--text);
  font: inherit;
  font-size: .85rem;
}
.form textarea { height: 150px; resize: vertical; }
.form ::placeholder { color: rgba(255, 255, 255, .45); }
.form .actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.form-status { margin: 0; font-size: .8rem; color: var(--muted); }
button.btn { background: transparent; font-family: inherit; cursor: pointer; }
button.btn:hover { background: var(--yellow); color: var(--navy); }

.contact-map { position: relative; min-height: 100vh; background: #e8e4dc; }
.contact-map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.map-card {
  position: absolute;
  top: 3rem;
  left: 4.5rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.2rem 1.5rem;
  background: #000;
  font-family: var(--serif);
  font-size: .95rem;
}
.map-card .where { font-weight: 700; margin-bottom: .6rem; }
.map-card a { color: var(--yellow); }
.map-card i { margin-right: .3rem; }

/* ---------- Inner pages on small screens ---------- */
@media (max-width: 860px) {
  .page { padding: 3rem 0 2rem 0; }
  .about { grid-template-columns: 1fr; gap: 1rem; }
  .cube-scene { height: 300px; }
  .tools li { width: 64px; height: 64px; }

  .contact { grid-template-columns: 1fr; min-height: 0; }
  .contact-info { padding: 3rem 0 2rem; }
  .contact-map { min-height: 380px; margin: 0 -1.5rem; }
  .map-card { top: 1rem; left: 1rem; font-size: .85rem; }
  .main-contact { padding: 0 1.5rem 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .cube { animation: none; transform: rotateX(-24deg) rotateY(35deg); }
}
