/* ============================================================
   Dhamodharan M — Personal Security Portfolio
   Elegant dark "cyber" theme
   ============================================================ */

:root {
  --bg: #0a0e17;
  --bg-2: #0e1420;
  --surface: #121a28;
  --surface-2: #17202f;
  --border: #1e2a3d;
  --border-glow: #24364f;
  --text: #e6edf6;
  --text-dim: #9aa9bd;
  --text-faint: #6b7a90;
  --accent: #2dd4bf;       /* teal */
  --accent-2: #38bdf8;     /* sky */
  --accent-3: #a78bfa;     /* violet */
  --danger: #f87171;
  --warn: #fbbf24;
  --ok: #34d399;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
  --maxw: 1160px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Decorative background grid + glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 500px at 80% -5%, rgba(45, 212, 191, 0.10), transparent 60%),
    radial-gradient(800px 500px at 0% 10%, rgba(167, 139, 250, 0.08), transparent 55%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(45, 212, 191, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 212, 191, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 85%);
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-2); }

img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ===================== Navbar ===================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(10, 14, 23, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--text);
}
.brand .logo {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  font-family: var(--mono);
  font-weight: 700;
  color: #06231f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px -6px rgba(45, 212, 191, .6);
}
.brand small { display: block; font-size: .68rem; color: var(--text-faint); font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  display: block;
  padding: 9px 14px;
  border-radius: 9px;
  color: var(--text-dim);
  font-size: .92rem;
  font-weight: 500;
  transition: all .18s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active {
  color: var(--accent);
  background: rgba(45, 212, 191, 0.08);
}
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border);
  color: var(--text); border-radius: 9px;
  width: 42px; height: 42px; cursor: pointer;
  font-size: 1.2rem;
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06231f;
  box-shadow: 0 10px 26px -10px rgba(45, 212, 191, .6);
}
.btn-primary:hover { color: #06231f; }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ===================== Sections ===================== */
section { padding: 72px 0; }
.section-head { margin-bottom: 42px; }
.eyebrow {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 10px;
}
.eyebrow::before { content: "// "; color: var(--text-faint); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
h2.title { font-size: clamp(1.7rem, 3.5vw, 2.5rem); font-weight: 800; }
.section-head p { color: var(--text-dim); max-width: 640px; margin-top: 12px; }

/* ===================== Hero ===================== */
.hero { padding: 80px 0 56px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 54px;
  align-items: center;
}
.hero .status {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: .8rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 14px; border-radius: 999px;
  margin-bottom: 22px;
}
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52,211,153,.7); animation: pulse 2.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52,211,153,.6); }
  70% { box-shadow: 0 0 0 10px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
.hero h1 { font-size: clamp(2.3rem, 5.5vw, 3.7rem); font-weight: 800; margin-bottom: 8px; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 60%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .role { font-family: var(--mono); color: var(--accent); font-size: 1.05rem; margin-bottom: 20px; min-height: 1.6em; }
.hero p.lead { color: var(--text-dim); font-size: 1.05rem; max-width: 560px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.hero-meta { display: flex; gap: 26px; flex-wrap: wrap; }
.hero-meta .m { }
.hero-meta .m b { font-size: 1.5rem; font-weight: 800; color: var(--text); display: block; }
.hero-meta .m span { font-size: .82rem; color: var(--text-faint); }

.avatar-wrap { position: relative; justify-self: center; }
.avatar-ring {
  position: relative;
  width: 300px; height: 300px;
  border-radius: 50%;
  padding: 6px;
  background: conic-gradient(from 180deg, var(--accent), var(--accent-3), var(--accent-2), var(--accent));
  box-shadow: var(--shadow);
  animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar-ring img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 30%;
  animation: spin 14s linear infinite reverse;
  border: 5px solid var(--bg);
}
.avatar-ring .avatar-mono {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 5px solid var(--bg);
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(45,212,191,.18), transparent 60%),
    linear-gradient(160deg, var(--surface-2), var(--bg-2));
  animation: spin 14s linear infinite reverse;
  display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.avatar-ring .avatar-mono .initials {
  font-family: var(--mono); font-weight: 700;
  font-size: 4.6rem; letter-spacing: -2px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.avatar-ring .avatar-mono::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(45,212,191,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45,212,191,.08) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 72%);
}
.avatar-badge {
  position: absolute; bottom: 16px; right: 6px;
  background: var(--surface);
  border: 1px solid var(--border-glow);
  color: var(--accent);
  font-family: var(--mono); font-size: .78rem; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  box-shadow: var(--shadow);
}

/* ===================== Cards / grids ===================== */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-glow); box-shadow: var(--shadow); }

.grid { display: grid; gap: 22px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.icon-box {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid var(--border-glow);
  font-size: 1.4rem; margin-bottom: 16px;
}
.card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card p { color: var(--text-dim); font-size: .94rem; }

/* ===================== About ===================== */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.about-grid p { color: var(--text-dim); margin-bottom: 16px; }
.info-list { list-style: none; display: grid; gap: 14px; }
.info-list li { display: flex; gap: 12px; align-items: flex-start; }
.info-list .k { color: var(--text-faint); font-family: var(--mono); font-size: .82rem; min-width: 96px; }
.info-list .v { color: var(--text); font-size: .94rem; }

/* ===================== Timeline ===================== */
.timeline { position: relative; margin-left: 10px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(var(--accent), transparent);
}
.tl-item { position: relative; padding: 0 0 34px 38px; }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.tl-item.present::before { box-shadow: 0 0 0 4px rgba(45,212,191,.18); }
.tl-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.tl-head h3 { font-size: 1.12rem; }
.tl-company { color: var(--accent); font-weight: 600; }
.tl-date { font-family: var(--mono); font-size: .8rem; color: var(--text-faint); margin-left: auto; }
.tl-item p { color: var(--text-dim); font-size: .92rem; margin-top: 6px; }
.badge-now { font-family: var(--mono); font-size: .68rem; color: var(--ok); border: 1px solid rgba(52,211,153,.4); padding: 1px 8px; border-radius: 999px; }

/* ===================== Skills ===================== */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: var(--mono); font-size: .82rem;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); padding: 8px 14px; border-radius: 9px;
  transition: all .18s;
}
.chip:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* ===================== Certs ===================== */
.cert { display: flex; gap: 16px; align-items: flex-start; }
.cert .cert-logo {
  width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--mono); font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--border-glow); color: var(--accent);
  font-size: .9rem;
}
.cert h3 { font-size: 1rem; }
.cert .issuer { color: var(--text-dim); font-size: .88rem; }
.cert .meta { font-family: var(--mono); font-size: .76rem; color: var(--text-faint); margin-top: 4px; }

/* ===================== Downloads ===================== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.filter-btn {
  font-size: .86rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); padding: 9px 16px; border-radius: 999px; cursor: pointer;
  transition: all .18s;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: rgba(45,212,191,.1); border-color: var(--accent); color: var(--accent); }

.dl-card { display: flex; flex-direction: column; }
.dl-card .tag {
  align-self: flex-start;
  font-family: var(--mono); font-size: .7rem; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent-3); border: 1px solid var(--border-glow); background: var(--surface-2);
  padding: 3px 9px; border-radius: 6px; margin-bottom: 14px;
}
.dl-card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.dl-card .desc { color: var(--text-dim); font-size: .9rem; flex-grow: 1; margin-bottom: 18px; }
.dl-card .dl-foot { display: flex; align-items: center; justify-content: space-between; }
.dl-card .ftype { font-family: var(--mono); font-size: .76rem; color: var(--text-faint); }
.dl-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .85rem; font-weight: 600; color: var(--accent);
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
  transition: all .18s;
}
.dl-link:hover { background: var(--accent); color: #06231f; border-color: var(--accent); }

.notice {
  background: rgba(251,191,36,.06); border: 1px solid rgba(251,191,36,.25);
  border-radius: var(--radius-sm); padding: 14px 18px; color: var(--warn);
  font-size: .88rem; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 30px;
}

/* ===================== Blog ===================== */
.post-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.post-cover {
  height: 150px; background: linear-gradient(135deg, var(--surface-2), var(--bg-2));
  position: relative; display: grid; place-items: center; font-size: 2.6rem;
  border-bottom: 1px solid var(--border);
}
.post-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex-grow: 1; }
.post-meta { display: flex; gap: 12px; font-family: var(--mono); font-size: .76rem; color: var(--text-faint); margin-bottom: 10px; }
.post-body h3 { font-size: 1.18rem; margin-bottom: 10px; }
.post-body p { color: var(--text-dim); font-size: .92rem; flex-grow: 1; margin-bottom: 16px; }
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.post-tags span { font-size: .72rem; color: var(--accent); background: rgba(45,212,191,.08); padding: 3px 9px; border-radius: 6px; }
.read-more { font-size: .85rem; font-weight: 600; margin-top: 14px; }

/* ===================== Page header ===================== */
.page-hero { padding: 64px 0 20px; text-align: center; }
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; }
.page-hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-hero p { color: var(--text-dim); max-width: 640px; margin: 16px auto 0; }

/* ===================== Contact / CTA ===================== */
.cta-band {
  background: linear-gradient(135deg, rgba(45,212,191,.08), rgba(167,139,250,.06));
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 48px; text-align: center;
}
.cta-band h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 12px; }
.cta-band p { color: var(--text-dim); max-width: 520px; margin: 0 auto 26px; }
.social-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.social-row a {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 1.1rem; transition: all .18s;
}
.social-row a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }

/* ===================== Footer ===================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 46px;
  margin-top: 40px;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.footer p { color: var(--text-faint); font-size: .86rem; }
.footer .foot-links { display: flex; gap: 18px; list-style: none; flex-wrap: wrap; }
.footer .foot-links a { color: var(--text-dim); font-size: .86rem; }

/* ===================== Reveal animation ===================== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ===================== Responsive ===================== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .avatar-wrap { order: -1; }
  .about-grid { grid-template-columns: 1fr; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: 12px 16px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  section { padding: 54px 0; }
  .cta-band { padding: 32px 22px; }
}
@media (max-width: 520px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .avatar-ring { width: 240px; height: 240px; }
  .tl-date { margin-left: 0; width: 100%; }
}
