/* ==========================================================================
   apirpiris.com — personal site of Athanasios Pirpiris
   Design language: "technical datasheet" — engineering paper, grid lines,
   monospace labels, and a high-voltage hazard-stripe motif.
   ========================================================================== */

:root {
  --paper: #f7f6f1;
  --paper-raised: #efede5;
  --card: #fffefa;
  --ink: #17191e;
  --ink-soft: #575e6a;
  --line: #dedbd0;
  --line-strong: #c9c5b6;
  --accent: #0d4fd6;          /* voltaic blue */
  --accent-ink: #0a3da6;
  --volt: #f2b40f;            /* hazard yellow */
  --volt-soft: rgba(242, 180, 15, 0.16);
  --ok: #1a7f37;
  --radius: 4px;
  --max-width: 1100px;
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101318;
    --paper-raised: #161a21;
    --card: #1a1f27;
    --ink: #e9ebef;
    --ink-soft: #9aa3b0;
    --line: #2a303b;
    --line-strong: #3a4250;
    --accent: #6ea1ff;
    --accent-ink: #8fb5ff;
    --volt: #f2b40f;
    --volt-soft: rgba(242, 180, 15, 0.12);
    --ok: #4ecb63;
    --card-shadow: rgba(0, 0, 0, 0.5);
  }
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--volt); color: #17191e; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

/* --- HV hazard stripe (site-wide motif) ----------------------------------- */

.hazard-stripe {
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    var(--volt) 0 14px,
    #17191e 14px 28px
  );
}

/* --- Header / nav ---------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

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

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.nav-logo:hover { text-decoration: none; color: var(--accent); }
.nav-logo .tick { color: var(--volt); }

.nav-links {
  display: flex;
  gap: 26px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--ink); border-bottom: 2px solid var(--volt); padding-bottom: 2px; }

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.82rem !important;
  padding: 8px 16px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink) !important;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-cta:hover { background: var(--ink); color: var(--paper) !important; }

/* --- Hero -------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 100px 0 84px;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, var(--paper) 92%);
  pointer-events: none;
}

.hero .container { position: relative; z-index: 1; }

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.hero-kicker .dot { color: var(--volt); }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 6.5vw, 4.6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}

.hero h1 .accent { color: var(--accent); }

.hero-lede {
  max-width: 660px;
  font-size: 1.18rem;
  color: var(--ink-soft);
  margin-bottom: 38px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn-primary:hover { box-shadow: 4px 4px 0 var(--volt); }

.btn-ghost { border: 1px solid var(--line-strong); color: var(--ink); background: var(--card); }
.btn-ghost:hover { border-color: var(--ink); }

.hero-meta {
  display: flex;
  gap: 0;
  margin-top: 64px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  width: fit-content;
  flex-wrap: wrap;
  overflow: hidden;
}

.hero-meta > div {
  padding: 18px 30px;
  border-right: 1px solid var(--line);
  min-width: 150px;
}
.hero-meta > div:last-child { border-right: none; }

.hero-meta .num {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-meta .label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Sections ------------------------------------------------------------------ */

section { padding: 88px 0; }

.section-alt { background: var(--paper-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.section-label::before { content: "// "; color: var(--volt); font-weight: 700; }

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.5vw, 2.7rem);
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.section-sub {
  color: var(--ink-soft);
  max-width: 640px;
  margin-bottom: 52px;
  font-size: 1.06rem;
}

/* --- About ---------------------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-text p + p { margin-top: 18px; }
.about-text p { color: var(--ink-soft); }
.about-text strong { color: var(--ink); font-weight: 600; }

.fact-card {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--volt-soft);
}

.fact-card h3 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink);
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-raised);
  border-radius: var(--radius) var(--radius) 0 0;
}

.fact-list { list-style: none; padding: 10px 24px 16px; }
.fact-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.93rem;
}
.fact-list li:last-child { border-bottom: none; }
.fact-list .k { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); white-space: nowrap; padding-top: 2px; }
.fact-list .v { text-align: right; font-weight: 500; }

/* --- Résumé timeline (experience & education) ------------------------------------ */

.resume-block + .resume-block { margin-top: 72px; }

.entry {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 36px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}
.entry:last-child { border-bottom: 1px solid var(--line); }

.entry .period {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  padding-top: 5px;
}

.entry .period .now {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ok);
}
.entry .period .now::before { content: "● "; }

.entry h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.entry .org {
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 12px;
}

.entry p { color: var(--ink-soft); font-size: 0.97rem; max-width: 680px; }

.entry ul {
  list-style: none;
  margin-top: 12px;
}
.entry ul li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 0.93rem;
  margin-bottom: 7px;
  max-width: 680px;
}
.entry ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--volt);
}

.entry .mini-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* --- Skills ------------------------------------------------------------------------ */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.skill-group {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 26px;
}

.skill-group h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--volt);
}

.skill-group ul { list-style: none; }
.skill-group li {
  color: var(--ink-soft);
  font-size: 0.93rem;
  padding: 5px 0;
}

/* --- Project cards --------------------------------------------------------------------- */

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.filter-btn {
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-btn:hover { color: var(--ink); border-color: var(--ink); }
.filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  box-shadow: 3px 3px 0 var(--volt);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 30px;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.project-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--volt);
}

.project-card.featured {
  grid-column: 1 / -1;
  border-width: 2px;
  border-color: var(--ink);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.project-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--volt-soft);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.project-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-active { background: rgba(26, 127, 55, 0.12); color: var(--ok); }
.status-complete { background: rgba(13, 79, 214, 0.1); color: var(--accent-ink); }
.status-ongoing { background: var(--volt-soft); color: var(--ink); }

.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.project-role {
  font-family: var(--font-mono);
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.project-card > p {
  color: var(--ink-soft);
  font-size: 0.96rem;
  flex-grow: 1;
}

.project-highlights { list-style: none; margin: 18px 0 0; }
.project-highlights li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-bottom: 8px;
}
.project-highlights li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--volt);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: var(--radius);
}

/* --- Contact ------------------------------------------------------------------------------ */

.contact-panel {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.contact-panel .section-heading { margin-bottom: 16px; }
.contact-panel > p { color: var(--ink-soft); margin-bottom: 38px; }

.contact-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.contact-note {
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

/* --- Footer ---------------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer p { color: var(--ink-soft); font-family: var(--font-mono); font-size: 0.8rem; }

.footer-links { display: flex; gap: 22px; list-style: none; }
.footer-links a { color: var(--ink-soft); font-size: 0.85rem; }
.footer-links a:hover { color: var(--ink); }

/* --- Page header (subpages) --------------------------------------------------------------------- */

.page-header {
  padding: 84px 0 48px;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  position: relative;
}
.page-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, var(--paper) 94%);
  pointer-events: none;
}
.page-header .container { position: relative; z-index: 1; }

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.page-header .hero-lede { margin-bottom: 0; }

/* --- Reveal animation ------------------------------------------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* --- Project detail link (on project cards) ------------------------------------------------------------ */

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
}

/* --- Photo gallery (project detail pages) --------------------------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 40px 0;
}

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
}

.gallery figure { margin: 0; }

.gallery figcaption {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.spec-list {
  list-style: none;
  margin-top: 12px;
}
.spec-list li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 0.97rem;
  margin-bottom: 10px;
  max-width: 720px;
}
.spec-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--volt);
}

/* --- Responsive --------------------------------------------------------------------------------------- */

@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .entry { grid-template-columns: 1fr; gap: 8px; padding: 26px 0; }
  .project-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .hero { padding: 68px 0 60px; }
  section { padding: 64px 0; }
  .nav-links { gap: 16px; }
  .nav-links li:nth-child(n+5) { display: none; } /* keep nav tidy on small screens */
  .hero-meta { width: 100%; }
  .hero-meta > div { flex: 1 1 45%; border-bottom: 1px solid var(--line); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
