/* ============================================================
   tmato.es — "Tomato" design system (ported from Lovable / Tailwind v4)
   Plain CSS, no build step. Same OKLCH tokens Lovable gave you.
   ============================================================ */
:root {
  --radius: 0.5rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);

  /* brand */
  --tomato:       oklch(0.65 0.20 27);
  --tomato-deep:  oklch(0.52 0.18 27);
  --leaf:         oklch(0.62 0.14 145);
  --cream:        oklch(0.24 0.005 250);
  --ink:          oklch(0.90 0.01 90);

  /* pengrey-inspired dark palette */
  --background:          oklch(0.24 0.005 250);
  --foreground:          oklch(0.89 0.003 250);
  --card:                oklch(0.30 0.006 260);
  --card-foreground:     oklch(0.89 0.003 250);
  --primary:             oklch(0.68 0.20 27);
  --primary-foreground:  oklch(0.16 0.005 250);
  --secondary:           oklch(0.32 0.006 260);
  --muted:               oklch(0.30 0.006 260);
  --muted-foreground:    oklch(0.66 0.005 250);
  --accent:              oklch(0.62 0.14 145);
  --accent-foreground:   oklch(0.16 0.005 250);
  --destructive:         oklch(0.60 0.24 27);
  --border:              oklch(0.35 0.006 260);
  --ring:                oklch(0.68 0.20 27);

  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
               Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-pixel: "Jersey 25", ui-monospace, monospace;

  --cream-card: oklch(0.95 0.02 85);   /* warm off-white specimen card */
  --cream-ink:  oklch(0.45 0.03 60);   /* muted caption text on cream    */

  --nav-h: 60px;
  --maxw: 72rem;
}

* { box-sizing: border-box; border-color: var(--border); }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 18px; /* Increased base size from 16px */
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 10% 0%,  oklch(0.65 0.20 27 / 0.07), transparent 45%),
    radial-gradient(circle at 90% 15%, oklch(0.62 0.14 145 / 0.05), transparent 45%);
  background-attachment: fixed;
}

a { color: var(--primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--tomato-deep); }
::selection { background: var(--primary); color: var(--primary-foreground); }

.container { max-width: var(--maxw); margin-inline: auto; padding-inline: 1.5rem; }

/* ─────────────────────────── NAVBAR ─────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--background) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; height: var(--nav-h);
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav__brand {
  color: var(--foreground); font-family: var(--font-mono);
  font-weight: 700; font-size: 0.95rem;
  letter-spacing: .01em; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
}
.nav__brand:hover { color: var(--foreground); }
.nav__tom { font-size: 1.05rem; line-height: 1; }
.nav__links { display: flex; gap: 4px; flex-wrap: wrap; }
.nav__links a {
  color: var(--muted-foreground); font-family: var(--font-mono);
  font-size: 0.78rem; font-weight: 400; letter-spacing: .08em;
  padding: 6px 10px; border-radius: var(--radius-md);
}
.nav__links a:hover { color: var(--foreground); background: var(--secondary); }
.nav__links a.active { color: var(--tomato); }

.nav__toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 38px; height: 38px; background: var(--secondary);
  border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer;
}
.nav__toggle span {
  display: block; height: 2px; width: 18px; margin: 0 auto;
  background: var(--foreground); border-radius: 2px;
}

/* ─────────────────────────── HERO ─────────────────────────── */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: 4.5rem 1.5rem 3.5rem;
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem; align-items: center;
}
.hero__wordmark {
  font-family: var(--font-pixel);
  color: var(--tomato);
  font-size: clamp(3.5rem, 9vw, 6.5rem);
  line-height: 0.8; letter-spacing: .02em;
  text-shadow: 3px 3px 0 var(--tomato-deep);
  margin-bottom: .5rem;
}
.hero__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  line-height: 1.02; letter-spacing: -0.01em;
  color: var(--foreground); margin: 0 0 1.1rem;
}
.hero__name em { font-style: italic; font-weight: 600; color: var(--tomato); }
.hero__dot { color: var(--muted-foreground); }
.hero__tag {
  color: var(--muted-foreground);
  font-size: 1.05rem; line-height: 1.6;
  max-width: 44ch; margin: 0 0 1.9rem;
}
.hero__links { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-pill {
  font-family: var(--font-mono); font-size: .78rem;
  letter-spacing: .08em; padding: 10px 18px;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--foreground);
  background: color-mix(in oklch, var(--card) 55%, transparent);
  transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
.btn-pill:hover { border-color: var(--tomato); color: var(--tomato); transform: translateY(-1px); }

/* cream specimen card */
.hero__card {
  margin: 0; background: var(--cream-card);
  border-radius: var(--radius-xl); padding: 1.25rem 1.25rem 0;
  box-shadow: 0 30px 90px -35px oklch(0.65 0.20 27 / .45),
              0 0 0 1px oklch(0.65 0.20 27 / .10);
  overflow: hidden;
}
.hero__gif {
  display: block; width: 100%; max-width: 560px;
  height: auto; margin: 0 auto;
  background: transparent; border: 0;
  border-radius: var(--radius-lg);
}
.hero__cap {
  display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .1em; color: var(--cream-ink);
  padding: .85rem .25rem 1.1rem;
}

/* ─────────────────────────── SECTIONS ─────────────────────────── */
/* .section {
  max-width: var(--maxw); margin: 0 auto;
  padding: 3.5rem 1.5rem;
  border-top: 1px solid var(--border);
} */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 85vh; /* Takes up 85% of the screen height */
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--border);
  
  /* Flexbox centers section content vertically if it doesn't fill the full height */
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.section__head { margin-bottom: 1.75rem; }
.eyebrow {
  display: inline-block; font-family: var(--font-mono);
  font-size: .9rem; color: var(--tomato);
  letter-spacing: .02em; margin-bottom: .35rem;
}
.section__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700;
  letter-spacing: -0.02em; margin: 0; color: var(--foreground);
}
.section__lead {font-size: 1.15rem; color: var(--muted-foreground); margin: 0 0 1.75rem; max-width: 68ch; }
.section p { max-width: 72ch; }

.hl { color: var(--leaf); font-weight: 500; }
code, .mono { font-family: var(--font-mono); color: var(--tomato); font-size: .92em; }
.about p {
  text-align: justify;
}
/* about stats */
.stats { list-style: none; padding: 0; margin: 1.75rem 0 0; display: flex; flex-wrap: wrap; gap: 14px; }
.stats li {
  flex: 1 1 180px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1rem 1.1rem; position: relative; overflow: hidden;
}
.stats li::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--tomato);
}
.stats strong { display: block; color: var(--foreground); font-size: 1rem; }
.stats span { color: var(--muted-foreground); font-size: .8rem; }

/* grids */
.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

/* cards */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 1.25rem 1.35rem;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.card:hover {
  border-color: var(--tomato);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px -24px oklch(0.65 0.20 27 / .5);
}
.card h3 { margin: 0 0 .75rem; font-size: 1rem; color: var(--foreground); font-weight: 700; letter-spacing: -0.01em; }
.card ul { margin: 0; padding-left: 1.1rem; }
.card ul li { margin: .25rem 0; color: var(--muted-foreground); }
.card p { margin: 0 0 .5rem; color: var(--muted-foreground); }
.card__sub { color: var(--foreground); font-weight: 500; }
.card__date, .card__meta { color: var(--muted-foreground); font-size: .82rem; }
.card__links a { font-weight: 600; font-size: .88rem; }
.card--ghost { border-style: dashed; opacity: .9; }

/* tag lists (tools) */
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  background: var(--secondary); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px; font-size: .82rem;
  color: var(--foreground); font-family: var(--font-mono);
}

/* timeline */
.timeline { display: flex; flex-direction: column; gap: 1rem; }
.tl {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 1.25rem 1.35rem;
  position: relative; overflow: hidden;
}
.tl::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--leaf); }
.tl__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: .5rem; align-items: baseline; }
.tl__role { color: var(--tomato); font-weight: 700; }
.tl__where { color: var(--foreground); }
.tl__date { color: var(--muted-foreground); font-size: .82rem; margin-left: auto; }
.tl p { margin: 0; color: var(--muted-foreground); }
.tl ul { margin: .6rem 0 0; padding-left: 1.1rem; }
.tl ul li { color: var(--muted-foreground); margin: .25rem 0; }

/* contact */
.contact__links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1.25rem; }

/* ─────────────────────────── FOOTER ─────────────────────────── */
.footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: 2rem 1.5rem 3rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  color: var(--muted-foreground); font-size: .82rem;
}

/* ─────────────────────────── RESPONSIVE ─────────────────────────── */
@media (max-width: 820px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; gap: 2rem; text-align: left; padding-top: 3rem; }
  .hero__card { max-width: 420px; }
}
@media (max-width: 640px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--background);
    border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav__links.open { max-height: 460px; }
  .nav__links a { padding: 14px 1.5rem; border-top: 1px solid var(--border); border-radius: 0; width: 100%; }
  .tl__date { margin-left: 0; }
}

:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card:hover, .btn-pill:hover { transform: none; }
}
/* ============================================================
   LIGHT THEME + THEME TOGGLE
   Dark stays the default; light applies via <html data-theme="light">
   ============================================================ */
:root[data-theme="light"] {
  --background:          oklch(0.97 0.012 85);   /* warm cream        */
  --foreground:          oklch(0.26 0.010 250);
  --card:                oklch(0.995 0.004 85);  /* near-white        */
  --card-foreground:     oklch(0.26 0.010 250);
  --primary:             oklch(0.55 0.20 27);    /* deeper for contrast */
  --primary-foreground:  oklch(0.99 0.003 85);
  --secondary:           oklch(0.93 0.012 85);
  --muted:               oklch(0.93 0.012 85);
  --muted-foreground:    oklch(0.48 0.012 250);
  --accent:              oklch(0.52 0.14 145);
  --accent-foreground:   oklch(0.99 0.003 85);
  --destructive:         oklch(0.52 0.22 27);
  --border:              oklch(0.87 0.012 85);
  --ring:                oklch(0.55 0.20 27);

  --tomato:      oklch(0.58 0.21 27);
  --tomato-deep: oklch(0.47 0.18 27);
  --leaf:        oklch(0.50 0.14 145);

  --cream-card:  oklch(0.99 0.008 85);
  --cream-ink:   oklch(0.45 0.030 60);
}

/* softer glows on light */
:root[data-theme="light"] body {
  background-image:
    radial-gradient(circle at 10% 0%,  oklch(0.65 0.20 27 / 0.10), transparent 45%),
    radial-gradient(circle at 90% 15%, oklch(0.62 0.14 145 / 0.07), transparent 45%);
}

/* keep the specimen card readable on a light page */
:root[data-theme="light"] .hero__card {
  box-shadow: 0 24px 60px -30px oklch(0.55 0.20 27 / .35),
              0 0 0 1px oklch(0.55 0.20 27 / .14);
}

body { transition: background-color .2s ease, color .2s ease; }

/* nav layout: links right, actions far right */
.nav__links { margin-left: auto; }
.nav__actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  background: var(--secondary); color: var(--foreground);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.theme-toggle:hover { border-color: var(--tomato); color: var(--tomato); }

/* dark theme → offer the sun; light theme → offer the moon */
.theme-toggle__moon { display: none; }
:root[data-theme="light"] .theme-toggle__sun  { display: none; }
:root[data-theme="light"] .theme-toggle__moon { display: block; }

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}

/* Styling for embedded PDF iframes */
.cert-preview {
  width: 100%;
  border: 1px solid #333;
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}

.cert-preview iframe {
  border: none;
  display: block;
}

/* Styling for clickable image thumbnails */
.cert-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: top;
  border-radius: 4px;
  border: 1px solid #333;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.cert-thumbnail-link:hover .cert-thumb {
  border-color: #00ff88;
  transform: scale(1.01);
}
/* CTF Photo Card Styling - Expanded View */
.card--ctf {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ctf-img-wrap {
  width: 100%;
  height: 280px; /* Increased image height from 180px */
  overflow: hidden;
  background: var(--secondary);
  border-bottom: 1px solid var(--border);
}

.ctf-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.card--ctf:hover .ctf-thumb {
  transform: scale(1.03);
}

.ctf-card-content {
  padding: 1.5rem 1.65rem; /* Larger interior spacing */
}

.ctf-card-content h3 {
  font-size: 1.35rem; /* Larger event title */
  margin-bottom: 0.5rem;
}

.ctf-card-content .card__sub {
  font-size: 1.1rem;
}

.ctf-card-content .card__meta {
  font-size: 0.95rem;
  margin-top: 0.25rem;
}
.btn-pill--projects {
  border-color: oklch(0.62 0.14 145);
  color:        oklch(0.62 0.14 145);
}
.btn-pill--projects:hover {
  background:   oklch(0.62 0.14 145);
  color:        #0e0e10; /* or var(--background) if you have it */
}