/* =============================================================================
   Veritaware.com — Stylesheet
   Eco-tech portfolio landing page
   ============================================================================= */

/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@300;400;600;700&family=Inter:wght@300;400;500&display=swap');

/* ── Brand Color Palette ──────────────────────────────────────────────────── */
:root {
  --carbon-black: #1b1b1b;   /* primary background  */
  --graphite:     #393939;   /* surface             */
  --charcoal:     #545454;   /* elevated            */
  --forest-moss:  #658415;   /* primary             */
  --lime-moss:    #95b63e;   /* accent / hover      */
  --golden-sand:  #c8d086;   /* highlight / focus   */
  --platinum:     #ebebeb;   /* text color          */

  /* Semantic aliases */
  --bg:        var(--carbon-black);
  --surface:   var(--graphite);
  --elevated:  var(--charcoal);
  --primary:   var(--forest-moss);
  --accent:    var(--lime-moss);
  --highlight: var(--golden-sand);
  --text:      var(--platinum);
  --text-muted: rgba(235, 235, 235, 0.58);

  /* Spacing scale */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* Border radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Typography */
  --font-heading: 'Josefin Sans', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Animation */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur:  200ms;

  /* Layout */
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
}

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

ul {
  list-style: none;
}

/* ── Container ────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.65rem var(--sp-6);
  border: 2px solid transparent;
  border-radius: var(--r-md);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    border-color     var(--dur) var(--ease),
    color            var(--dur) var(--ease),
    transform        var(--dur) var(--ease),
    box-shadow       var(--dur) var(--ease);
  white-space: nowrap;
}

.btn .btn-label {
  display: inline-block;
  transform: translateY(2px); /* move only text up */
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(101, 132, 21, 0.35);
}

.btn-ghost {
  background-color: transparent;
  border-color: var(--elevated);
  color: var(--text);
}

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

/* ── Site Header / Navigation ─────────────────────────────────────────────── */
.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  height: var(--nav-height);
  background-color: rgba(27, 27, 27, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background-color var(--dur) var(--ease);
}

.site-header.scrolled {
  background-color: rgba(27, 27, 27, 0.96);
}

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

/* Logo */
.nav-logo,
.footer-brand {
  display: inline-flex;
  align-items: center;
  transition: opacity var(--dur) var(--ease);
}

.nav-logo:hover,
.footer-brand:hover {
  opacity: 0.75;
}

.logo-img {
  display: block;
  height: 36px;
  width: auto;
}

/* Nav links (desktop) */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--dur) var(--ease);
}

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

.nav-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--text);
  border-radius: var(--r-full);
  transition:
    transform var(--dur) var(--ease),
    opacity   var(--dur) var(--ease);
}

/* Hamburger → X when open */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Shared Section Styles ────────────────────────────────────────────────── */
.section-label {
  display: inline-block;
  margin-bottom: var(--sp-4);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  margin-bottom: var(--sp-5);
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--text);
}

.section-description {
  max-width: 600px;
  margin-bottom: var(--sp-12);
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ── Hero Section ─────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-block: var(--nav-height) var(--sp-24);
  overflow: hidden;
}

/* Background decoration */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 55% at 65% 38%, rgba(101, 132, 21, 0.13) 0%, transparent 68%),
    radial-gradient(ellipse 35% 45% at 15% 75%, rgba(101, 132, 21, 0.07) 0%, transparent 55%);
}

.hero-ring {
  position: absolute;
  border-style: solid;
  border-color: rgba(149, 182, 62, 0.09);
  border-radius: 50%;
  top: 50%;
  right: 6%;
  transform: translate(0, -50%);
}

.hero-ring--outer {
  width: 380px;
  height: 380px;
  border-width: 1px;
  animation: spin 40s linear infinite;
}

.hero-ring--inner {
  width: 240px;
  height: 240px;
  border-width: 1px;
  border-color: rgba(149, 182, 62, 0.13);
  animation: spin 25s linear infinite reverse;
}

@keyframes spin {
  to { transform: translate(0, -50%) rotate(360deg); }
}

/* Hero content */
.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  margin-bottom: var(--sp-6);
  font-family: var(--font-heading);
  font-size: clamp(2.8rem, 6.5vw, 5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0.03em;
  color: var(--text);
}

.text-highlight {
  color: var(--golden-sand);
}

.hero-description {
  max-width: 500px;
  margin-bottom: var(--sp-10);
  font-size: clamp(1rem, 1.8vw, 1.1rem);
  color: var(--text-muted);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

/* Scroll indicator */
.hero-scroll-hint {
  position: absolute;
  bottom: var(--sp-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scroll-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scroll-fade 2.2s ease-in-out infinite;
}

@keyframes scroll-fade {
  0%, 100% { opacity: 0.25; transform: scaleY(0.9); }
  50%       { opacity: 0.9;  transform: scaleY(1); }
}

/* ── About / Values Section ───────────────────────────────────────────────── */
.about {
  padding-block: var(--sp-24);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

.value-card {
  background-color: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  transition:
    border-color var(--dur) var(--ease),
    transform    var(--dur) var(--ease);
}

.value-card:hover {
  border-color: rgba(149, 182, 62, 0.28);
  transform: translateY(-3px);
}

.value-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: var(--sp-4);
  background-color: rgba(101, 132, 21, 0.12);
  border-radius: var(--r-md);
  color: var(--lime-moss);
}

.value-card h3 {
  margin-bottom: var(--sp-3);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.value-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Fade-in animation for cards */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity  0.5s var(--ease),
    transform 0.5s var(--ease);
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.values-grid .fade-in:nth-child(2) { transition-delay: 0.1s; }
.values-grid .fade-in:nth-child(3) { transition-delay: 0.2s; }
.projects-grid .fade-in:nth-child(2) { transition-delay: 0.1s; }

/* ── Projects Section ─────────────────────────────────────────────────────── */
.projects {
  padding-block: var(--sp-24);
  background-color: var(--surface);
  border-block: 1px solid rgba(255, 255, 255, 0.06);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-6);
}

.project-card {
  position: relative;
  background-color: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  overflow: hidden;
  transition:
    border-color var(--dur) var(--ease),
    transform    var(--dur) var(--ease),
    box-shadow   var(--dur) var(--ease);
}

/* Top accent stripe (hidden by default) */
.project-card::before {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--forest-moss), var(--lime-moss));
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.project-card:hover {
  border-color: rgba(149, 182, 62, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

/* Language badge */
.project-lang {
  padding: 2px var(--sp-3);
  border-radius: var(--r-sm);
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-lang--csharp {
  background-color: rgba(104, 33, 122, 0.2);
  border: 1px solid rgba(104, 33, 122, 0.35);
  color: #c17de0;
}

.project-lang--cpp {
  background-color: rgba(0, 89, 157, 0.2);
  border: 1px solid rgba(0, 89, 157, 0.35);
  color: #69b3e0;
}

.project-gh-link {
  color: var(--elevated);
  transition: color var(--dur) var(--ease);
}

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

.project-gh-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.project-name {
  margin-bottom: var(--sp-1);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.project-name a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur) var(--ease), background-size var(--dur) var(--ease);
}

.project-name a:hover,
.project-name a:focus-visible {
  color: var(--accent);
}

.project-package {
  margin-bottom: var(--sp-4);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--elevated);
}

.project-description {
  margin-bottom: var(--sp-6);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.project-description code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--golden-sand);
  background-color: rgba(200, 208, 134, 0.1);
  padding: 1px 5px;
  border-radius: var(--r-sm);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.tag {
  padding: 3px var(--sp-3);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--r-full);
  font-family: var(--font-heading);
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ── Contact / CTA Section ────────────────────────────────────────────────── */
.contact {
  padding-block: var(--sp-24);
}

.contact-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.contact-inner .section-description {
  margin-inline: auto;
}

/* ── Site Footer ──────────────────────────────────────────────────────────── */
.site-footer {
  background-color: var(--surface);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-block: var(--sp-12);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  text-align: center;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: var(--sp-6);
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--dur) var(--ease);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--accent);
}

.footer-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--elevated);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

/* Tablet and below */
@media (max-width: 900px) {
  .values-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 768px) {
  /* Show hamburger, hide desktop nav */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    inset-inline: 0;
    background-color: rgba(27, 27, 27, 0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--sp-4) var(--sp-6) var(--sp-6);
    gap: var(--sp-5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    font-size: 1rem;
  }

  /* Rings too large on small screens */
  .hero-ring {
    display: none;
  }

  .hero-title {
    font-size: clamp(2.2rem, 9vw, 3.5rem);
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
  }
}

/* ── Focus management ─────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
