/* ==========================================================
   Nikos Kospanos — Portfolio
   One shared stylesheet for every page
   ========================================================== */

:root {
  --ink: #0f172a;
  --text: #1e293b;
  --muted: #526077;
  --line: #e2e8f0;
  --bg: #ffffff;
  --soft: #f6f8fb;
  --accent: #1d3f8f;
  --accent-ink: #ffffff;
  --accent-soft: #e8eefb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --max: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --header-bg: rgba(255, 255, 255, .92);
  --accent-hover: #c2410c;
  --cta-bg: #0f172a;
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
}

[data-theme="dark"] {
  --ink: #e8edf7;
  --text: #c9d2e3;
  --muted: #94a0b8;
  --line: #263248;
  --bg: #0b1220;
  --soft: #111a2e;
  --accent: #8fb0ff;
  --accent-ink: #0b1220;
  --accent-soft: #1a2747;
  --accent-hover: #fb923c;
  --header-bg: rgba(11, 18, 32, .9);
  --cta-bg: #16213a;
  --input-bg: #0f1829;
  --input-border: #33415c;
  color-scheme: dark;

}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

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

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { color: var(--ink); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p  { margin: 0 0 1em; }

.container { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: .95rem; letter-spacing: .02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 1rem; }
.brand-role { font-size: .78rem; color: var(--muted); }

.nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: .5rem .8rem; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: .95rem; font-weight: 500;
}
.nav a:hover { background: var(--soft); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.nav-toggle {
  display: none; font: inherit; background: none; border: 1px solid var(--line);
  border-radius: 8px; padding: .45rem .6rem; cursor: pointer; color: var(--ink);
}
.nav-toggle svg { display: block; }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: .4rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.icon-sun { display: none;}
[data-theme="dark"] .icon-moon { display: none;}
[data-theme="dark"] .icon-sun { display: block;}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8edf7;
    --text: #c9d2e3;
    --muted: #94a0b8;
    --line: #263248;
    --bg: #0b1220;
    --soft: #111a2e;
    --accent: #8fb0ff;
    --accent-ink: #0b1220;
    --accent-soft: #1a2747;
    --accent-hover: #fb923c;
    --header-bg: rgba(11, 18, 32, .9);
    --cta-bg: #16213a;
    --input-bg: #0f1829;
    --input-border: #33415c;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .icon-moon { display: none;}
  :root:not([data-theme="light"]) .icon-sun { display: block;}
}
.header-inner .nav {margin-left: .5rem;}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: .75rem 1.25rem 1rem; display: none;
  }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; }
  .nav a { padding: .75rem .8rem; }
  .brand-role { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section.soft { background: var(--soft); border-block: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: 2rem; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .75rem;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }

.page-head { padding: clamp(2.5rem, 6vw, 4rem) 0 1rem; }
.page-head p { color: var(--muted); max-width: 680px; font-size: 1.1rem; }

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 2rem; } }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.25rem; border-radius: 8px; font: inherit; font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover) }
.btn-ghost { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.btn[disabled] { opacity: .6; cursor: progress; }

.facts {
  background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; margin: 0;
}
.facts div { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.facts div:first-child { padding-top: 0; }
.facts div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.facts dd { margin: .15rem 0 0; color: var(--ink); font-weight: 500; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card p { color: var(--muted); font-size: .97rem; }
.card .card-foot { margin-top: auto; padding-top: .5rem; }
.card-kicker { font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: .35rem; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.tags li {
  font-size: .78rem; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  padding: .2rem .55rem; border-radius: 999px;
}

.skill-list { list-style: none; padding: 0; margin: 0; }
.skill-list li { padding: .3rem 0; color: var(--text); font-size: .97rem; }

.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " →"; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- CTA band ---------- */
.cta {
  background: var(--cta-bg); color: #cbd5e1; border-radius: 14px;
  padding: clamp(2rem, 5vw, 3rem); display: flex; gap: 2rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.cta h2 { color: #fff; margin-bottom: .3rem; }
.cta p { margin: 0; }
.cta .btn-primary { background: #fff; color: #0f172a; }
.cta .btn-primary:hover { background: #e2e8f0; }

/* ---------- Timeline (About) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.75rem 1.5rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: .45rem;
  width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
}
.timeline .when { font-size: .85rem; color: var(--muted); font-weight: 600; }
.timeline h3 { margin: .1rem 0 .2rem; }
.timeline p { margin: 0; color: var(--muted); }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; gap: 2rem; } }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 620px) { .gallery { grid-template-columns: 1fr; } }
.gallery figure { margin: 0; }
.gallery button {
  aspect-ratio:4/5; display: block; width: 100%; padding: 0; cursor: zoom-in; background: var(--soft);
  border-radius: var(--radius); overflow: hidden; position: relative;
  border: 1px solid var(--line);
}
.gallery button::before {
  content: attr(data-missing); position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: .9rem; padding: 1rem; text-align: center;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; position: relative; transition: transform .3s; }
.gallery button:hover img { transform: scale(1.02); }
.gallery figcaption { font-size: .9rem; color: var(--muted); margin-top: .5rem; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 92vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(15, 23, 42, .88); }
.lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 6px; margin: auto; }
.lightbox p { color: #e2e8f0; text-align: center; margin: .75rem 0 0; }
.lightbox-close {
  position: fixed; top: 1rem; right: 1rem; background: var(--bg); color: var(--ink);
  border: 1 px solid var(--line); border-radius: 8px; padding: .4rem .8rem; font: inherit; font-weight: 600; cursor: pointer;
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 3rem; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: 2rem; } }

.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.contact-list li:first-child { padding-top: 0; }
.contact-list .label { display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.contact-list a, .contact-list span.value { font-weight: 600; color: var(--ink); word-break: break-word; }

.form { display: grid; gap: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; color: var(--ink); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: .7rem .85rem; border: 1px solid var(--input-border); border-radius: 8px; background: var(--input-bg);
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.invalid input, .field.invalid textarea { border-color: #b91c1c; }
.field .error { color: #b91c1c; font-size: .85rem; margin-top: .3rem; min-height: 1em; }
.field .hint { color: var(--muted); font-size: .82rem; margin-top: .3rem; text-align: right; }
.hp { position: absolute; left: -9999px; }

.status { padding: .85rem 1rem; border-radius: 8px; font-weight: 500; display: none; }
.status.success { display: block; background: #ecfdf3; color: #065f46; border: 1px solid #a7f3d0; }
.status.error { display: block; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.footer-links { display: flex; gap: 1.25rem; list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}


