:root {
  --bg: #f9fafb; /* page background */
  --fg: #111827; /* primary text */
  --muted: #6b7280;
  --accent: #ff5722; /* action orange from logo */
  --accent-soft: rgba(255, 87, 34, 0.12);
  --grid-color: rgba(15, 23, 42, 0.06);
  --grid-major: rgba(15, 23, 42, 0.14);
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --space: 50px; /* Align with grid */
  --container: 900px; /* Multiple of 50px */
}

html {
  scroll-behavior: smooth;
}

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

::selection {
  background: var(--accent);
  color: #ffffff;
}

body {
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--fg);
  background-color: var(--bg);

  /* Light square paper background */
  background-image: linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px),
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 250px 250px, 250px 250px;
  background-position: center top, center top, center top, center top;

  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Subtle vignette */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at top center,
    rgba(255, 255, 255, 0.7) 0%,
    rgba(249, 250, 251, 1) 45%,
    rgba(209, 213, 219, 0.7) 100%
  );
  mix-blend-mode: multiply;
  z-index: -1;
}

/* (decorative pixel signals removed) */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-weight: 500;
  color: var(--fg);
}

h1 {
  font-size: clamp(3rem, 7vw, 4.2rem);
  line-height: 1.1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.04em;
}

h2 {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: var(--muted);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

/* (decorative line before h2 removed per latest design) */

h3 {
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  margin-bottom: 1.75rem;
  position: relative;
}

h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 72px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  padding: 0 var(--space);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(209, 213, 219, 0.9);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: visible;
}

/* (nav bus line removed per latest design) */

.logo {
  height: 100%;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--fg);
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.06em;
  user-select: none;
  padding: 0 6px;
}

.logo-underscore {
  display: inline-block;
  animation: logo-blink 1.1s steps(1, end) infinite;
}

@keyframes logo-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-underscore {
    animation: none;
  }
}

.nav-links {
  display: flex;
  height: 100%;
}

.nav-links a {
  font-family: "IBM Plex Mono", monospace;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: all 0.18s ease;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  position: relative;
}

/* (nav pins removed per latest design) */
.nav-links a:hover {
  background: rgba(249, 250, 251, 0.9);
  color: var(--fg);
  border-color: rgba(209, 213, 219, 0.9);
}

/* Layout */
main {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  padding: 0 25px;
}

section {
  padding: 100px 0;
  position: relative;
}

/* Vertical guide lines for content */
main::before,
main::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(209, 213, 219, 0.8);
  z-index: -1;
}
main::before {
  left: 0;
}
main::after {
  right: 0;
}

/* Hero */
.hero {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 140px 0 90px; /* overrides generic section padding */
  position: relative;
  max-width: 60ch;
}

.hero > * {
  animation: fadeIn 1s ease-out forwards;
  opacity: 0;
}

.hero h1 {
  animation-delay: 0.05s;
}

.hero h2 {
  animation-delay: 0.15s;
}

.hero .location {
  animation-delay: 0.25s;
}

/* (hero decorative card/sweep removed) */

.location {
  font-family: "IBM Plex Mono", monospace;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* About */
.about-content {
  background-color: var(--card-bg);
  background-image: linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 50px 50px;
  border: 1px solid var(--border);
  padding: 40px;
  position: relative;
  color: var(--fg);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.07);
}

/* Corner markers for About section */
.about-content::before,
.about-content::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: rgba(15, 23, 42, 0.3);
}

.about-content::before {
  top: -1px;
  left: -1px;
  border-top-style: solid;
  border-left-style: solid;
}

.about-content::after {
  bottom: -1px;
  right: -1px;
  border-bottom-style: solid;
  border-right-style: solid;
}

.highlight {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  line-height: 1.5;
  color: var(--fg);
  font-weight: 500;
  margin-bottom: 1.5rem;
  max-width: 55ch;
}

.about-content p:not(.highlight) {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.8;
  max-width: 68ch;
  font-weight: 400;
  margin-top: 0.75rem;
}

/* Cards (Experience & Projects) */
.role {
  position: relative;
  background-color: var(--card-bg);
  background-image: linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 50px 50px;
  border: 1px solid var(--border);
  padding: 28px 32px;
  margin-bottom: 28px;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  column-gap: 2.5rem;
  row-gap: 0.5rem;
  align-items: flex-start;
}

.role:hover {
  border-color: var(--accent);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

/* Technical Corner Markers (+) */
.role::before,
.role::after {
  content: "+";
  position: absolute;
  color: rgba(148, 163, 184, 0.9);
  font-weight: 300;
  font-size: 16px;
  line-height: 1;
  transition: color 0.2s ease;
}

.role::before {
  top: -10px;
  left: -6px;
}

.role::after {
  bottom: -10px;
  right: -6px;
}

.role:hover::before,
.role:hover::after {
  color: var(--accent);
}

/* Title Styling */
.role h4 {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  display: block;
  width: 100%;
  background: #111827;
  color: #f9fafb;
  padding: 4px 10px;
  box-sizing: border-box;
  grid-column: 1;
  grid-row: 1;
}

.role .title {
  color: var(--fg);
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 500;
  grid-column: 1;
  grid-row: 2;
}

.period {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  grid-column: 1;
  grid-row: 3;
}

/* Links inside cards (if present) */
.website {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 87, 34, 0.4);
  transition: color 0.2s ease, border-color 0.2s ease;
  margin-bottom: 0.75rem;
  grid-column: 1;
  grid-row: 2;
}

.website:hover {
  color: #b93815;
  border-bottom-color: #b93815;
}

/* Skills */
.skills-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: rgba(209, 213, 219, 0.9);
  border: 1px solid rgba(209, 213, 219, 0.9);
}

.skills-list li {
  background: #ffffff;
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  align-items: center;
}

.skills-list li:hover {
  background: #fffbf7;
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}

/* Contact */
.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--fg);
  text-decoration: none;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}

.contact-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 0.22s ease;
  z-index: -1;
}

.contact-item:hover {
  color: #ffffff;
  border-color: var(--accent);
}

.contact-item:hover::before {
  width: 100%;
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 0;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(209, 213, 219, 0.9);
  margin-top: 80px;
  background: #f3f4f6;
}

/* Mobile Tweak */
@media (max-width: 768px) {
  :root {
    --space: 20px;
  }

  nav {
    padding: 0 20px;
  }

  .nav-links {
    display: none; /* could be swapped for burger later */
  }

  h1 {
    font-size: 2.4rem;
  }

  .hero {
    min-height: 60vh;
    padding: 120px 0 60px;
  }

  .role {
    padding: 20px;
    display: block; /* stack content vertically on small screens */
  }

  main {
    padding: 0 20px;
  }
}

