/* =================================================================
   larrypeseckis.ai
   Deep navy · slate blue accent · Space Grotesk + Inter
   ================================================================= */

:root {
  /* Surfaces — deep navy with slight warmth */
  --bg:            #0b0f1a;
  --bg-alt:        #0e131f;
  --panel:         #131a28;
  --panel-hover:   #18202f;
  --border:        #232c3d;

  /* Accent — slate blue */
  --accent:        #7b9bb5;
  --accent-bright: #9cb8cf;
  --accent-dim:    rgba(123, 155, 181, 0.14);

  /* Text */
  --text:          #e7eaf0;
  --text-soft:     #aeb6c4;
  --text-muted:    #71798a;

  /* Type */
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  /* Rhythm */
  --maxw: 1080px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-pad: clamp(5rem, 12vh, 9rem);

  --radius: 14px;
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition),
              border-color var(--transition), color var(--transition);
}
.btn--primary {
  background: var(--accent);
  color: #0a0e16;
  font-weight: 600;
}
.btn--primary:hover { background: var(--accent-bright); transform: translateY(-2px); }
.btn--ghost {
  border-color: var(--border);
  color: var(--text-soft);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11, 15, 26, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 1.1rem var(--gutter);
}
.nav__brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.25rem 0.55rem;
  transition: border-color var(--transition), color var(--transition);
}
.nav__brand:hover { border-color: var(--accent); color: var(--accent); }
.nav__menu { display: flex; gap: 2rem; }
.nav__menu a {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-soft);
  position: relative;
  padding-bottom: 2px;
  transition: color var(--transition);
}
.nav__menu a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav__menu a:hover { color: var(--text); }
.nav__menu a:hover::after { width: 100%; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav__toggle span {
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 55% at 78% 18%, rgba(123, 155, 181, 0.16), transparent 70%),
    radial-gradient(50% 50% at 10% 90%, rgba(123, 155, 181, 0.07), transparent 70%);
  pointer-events: none;
}
/* Decorative network graphic, anchored right, behind the hero text */
.hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 62%;
  z-index: 1;
  background: url("../assets/bg-network.png") right center / contain no-repeat;
  opacity: 0.6;
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 2; padding-block: 4rem; }
.hero__eyebrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0 0 1.5rem;
}
.hero__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 1.75rem;
  max-width: 16ch;
}
.hero__statement {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--text-soft);
  max-width: 56ch;
  margin: 0 0 2.5rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ---------- Sections ---------- */
.section { padding-block: var(--section-pad); }
.section--alt { background: var(--bg-alt); }
.section__head { max-width: 60ch; margin-bottom: 3.5rem; }
.section__head--wide { max-width: 74ch; }
.labs__archive { margin: 1.25rem 0 0; }
.labs__archive a {
  font-family: var(--font-head);
  font-weight: 500;
  color: var(--accent);
  transition: color var(--transition);
}
.labs__archive a:hover { color: var(--accent-bright); }
.labs__footer {
  max-width: 70ch;
  margin: 3rem 0 0;
  color: var(--text-soft);
  font-size: 1.02rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}
.section__index {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.section__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: -0.015em;
  margin: 0 0 1.1rem;
}
.section__lede { color: var(--text-soft); font-size: 1.1rem; margin: 0; }

/* ---------- Work cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); background: var(--panel-hover); }
.card--muted { opacity: 0.78; }
.card--muted:hover { opacity: 1; }
.card__meta { margin-bottom: 1rem; }
.card__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.45rem;
  margin: 0 0 0.6rem;
}
.tag {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}
.card__body { color: var(--text-soft); margin: 0 0 1.25rem; }
.card__body code {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: var(--accent-bright);
  background: var(--accent-dim);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

/* Technique tag row (Labs) */
.card__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.4rem; }
.tag--sm {
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.18rem 0.55rem;
}

/* Platform chips — one contained color per platform, slate system untouched */
.tag--thm { color: #ff6b6b; background: rgba(225, 55, 55, 0.14); }   /* TryHackMe red */
.tag--htb { color: #9fef00; background: rgba(159, 239, 0, 0.12); }   /* HackTheBox green */
.tag--ld  { color: #5aa2ff; background: rgba(47, 111, 237, 0.16); }  /* LetsDefend blue */
/* Callout — reusable labelled aside (First finding / Design principle / Method / …) */
.card__callout {
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  margin: 0 0 1.5rem;
  color: var(--text-soft);
  font-size: 0.97rem;
}
.card__callout-label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.card__links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* Status line — sits where the repo link would, for cards with nothing to link yet */
.card__status {
  margin-top: auto;
  font-family: var(--font-head);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.card__links a {
  font-family: var(--font-head);
  font-weight: 500;
  color: var(--accent);
  transition: color var(--transition);
}
.card__links a:hover { color: var(--accent-bright); }

/* ---------- Compact teaser card (redesign prototype) ---------- */
.card--mini { padding: 1.6rem 1.7rem; }
.card__summary { color: var(--text-soft); margin: 0 0 1.1rem; font-size: 0.98rem; }
.card__hook { border-left: 2px solid var(--accent); padding-left: 0.85rem; margin: 0 0 1.4rem; color: var(--text-soft); font-size: 0.9rem; }

/* Subtle non-tech pill — "Private" / "Methodology" markers */
.tag--lock {
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
}

/* ---------- Flip card (Work) ---------- */
/* Outer .card keeps the panel, border, hover-lift and reveal; the inner layer
   does the 3D rotation so the panel stays put while the content flips over it. */
.card--flip { padding: 0; perspective: 1600px; cursor: pointer; }
.card--flip .card__flip-inner {
  position: relative;
  flex: 1;
  display: grid;                 /* both faces share one grid cell → */
  transform-style: preserve-3d;  /* the card sizes to the taller (back) face */
  transition: transform 0.75s cubic-bezier(0.4, 0.15, 0.2, 1);
}
.card--flip.is-flipped .card__flip-inner { transform: rotateY(180deg); }
.card__face {
  grid-area: 1 / 1;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2rem 2rem 3.25rem;    /* bottom room reserved for the flip hint */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.card__face--front { justify-content: flex-start; }   /* top-align like every other card */
.card__face--back { transform: rotateY(180deg); }
.card__face--back .card__callout { margin-bottom: 1.1rem; }
.card__quote {
  display: block;
  font-family: var(--font-head);
  color: var(--text);
  font-style: italic;
  margin-bottom: 0.4rem;
}
.card__flip-hint {
  position: absolute;
  right: 2rem;
  bottom: 1.4rem;
  font-family: var(--font-head);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.card--flip:hover .card__flip-hint { color: var(--accent-bright); }
.card--flip:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Writing ---------- */
.writing-list { display: flex; flex-direction: column; gap: 1rem; }
.writing-item a {
  display: block;
  padding: 1.6rem 1.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.writing-item a:hover { transform: translateX(6px); border-color: var(--accent); background: var(--panel-hover); }
.writing-item__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
}
.writing-item__desc { color: var(--text-soft); margin: 0 0 0.75rem; }
.writing-item__cta { font-family: var(--font-head); font-size: 0.9rem; color: var(--accent); }
.writing-note { color: var(--text-muted); font-size: 0.85rem; margin-top: 1.5rem; font-style: italic; }

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about__photo-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    linear-gradient(160deg, var(--panel), var(--bg-alt));
  overflow: hidden;
  display: grid;
  place-items: center;
}
.about__photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.about__photo-placeholder {
  font-family: var(--font-head);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.about__content p { color: var(--text-soft); }
.about__lead { color: var(--text) !important; font-size: 1.2rem; }
.about__subhead {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  margin: 2.25rem 0 0.5rem;
  color: var(--text);
}

/* ---------- Contact ---------- */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.contact__links { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.contact__form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label {
  font-family: var(--font-head);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--text-soft);
}
.field input, .field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  transition: border-color var(--transition), background var(--transition);
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel-hover);
}
.contact__form .btn { align-self: flex-start; }
/* Spam honeypot — hidden; kept as a class so the page carries zero inline styles
   (lets the CSP drop style-src 'unsafe-inline') */
.hp { display: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 3rem;
  text-align: center;
}
.footer__tagline {
  font-family: var(--font-head);
  font-weight: 500;
  color: var(--text);
  font-size: 1.05rem;
  margin: 0 0 1rem;
}
.footer__status { color: var(--text-soft); font-size: 0.92rem; margin: 0 0 0.75rem; }
.footer__legal { color: var(--text-muted); font-size: 0.85rem; margin: 0; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__photo { max-width: 260px; }
  .contact__grid { grid-template-columns: 1fr; }

  /* Network graphic spans wider but fades back so hero text stays crisp */
  .hero::after { width: 100%; opacity: 0.28; }

  .nav__toggle { display: flex; }
  .nav__menu {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
  }
  .nav__menu.is-open { max-height: 320px; }
  .nav__menu li { border-top: 1px solid var(--border); }
  .nav__menu a { display: block; padding: 1rem var(--gutter); }
  .nav__menu a::after { display: none; }
}

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