/* ============================================================
   MARLON I. TAYAG — personal site styles
   Theme: dark "developer terminal" look
   ------------------------------------------------------------
   EASY EDITS:
   - Colors: change the variables in :root below (one place).
   - Fonts: swap the Google Fonts link in index.html.
   - Spacing/layout: tweak --radius, --space values here.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #05070d;
  --bg-soft: #0a0f1c;
  --card: #0d1424;
  --card-2: #101a30;
  --line: #1c2a45;
  --line-soft: #16223a;
  --text: #e8eefb;
  --muted: #8fa0bd;
  --muted-2: #5f7194;

  --accent: #22d3ee;      /* cyan */
  --accent-2: #a78bfa;    /* violet */
  --ok: #34d399;          /* green */
  --warn: #fbbf24;        /* amber */
  --danger: #f87171;      /* red */

  --grad: linear-gradient(120deg, var(--accent), var(--accent-2));
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", var(--font-body);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-h: 66px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: #7deaff; }
ul { list-style: none; }
b, strong { color: #fff; font-weight: 600; }

::selection { background: rgba(34, 211, 238, .28); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #2b3f66; }

/* ---------- Fixed background decorations ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(34, 211, 238, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 55%, transparent 100%);
}

.glow {
  position: fixed; z-index: -1; pointer-events: none; border-radius: 50%;
  filter: blur(110px); opacity: .5;
}
.glow-1 {
  width: 560px; height: 560px; top: -180px; left: -120px;
  background: radial-gradient(circle, rgba(34, 211, 238, .30), transparent 70%);
  animation: drift 16s ease-in-out infinite alternate;
}
.glow-2 {
  width: 620px; height: 620px; bottom: -240px; right: -180px;
  background: radial-gradient(circle, rgba(167, 139, 250, .26), transparent 70%);
  animation: drift 20s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, 40px) scale(1.12); }
}

/* ---------- Layout helpers ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.grid { display: grid; gap: 24px; }

.section { padding: 96px 0; position: relative; }
.section-alt { background: var(--bg-soft); border-block: 1px solid var(--line-soft); }

.section-kicker {
  font-family: var(--font-mono);
  font-size: .95rem;
  color: var(--accent);
  letter-spacing: .08em;
  margin-bottom: 6px;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: "";
  position: absolute; left: 0; bottom: -10px;
  width: 74px; height: 3px; border-radius: 3px;
  background: var(--grad);
}

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}
.card h4 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  margin-bottom: 16px;
  color: #fff;
}
.card h4::before { content: "// "; color: var(--accent); font-family: var(--font-mono); }

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .88rem; font-weight: 500;
  padding: 12px 22px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: all .22s;
}
.btn .arrow { transition: transform .22s; }
.btn:hover .arrow { transform: translateX(4px); }

.btn-primary {
  background: var(--grad); color: #07101f; font-weight: 700;
  box-shadow: 0 8px 24px rgba(34, 211, 238, .25);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(167, 139, 250, .35); transform: translateY(-2px); color: #07101f; }

.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.btn-sm { padding: 8px 14px; font-size: .8rem; }

.chip {
  display: inline-block;
  font-family: var(--font-mono); font-size: .8rem;
  padding: 6px 14px; margin: 0 8px 8px 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip-accent { border-color: rgba(34, 211, 238, .45); color: var(--accent); background: rgba(34, 211, 238, .08); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(5, 7, 13, .6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--line-soft); background: rgba(5, 7, 13, .85); }

.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }

.logo {
  font-family: var(--font-mono); font-weight: 700; font-size: 1.15rem;
  color: var(--text); letter-spacing: .02em;
}
.logo-bracket { color: var(--accent); }
.logo-cursor { color: var(--accent-2); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--muted);
  font-size: .92rem; font-weight: 500;
  padding: 8px 14px; border-radius: 8px;
}
.nav-links a:hover { color: var(--accent); background: rgba(34, 211, 238, .06); }
.nav-links a.active { color: var(--accent); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span {
  display: block; width: 22px; height: 2px; margin: 5px 0;
  background: var(--text); border-radius: 2px; transition: transform .25s, opacity .25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--nav-h) + 40px) 0 80px;
  position: relative;
}

.hero-grid {
  display: grid; grid-template-columns: 1.35fr .8fr; gap: 28px;
  align-items: center;
}

/* Terminal window */
.terminal {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(10, 15, 28, .9);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .04);
  overflow: hidden;
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px;
  background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid var(--line-soft);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: var(--danger); }
.dot-y { background: var(--warn); }
.dot-g { background: var(--ok); }
.terminal-title {
  margin-left: 10px;
  font-family: var(--font-mono); font-size: .78rem;
  color: var(--muted-2);
}

.terminal-body { padding: 28px 30px 30px; font-family: var(--font-mono); }
.terminal-body p { margin-bottom: 14px; font-size: .92rem; color: var(--muted); }
.prompt { color: var(--ok); font-weight: 700; margin-right: 4px; }
.comment { color: var(--muted-2); }

.hero-name {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4.6vw, 3.3rem);
  font-weight: 700; line-height: 1.1; letter-spacing: .01em;
  color: #fff;
  margin: 2px 0 18px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.typed-line { min-height: 1.5em; color: var(--accent) !important; }
.caret {
  display: inline-block; width: 9px; height: 1.15em;
  background: var(--accent); vertical-align: text-bottom;
  margin-left: 3px; animation: blink .95s steps(1) infinite;
}

.hero-actions { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions .btn { font-family: var(--font-body); }

/* Hero side card */
.hero-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  background: linear-gradient(180deg, rgba(13, 20, 36, .9), rgba(10, 15, 28, .9));
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 20px;
}
.hero-card-top {
  font-family: var(--font-mono); font-size: .8rem; color: var(--ok);
  display: flex; align-items: center; gap: 10px;
}
.pulse-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  70%  { box-shadow: 0 0 0 12px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.hero-stat { display: flex; flex-direction: column; gap: 2px; padding-bottom: 18px; border-bottom: 1px dashed var(--line); }
.hero-stat-num {
  font-family: var(--font-head); font-weight: 700;
  font-size: 2.1rem; color: #fff; line-height: 1;
}
.hero-stat-num span { color: var(--accent); }
.hero-stat-label { font-size: .86rem; color: var(--muted); }
.hero-links { display: flex; flex-wrap: wrap; gap: 8px; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 26px;
  transform: translateX(-50%);
  width: 26px; height: 44px;
  border: 2px solid var(--line); border-radius: 14px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px;
  width: 4px; height: 8px; border-radius: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue {
  0%   { opacity: 1; top: 8px; }
  60%  { opacity: 0; top: 22px; }
  100% { opacity: 0; top: 8px; }
}

/* ---------- About ---------- */
.about-grid { grid-template-columns: 1.25fr .75fr; align-items: start; }
.about-story p { margin-bottom: 14px; color: var(--muted); }
.about-family { font-size: .94rem; }

.facts > div {
  display: grid; grid-template-columns: 110px 1fr;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.facts dt { font-family: var(--font-mono); font-size: .82rem; color: var(--muted-2); }
.facts dd { font-size: .95rem; color: var(--text); word-break: break-word; }

.about-vcard {
  margin-top: 20px; padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex; gap: 18px; align-items: flex-start;
}
.about-vcard img {
  border-radius: 10px; border: 1px solid var(--line);
  padding: 6px; background: #fff;
  flex-shrink: 0;
}
.about-vcard-title { font-weight: 600; color: #fff; margin-bottom: 4px; }
.about-vcard p { font-size: .86rem; color: var(--muted); margin-bottom: 8px; }

/* ---------- Skills ---------- */
.skills-grid { grid-template-columns: 1fr 1fr; align-items: start; }
.cert-group { margin-bottom: 22px; }
.cert-label {
  font-family: var(--font-mono); font-size: .8rem;
  color: var(--accent-2); letter-spacing: .06em;
  margin-bottom: 10px; text-transform: uppercase;
}

.bar { margin-bottom: 18px; }
.bar-head {
  display: flex; justify-content: space-between;
  font-size: .9rem; margin-bottom: 7px;
}
.bar-val { font-family: var(--font-mono); color: var(--accent); }
.bar-track {
  height: 9px; border-radius: 6px;
  background: var(--line-soft);
  overflow: hidden;
}
.bar-fill {
  height: 100%; width: 0;
  border-radius: 6px;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(34, 211, 238, .45);
  transition: width 1.2s cubic-bezier(.22, .8, .3, 1);
}
.note { font-size: .82rem; color: var(--muted-2); margin-top: 12px; }

/* ---------- Resume / timeline ---------- */
.timeline-title { margin-bottom: 24px; }
.timeline {
  position: relative;
  padding-left: 26px;
}
.timeline::before {
  content: "";
  position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}
.timeline-item { position: relative; margin-bottom: 30px; }
.timeline-item:last-child { margin-bottom: 4px; }
.timeline-dot {
  position: absolute; left: -26px; top: 5px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 10px rgba(34, 211, 238, .55);
}
.timeline-date {
  font-family: var(--font-mono); font-size: .8rem;
  color: var(--accent-2); letter-spacing: .04em;
  margin-bottom: 4px;
}
.timeline-body h5 { font-family: var(--font-head); font-size: 1.08rem; color: #fff; margin-bottom: 2px; }
.timeline-role { color: var(--accent); font-size: .88rem; margin-bottom: 8px; }
.timeline-body p { color: var(--muted); font-size: .93rem; }
.tag {
  font-family: var(--font-mono); font-size: .68rem;
  color: var(--muted-2); border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 6px; vertical-align: 2px;
  margin-left: 6px;
}

/* ---------- Research ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.filter-btn {
  font-family: var(--font-mono); font-size: .84rem;
  padding: 9px 20px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); transition: all .2s;
}
.filter-btn:hover { color: var(--accent); border-color: var(--accent); }
.filter-btn.active {
  background: var(--grad); color: #07101f; font-weight: 700;
  border-color: transparent;
}

.research-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.research-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
  transition: transform .25s, border-color .25s, opacity .3s;
}
.research-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.research-card.hidden { display: none; }
.research-img { position: relative; overflow: hidden; }
.research-img img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  transition: transform .5s;
}
.research-card:hover .research-img img { transform: scale(1.06); }
.research-tag {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--font-mono); font-size: .7rem;
  padding: 4px 12px; border-radius: 999px;
  background: rgba(5, 7, 13, .72); color: var(--accent);
  border: 1px solid rgba(34, 211, 238, .4);
  backdrop-filter: blur(4px);
}
.research-card figcaption { padding: 18px 20px 22px; }
.research-card h4 { font-family: var(--font-head); font-size: 1.1rem; color: #fff; margin-bottom: 6px; }
.research-card p { font-size: .88rem; color: var(--muted); }

/* ---------- vCard / QR section ---------- */
.vcard-card {
  display: grid; grid-template-columns: auto 1fr;
  gap: 36px; align-items: center;
  padding: 40px;
}
.vcard-qr {
  padding: 14px; border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, .12), var(--shadow);
}
.vcard-qr img { border-radius: 4px; }
.vcard-info p { color: var(--muted); margin-bottom: 12px; max-width: 560px; }
.vcard-info .section-title { margin-bottom: 18px; }
.vcard-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Contact ---------- */
.contact-grid { grid-template-columns: 1.2fr .8fr; align-items: start; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: var(--font-body); font-size: .93rem;
  color: var(--text);
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-bottom: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .15);
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--muted-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-status { font-size: .85rem; min-height: 1.2em; margin-top: 10px; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }

.contact-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.contact-list a { color: var(--text); }
.contact-list a:hover { color: var(--accent); }
.contact-icon {
  font-family: var(--font-mono);
  width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: rgba(34, 211, 238, .08);
  border: 1px solid rgba(34, 211, 238, .3);
  color: var(--accent);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 34px 0;
  background: var(--bg-soft);
}
.footer-inner {
  display: flex; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  font-size: .88rem; color: var(--muted);
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .glow, .caret, .logo-cursor, .pulse-dot, .scroll-cue span { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { order: -1; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .hero-card-top { flex-basis: 100%; }
  .hero-stat { flex: 1; min-width: 120px; }
  .about-grid, .skills-grid, .contact-grid { grid-template-columns: 1fr; }
  .vcard-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .vcard-info .section-title::after { left: 50%; transform: translateX(-50%); }
  .vcard-actions { justify-content: center; }
  .section { padding: 72px 0; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: rgba(5, 7, 13, .97);
    border-bottom: 1px solid var(--line);
    padding: 12px 20px 20px;
    transform: translateY(-120%);
    transition: transform .3s ease;
    backdrop-filter: blur(14px);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 10px; font-size: 1rem; }
  .nav-toggle { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
}
