/* Eniyan S R — "Depth" theme
   Light, professional palette: sage, sand and amber. No dark, blue or red.
   3D comes from real CSS perspective: a tilting hero scene, cards that
   follow the pointer, extruded buttons/stats, and a rotating skills cube. */

@import url("https://fonts.googleapis.com/css2?family=Sora:wght@500;600;800&family=Nunito+Sans:wght@400;600;700&display=swap");
@import url("css/3d-modules.css");
@import url("bg-grid.css");

:root {
  --bg: #edf3ee;          /* pale sage */
  --surface: #fbfdfb;
  --sand: #e8e0cf;
  --ink: #26352d;         /* deep olive-grey, for readable text only */
  --muted: #5b6d62;
  --green: #2f8a5a;       /* primary */
  --green-deep: #206a43;  /* extrusion edge */
  --leaf: #a9d3a0;
  --amber: #e9a63f;       /* highlight */
  --amber-deep: #c4811d;
  --shadow: 46 90 66;     /* rgb triplet for green-tinted shadows */
  --max: 1120px;
  --display: "Sora", "Segoe UI", system-ui, sans-serif;
  --body: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0; color: var(--ink); font: 400 1.0625rem/1.65 var(--body);
  background:
    radial-gradient(900px 500px at 85% -5%, #dcebd9 0%, transparent 60%),
    radial-gradient(700px 500px at -5% 40%, #f2ead8 0%, transparent 60%),
    var(--bg);
}
img { max-width: 100%; display: block; }
a { color: var(--green-deep); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.wrap { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }

h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.8rem, 8vw, 5.5rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; max-width: 62ch; }

/* ---------- Navigation (Matching Reference Image) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgb(237 243 238 / .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgb(var(--shadow) / .12);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 4.25rem;
}
.brand {
  font: 800 1.25rem/1 var(--display);
  color: var(--ink) !important;
  text-decoration: none;
  letter-spacing: -0.02em;
  margin-right: auto;
}
.nav ul {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav ul a {
  display: inline-block;
  color: var(--ink) !important;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: .95rem;
  padding: .4rem .1rem;
  border-bottom: 3px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
.nav ul a:hover,
.nav ul a[aria-current="page"] {
  border-bottom: 3px solid var(--amber) !important;
  color: var(--ink) !important;
}
.menu-btn {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--surface);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--leaf);
}

/* ---------- Extruded buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.75rem; }
.btn {
  display: inline-block; padding: .85rem 1.5rem; border-radius: 12px;
  font: 600 1rem var(--display); text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.btn.primary { background: var(--green); color: #fff; box-shadow: 0 6px 0 var(--green-deep), 0 14px 22px rgb(var(--shadow) / .25); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: 0 6px 0 var(--sand), 0 14px 22px rgb(var(--shadow) / .12); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(5px); }
.btn.primary:active { box-shadow: 0 1px 0 var(--green-deep); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--sand); }

/* ---------- Hero: 3D scene ---------- */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 2rem; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3rem; align-items: center; }
.lead { font-size: 1.22rem; color: var(--muted); margin-top: 1.25rem; }
.lead strong { color: var(--ink); }
.hero h1 span { display: block; color: var(--green); }

.stage { perspective: 1100px; padding: 1.5rem; }
.scene {
  position: relative; aspect-ratio: 4/5; max-width: 420px; margin-inline: auto;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 6deg)) rotateY(var(--ry, -10deg));
  transition: transform .25s ease-out;
}
.plate { position: absolute; border-radius: 22px; }
.plate.back  { inset: 6% -8% -6% 8%;  background: var(--leaf);  transform: translateZ(-60px); box-shadow: 0 30px 50px rgb(var(--shadow) / .25); }
.plate.mid   { inset: 3% -3% -3% 3%;  background: var(--sand);  transform: translateZ(-30px); }
.plate.front { inset: 0; background: var(--surface); padding: 12px; transform: translateZ(0); box-shadow: 0 20px 40px rgb(var(--shadow) / .2); }
.plate.front img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.float {
  position: absolute; padding: .55rem 1rem; border-radius: 999px; background: var(--surface);
  font: 700 .95rem var(--display); box-shadow: 0 12px 24px rgb(var(--shadow) / .25);
  display: flex; gap: .5rem; align-items: center; white-space: nowrap;
}
.float i { width: .7rem; height: .7rem; border-radius: 50%; background: var(--amber); }
.float.a { top: 8%;  left: -14%; transform: translateZ(80px); }
.float.b { top: 52%; right: -16%; transform: translateZ(110px); }
.float.c { bottom: 6%; left: -6%; transform: translateZ(70px); }
.float.b i { background: var(--green); }
.float.c i { background: var(--leaf); }

/* ---------- Stats: extruded blocks ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-top: 3rem; }
.stat {
  padding: 1.2rem 1.3rem; border-radius: 16px; background: var(--surface);
  box-shadow: 0 8px 0 var(--leaf), 0 18px 28px rgb(var(--shadow) / .15);
  transition: transform .2s;
}
.stat:hover { transform: translateY(-4px); }
.stat:nth-child(even) { box-shadow: 0 8px 0 var(--sand), 0 18px 28px rgb(var(--shadow) / .15); }
.stat b { display: block; font: 800 2.3rem/1 var(--display); color: var(--green); letter-spacing: -.03em; }
.stat span { font-size: .93rem; color: var(--muted); }

/* ---------- Sections ---------- */
section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.sec-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2.25rem; }
.sec-head p { margin: .5rem 0 0; color: var(--muted); }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2rem; }
.chip { padding: .5rem 1.1rem; border: 0; border-radius: 10px; background: var(--surface); color: var(--ink); font: 700 .95rem var(--body); cursor: pointer; box-shadow: 0 4px 0 var(--sand); }
.chip:hover { transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--amber); box-shadow: 0 4px 0 var(--amber-deep); }

/* ---------- Project cards: pointer-tilt ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; perspective: 1200px; }
.card {
  position: relative; display: flex; flex-direction: column; background: var(--surface);
  border-radius: 20px; overflow: hidden; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  box-shadow: 0 6px 0 var(--leaf), 0 24px 36px rgb(var(--shadow) / .18);
  transition: transform .2s ease-out, box-shadow .2s;
}
.card[hidden] { display: none; }
.card:hover { box-shadow: 0 6px 0 var(--amber), 0 34px 48px rgb(var(--shadow) / .25); }
.card .shot { aspect-ratio: 16/10; overflow: hidden; background: var(--sand); }
.card .shot img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 1.3rem 1.4rem .4rem; flex: 1; }
.card .body p { color: var(--muted); font-size: 1rem; margin: .6rem 0 0; }
.card .meta { display: flex; flex-wrap: wrap; gap: .45rem; padding: 1rem 1.4rem; margin: 0; list-style: none; }
.card .meta li { padding: .2rem .7rem; border-radius: 999px; background: var(--bg); font-size: .85rem; font-weight: 700; color: var(--green-deep); }
.card .more { padding: 0 1.4rem 1.3rem; font: 600 .95rem var(--display); }
.card .more a::after { content: ""; position: absolute; inset: 0; z-index: 2; }
/* light sweep that follows the pointer */
.card::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 0%), rgb(255 255 255 / .55), transparent 60%);
}
.card:hover::before { opacity: 1; }

/* ---------- Skills cube ---------- */
.cube-wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: center; }
.cube-stage { --s: clamp(230px, 62vw, 320px); perspective: 1200px; height: calc(var(--s) + 70px); display: grid; place-items: center; }
.cube { position: relative; width: var(--s); height: var(--s); transform-style: preserve-3d; transform: rotateX(-8deg) rotateY(calc(var(--i, 0) * -90deg)); transition: transform .9s cubic-bezier(.5, 0, .2, 1); }
.face {
  position: absolute; inset: 0; padding: 1.4rem; border-radius: 18px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: .8rem;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / .6);
}
.face:nth-child(1) { transform: rotateY(0deg) translateZ(calc(var(--s) / 2)); background: var(--leaf); }
.face:nth-child(2) { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); background: var(--sand); }
.face:nth-child(3) { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); background: #f6dfae; }       /* soft amber tint */
.face:nth-child(4) { transform: rotateY(270deg) translateZ(calc(var(--s) / 2)); background: #d3e6c8; }
.face ul { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.face li { padding: .2rem .65rem; border-radius: 999px; background: rgb(255 255 255 / .75); font-size: .87rem; font-weight: 700; }
.face p { font-size: .95rem; margin: 0; color: var(--ink); }
.cube-ui { display: flex; align-items: center; gap: .75rem; margin-top: 1.5rem; }
.cube-ui .btn { padding: .6rem 1.1rem; box-shadow: 0 4px 0 var(--sand); background: var(--surface); color: var(--ink); }
.cube-ui .btn:active { box-shadow: 0 1px 0 var(--sand); }
.cube-ui output { font-weight: 700; color: var(--muted); min-width: 10ch; }
.cube-info p { color: var(--muted); }

/* ---------- Contact ---------- */
.contact .panel {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: center;
  padding: clamp(1.75rem, 4vw, 3rem); border-radius: 26px; background: var(--green); color: #fff;
  box-shadow: 0 12px 0 var(--green-deep), 0 30px 50px rgb(var(--shadow) / .3);
}
.contact h2 { color: #fff; }
.contact p { color: rgb(255 255 255 / .88); margin-top: 1rem; }
.contact .actions { margin: 0; justify-content: flex-end; }
.contact .btn.primary { background: var(--amber); color: var(--ink); box-shadow: 0 6px 0 var(--amber-deep); }
.contact .btn.primary:active { box-shadow: 0 1px 0 var(--amber-deep); }
.contact .btn.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px #fff, 0 6px 0 var(--green-deep); }

footer { padding: 2.5rem 0 3rem; font-size: .95rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
footer a { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid, .cube-wrap, .contact .panel { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .float.a { left: -4%; } .float.b { right: -4%; }
  .contact .actions { justify-content: flex-start; }
  .menu-btn { display: grid; }
  .nav ul { position: absolute; inset: 4rem 0 auto 0; flex-direction: column; gap: 0; display: none; background: var(--surface); padding: .5rem 1.25rem 1rem; box-shadow: 0 16px 24px rgb(var(--shadow) / .15); }
  .nav ul.open { display: flex; }
  .nav ul a { display: block; padding: .7rem 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .scene, .card { transform: none; }
}
