/* ==========================================================================
   Tangang Kevin — Portfolio Stylesheet
   Concept: a developer's dark terminal — black background, phosphor-green
   text and accents, amber used sparingly for secondary highlights, set in
   a monospace/humanist type pairing.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Core palette */
  --bg: #090c0a;
  --bg-alt: #0d1210;
  --surface: #121915;
  --surface-2: #182019;
  --border: #223028;
  --border-soft: #1a2420;

  /* Green — primary */
  --green: #34d67f;
  --green-bright: #6ff5ac;
  --green-dim: #1b6b45;
  --green-glow: rgba(52, 214, 127, 0.35);

  /* Amber — tertiary accent */
  --amber: #f5a623;
  --amber-dim: #b97a15;
  --amber-glow: rgba(245, 166, 35, 0.3);

  /* Text */
  --text: #eaf2ec;
  --text-dim: #9db3a9;
  --text-faint: #6b7f75;

  /* Type */
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-body: 'Poppins', sans-serif;
  --font-display: 'Montserrat', sans-serif;

  /* Layout */
  --container: 1180px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 15% 10%, rgba(52, 214, 127, 0.06), transparent 40%),
    radial-gradient(circle at 85% 0%, rgba(245, 166, 35, 0.05), transparent 35%),
    linear-gradient(var(--bg), var(--bg));
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

p {
  color: var(--text-dim);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

::selection {
  background: var(--green);
  color: #06110b;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--green-dim);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--green);
}

/* Visible keyboard focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Reusable eyebrow / comment-style label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--green);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  opacity: 0;
  animation: fadeInUp 0.7s ease forwards;
}

/* ---------- Keyframe animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes blink {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 var(--green-glow); }
  50%      { box-shadow: 0 0 0 10px rgba(52, 214, 127, 0); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

@keyframes scanline {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

@keyframes dash {
  to { stroke-dashoffset: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Header ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 18px 0;
  background: rgba(9, 12, 10, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  transition: padding var(--transition), background var(--transition);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.logo span {
  padding: 6px 10px;
  border: 1px solid var(--green-dim);
  border-radius: var(--radius-sm);
  color: var(--green-bright);
  background: rgba(52, 214, 127, 0.08);
}

.logo::after {
  content: '';
  width: 8px;
  height: 18px;
  background: var(--amber);
  margin-left: 4px;
  animation: blink 1.1s step-end infinite;
}

.nav-links {
  display: flex;
  gap: 36px;
}

.nav-links a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text-dim);
  padding: 4px 2px;
  transition: color var(--transition);
}

.nav-links a::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--green-bright);
}

.nav-links a:hover::before,
.nav-links a:focus-visible::before {
  width: 100%;
}

/* ---------- Buttons ---------- */
.btn,
.channel-link,
.contact-btn,
.contact-form button {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.btn {
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: #06140c;
  font-weight: 600;
  border: 1px solid var(--green);
}

.btn::before {
  content: '$ ';
  opacity: 0.6;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -8px var(--green-glow);
  background: var(--green-bright);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  margin-left: 14px;
}

.btn-outline::before {
  content: '> ';
  color: var(--amber);
  opacity: 0.9;
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--amber);
  color: var(--amber);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -10px var(--amber-glow);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 90px;
  background-image:
    linear-gradient(180deg, rgba(9, 12, 10, 0) 0%, var(--bg) 94%),
    linear-gradient(rgba(7, 10, 8, 0.88), rgba(7, 10, 8, 0.93)),
    repeating-linear-gradient(0deg, rgba(52, 214, 127, 0.05) 0px, rgba(52, 214, 127, 0.05) 1px, transparent 1px, transparent 42px),
    repeating-linear-gradient(90deg, rgba(52, 214, 127, 0.05) 0px, rgba(52, 214, 127, 0.05) 1px, transparent 1px, transparent 42px),
    url('/media/hero3.jpg');
  background-repeat: no-repeat, no-repeat, repeat, repeat, no-repeat;
  background-position: center, center, center, center, center;
  background-size: 100% 100%, 100% 100%, auto, auto, cover;
  background-attachment: scroll, scroll, scroll, scroll, fixed;
  overflow: hidden;
}

@media (max-width: 900px) {
  .hero {
    background-attachment: scroll, scroll, scroll, scroll, scroll;
  }
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, rgba(52, 214, 127, 0.12), transparent 55%);
  animation: floatSlow 9s ease-in-out infinite;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 780px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.1;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.15s forwards;
  margin-bottom: 18px;
}

.hero h1 span {
  color: var(--green);
  position: relative;
  display: inline-block;
}

.hero h1 span::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 6px;
  width: 100%;
  height: 10px;
  background: rgba(52, 214, 127, 0.18);
  z-index: -1;
  border-radius: 2px;
}

.typewriter {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  color: var(--text-dim);
  min-height: 1.8em;
  border-left: 2px solid var(--amber);
  padding-left: 12px;
  margin-bottom: 34px;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.35s forwards;
}

.typewriter::after {
  content: '';
}

.hero-btns {
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.55s forwards;
}

/* ---------- Section shared ---------- */
section {
  padding: 120px 0;
  position: relative;
}

#about,
#youtube {
  background: var(--bg-alt);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.section-title {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 64px;
}

.section-title .eyebrow {
  justify-content: center;
  display: block;
}

.section-title h2 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -14px;
  transform: translateX(-50%);
  width: 64px;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--amber));
  border-radius: 3px;
}

/* Scroll-reveal helper (progressive enhancement, no JS required) */
.about-content,
.project-card,
.video-card,
.contact-info,
.contact-form {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
  animation-timeline: view();
  animation-range: entry 0% cover 25%;
}

/* ---------- About ---------- */
.about-content {
  display: grid;
  place-items: center;
}

.about-text {
  max-width: 760px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 46px 44px;
  position: relative;
}

.about-text::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--amber), var(--green));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.about-text h3 {
  font-size: 1.4rem;
  color: var(--green-bright);
  margin-bottom: 18px;
}

.about-text p {
  margin-bottom: 16px;
}

.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color var(--transition), transform var(--transition), color var(--transition);
}

.badge i {
  color: var(--amber);
}

.badge:hover {
  border-color: var(--green);
  color: var(--green-bright);
  transform: translateY(-2px);
}

/* ---------- Portfolio ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--green-dim);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--green-dim);
}

.project-img {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.6s ease;
  filter: grayscale(35%) brightness(0.85);
}

.project-card:hover .project-img img {
  transform: scale(1.08);
  filter: grayscale(0%) brightness(1);
}

.project-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(9, 12, 10, 0.85) 100%);
}

.project-content {
  padding: 26px 24px 28px;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--amber);
  letter-spacing: 0.05em;
}

.project-content h3 {
  font-size: 1.15rem;
  margin: 8px 0 12px;
  color: var(--text);
}

.project-content p {
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-link i {
  transition: transform var(--transition);
}

.project-link:hover i,
.project-link:focus-visible i {
  transform: translateX(6px);
}

.project-link:hover,
.project-link:focus-visible {
  color: var(--green-bright);
}

/* ---------- YouTube ---------- */
.youtube-content {
  text-align: center;
}

.youtube-content > p {
  max-width: 620px;
  margin: 0 auto 30px;
}

.channel-link {
  background: var(--amber);
  color: #241605;
  padding: 15px 30px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-bottom: 60px;
}

.channel-link i {
  font-size: 1.1rem;
}

.channel-link:hover,
.channel-link:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -10px var(--amber-glow);
  background: #ffb944;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  text-align: left;
  margin-top: 10px;
}

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition);
}

.video-card:hover {
  transform: translateY(-6px);
  border-color: var(--green-dim);
}

.video-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--surface-2), var(--bg-alt));
  overflow: hidden;
}

.video-thumbnail iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(52, 214, 127, 0.12);
  pointer-events: none;
  z-index: 2;
  transition: box-shadow var(--transition);
}

.video-card:hover .video-thumbnail::after {
  box-shadow: inset 0 0 0 2px var(--green-dim);
}

.video-info {
  padding: 20px;
}

.video-info h4 {
  font-size: 1.02rem;
  margin-bottom: 8px;
  color: var(--text);
}

.video-info p {
  font-size: 0.88rem;
}

/* ---------- Contact ---------- */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 50px;
  align-items: start;
}

.contact-info h3 {
  font-size: 1.5rem;
  color: var(--green-bright);
  margin-bottom: 16px;
}

.contact-info p {
  margin-bottom: 30px;
}

.contact-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.contact-btn {
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
}

.contact-btn i {
  color: var(--green);
}

.contact-btn.email i {
  color: var(--amber);
}

.contact-btn:hover,
.contact-btn:focus-visible {
  border-color: var(--green);
  transform: translateY(-3px);
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.form-group {
  margin-bottom: 20px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-faint);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.contact-form button {
  width: 100%;
  justify-content: center;
  background: var(--green);
  color: #06140c;
  padding: 15px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.contact-form button:hover,
.contact-form button:focus-visible {
  background: var(--green-bright);
  box-shadow: 0 10px 24px -8px var(--green-glow);
}

/* ---------- Footer ---------- */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border-soft);
  padding: 80px 0 0;
}

.footer-content {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr;
  gap: 50px;
  padding-bottom: 50px;
}

.footer-content h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 18px;
}

.footer-about p {
  margin-bottom: 22px;
  font-size: 0.92rem;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}

.social-links a:hover,
.social-links a:focus-visible {
  border-color: var(--green);
  color: var(--green-bright);
  transform: translateY(-4px);
}

.footer-links ul li {
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: color var(--transition), padding-left var(--transition);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--green);
  padding-left: 6px;
}

.footer-newsletter p {
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.newsletter-form {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.newsletter-form input {
  flex: 1;
  background: var(--surface);
  border: none;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
}

.newsletter-form input:focus {
  outline: none;
}

.newsletter-form button {
  background: var(--amber);
  color: #241605;
  border: none;
  padding: 0 18px;
  cursor: pointer;
  transition: background var(--transition);
}

.newsletter-form button:hover {
  background: #ffb944;
}

.copyright {
  border-top: 1px solid var(--border-soft);
  padding: 24px 0;
  text-align: center;
}

.copyright p {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .contact-container {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  section {
    padding: 90px 0;
  }

  .nav-links {
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .header-container {
    flex-direction: column;
    gap: 14px;
  }

  header {
    padding: 14px 0;
  }

  .hero {
    padding-top: 130px;
    text-align: center;
  }

  .hero-content {
    margin: 0 auto;
  }

  .typewriter {
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    max-width: fit-content;
  }

  .hero-btns {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
  }

  .btn-outline {
    margin-left: 0;
  }

  .about-text {
    padding: 32px 26px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .social-links,
  .contact-methods,
  .about-badges {
    justify-content: center;
  }

  .footer-links ul {
    padding: 0;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 18px;
  }

  .hero h1 {
    font-size: 2.1rem;
  }

  .btn,
  .btn-outline {
    width: 100%;
    justify-content: center;
  }
}
