/* ===========================================================================
   Petros Kapakos — personal site
   Monochrome, Montserrat, fixed left sidebar + scrolling content.
   =========================================================================== */

:root {
  --sidebar-w: 385px;
  --ink: #000000;          /* headings, active */
  --body: #767676;         /* body copy */
  --muted: #9a9a9a;        /* inactive nav, meta */
  --line: #e7e7e7;         /* hairlines */
  --track: #ececec;        /* skill-bar track */
  --bg: #ffffff;           /* sidebar / base */
  --bg-alt: #f6f6f6;       /* content + bands */
  --content-max: 960px;
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.8;
  color: var(--body);
  background: var(--bg-alt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

h1, h2, h3 { color: var(--ink); font-weight: 800; line-height: 1.2; margin: 0; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---- Sidebar ------------------------------------------------------------ */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  z-index: 20;
}

.sidebar__inner {
  width: 100%;
  padding: 40px 40px 40px 68px;
}

.nav ul { list-style: none; margin: 0; padding: 0; }
.nav li { margin: 0; }
.nav a {
  display: inline-block;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.18s ease;
}
.nav a:hover { color: var(--ink); }
.nav a.is-active { color: var(--ink); }

.sidebar__copy {
  margin: 56px 0 0;
  font-size: 15px;
  color: var(--muted);
}

/* ---- Mobile top bar (hidden on desktop) --------------------------------- */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar__toggle {
  width: 42px;
  height: 42px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  background: none;
  border: 0;
  cursor: pointer;
}
.topbar__toggle span {
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.topbar__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topbar__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.topbar__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Content ------------------------------------------------------------ */
.content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-alt);
  overflow-x: clip;
}

/* Home hero fills the viewport and is vertically centered */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  gap: 56px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0;
}
/* Morphing photo "blob" — ported verbatim from the original WordPress theme
   (tokyo-core .fn_cs_animate_image .abs_img). The holder was ~1.15:1 (a square
   spacer pulled up 13%), the shape morphs via the tokyo-morph keyframes, and
   the "border" is a translucent white ring inset 9px into the picture. */
.hero__photo { flex: 0 0 296px; position: relative; }
.hero__photo img {
  display: block;
  width: 100%;
  height: auto; /* override the width/height attr hint so aspect-ratio governs */
  aspect-ratio: 20 / 17;
  object-fit: cover;
  object-position: center;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: tokyo-morph 8s ease-in-out infinite;
}
/* The "border" is a translucent white ring inset 9px into the picture (the
   theme's value). It must sit on an overlay, NOT the <img>: an inset
   box-shadow on a replaced <img> paints behind the image and never shows.
   This ::after overlays the photo exactly and runs the same synced morph. */
.hero__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  box-shadow: inset 0 0 0 9px rgba(255, 255, 255, 0.3);
  animation: tokyo-morph 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes tokyo-morph {
  0%   { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50%  { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}
.hero__name {
  font-size: 55px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--ink);
}
.hero__tagline {
  margin: 22px 0 26px;
  font-size: 16px;
  line-height: 1.9;
  max-width: 48ch;
}
.hero__socials { display: flex; gap: 22px; }
.hero__social { opacity: 0.85; transition: opacity 0.18s ease; }
.hero__social:hover { opacity: 1; }

/* Standard inner pages */
.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 90px 60px 110px;
}
.page__title {
  font-size: 44px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 12px 0 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb__sep { color: var(--muted); }
.pill {
  display: inline-block;
  padding: 6px 14px;
  background: #ececec;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 3px;
}

.prose p { margin: 0 0 22px; }
.prose p:last-child { margin-bottom: 0; }

/* ---- Resume ------------------------------------------------------------- */
.resume-intro { margin-top: 48px; }
.resume-intro__photo { margin-bottom: 40px; }
.resume-intro__photo img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  object-position: center 30%;
}
.resume-intro__name { font-size: 30px; }
.resume-intro__role {
  margin: 4px 0 26px;
  font-style: italic;
  color: var(--body);
}

.btn {
  display: inline-block;
  margin-top: 30px;
  padding: 16px 34px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: opacity 0.18s ease;
}
.btn:hover { opacity: 0.82; }

.section__title {
  font-size: 22px;
  margin-bottom: 30px;
}

.skills {
  margin-top: 90px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px 70px;
}
.skillgroup__bars { display: grid; gap: 26px; }

.skill__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.skill__label { color: var(--ink); font-weight: 600; font-size: 15px; }
.skill__value { color: var(--ink); font-weight: 600; font-size: 14px; }
.skill__track {
  position: relative;
  height: 3px;
  background: var(--track);
  border-radius: 2px;
  overflow: hidden;
}
.skill__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--ink);
  border-radius: 2px;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.skill__fill.is-filled { width: var(--target); }

/* Full-width band across the content area (child of .content, not .page). */
.band {
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 70px 0;
}
.band__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 70px;
}
.taglist__items { list-style: none; margin: 0; padding: 0; }
.taglist__items li {
  position: relative;
  padding: 8px 0 8px 22px;
  color: var(--body);
}
.taglist__items li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--ink);
  font-weight: 700;
}

/* The band sits between two .page blocks — trim the abutting padding. */
.page:has(.skills) { padding-bottom: 70px; }
.page:has(.history) { padding-top: 80px; }

.history {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 70px;
}
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}
.tl__item {
  position: relative;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  align-items: start;
  padding: 0 0 34px 32px;
}
.tl__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid #cfcfcf;
}
.tl__period {
  display: inline-block;
  align-self: start;
  padding: 6px 14px;
  background: #ededed;
  border-radius: 20px;
  font-size: 13px;
  color: var(--body);
  white-space: nowrap;
}
.tl__company { font-size: 17px; }
.tl__role { margin: 4px 0 0; font-size: 14px; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    width: min(320px, 82vw);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar__inner { padding: 40px; }
  .topbar { display: flex; }
  .content { margin-left: 0; }

  .hero {
    min-height: 0;
    flex-direction: column;
    text-align: center;
    gap: 36px;
    padding: 60px 28px 80px;
  }
  .hero__photo { flex: 0 0 auto; width: min(300px, 70%); }
  .hero__socials { justify-content: center; }
  .hero__tagline { margin-left: auto; margin-right: auto; }

  .page { padding: 48px 28px 80px; }
  .band {
    margin-left: -28px;
    margin-right: -28px;
    padding: 48px 28px;
  }
}

@media (max-width: 680px) {
  .hero__name { font-size: 38px; }
  .page__title { font-size: 34px; }
  .skills, .band, .history { grid-template-columns: 1fr; gap: 40px; }
  .tl__item { grid-template-columns: 130px 1fr; gap: 14px; }
}

@media (max-width: 420px) {
  .tl__item { grid-template-columns: 1fr; gap: 8px; padding-left: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .skill__fill { transition: none; }
  .hero__photo img,
  .hero__photo::after { animation: none; }
}
