/* ============================================================
   Jan Vlasatý · janvlasaty.cz
   Bauhaus × Apple
============================================================ */

:root {
  --bg:       #080808;
  --border:   rgba(255,255,255,0.06);
  --border-2: rgba(255,255,255,0.10);

  --fg:     #F0EDE7;
  --muted:  #484848;
  --muted2: #7A7A7A;

  --red:    #E8321E;
  --yellow: #F5C800;
  --blue:   #0057FF;

  --f-display: 'Epilogue', sans-serif;
  --f-body:    'DM Sans', sans-serif;

  --max:  1160px;
  --px:   clamp(1.5rem, 5vw, 5rem);
  --nav-bg: rgba(8,8,8,0.88);
}

[data-theme="light"] {
  --bg:       #F4F1EC;
  --border:   rgba(0,0,0,0.07);
  --border-2: rgba(0,0,0,0.12);

  --fg:     #0D0D0D;
  --muted:  #8C8C8C;
  --muted2: #555555;

  --nav-bg: rgba(244,241,236,0.88);
}

/* ── RESET ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-thumb { background: var(--red); }
a { color: inherit; text-decoration: none; }

/* Top-of-page red rule — draws in on load */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--red);
  transform-origin: left;
  transform: scaleX(0);
  animation: drawLine 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
  z-index: 999;
}

/* ── NAV ─────────────────────────────────────────────── */
#nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem var(--px);
  transition: background 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-color: var(--border);
}
.nav-logo {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}
.nav-logo em { color: var(--red); font-style: normal; }
.nav-right { display: flex; align-items: center; gap: 2.5rem; }
.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links a {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted2);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--fg); }
#theme-toggle {
  background: none;
  border: 1px solid var(--border-2);
  color: var(--muted2);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.6rem;
  transition: border-color 0.2s, color 0.2s;
}
#theme-toggle:hover { border-color: var(--fg); color: var(--fg); }
.icon-light { display: none; }
[data-theme="light"] .icon-dark  { display: none; }
[data-theme="light"] .icon-light { display: block; }

/* ── HERO ────────────────────────────────────────────── */
#hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--px) 5rem;
  position: relative;
  overflow: hidden;
}

/* Bauhaus giant ghost letter — typographic background element */
.hero-bg-letter {
  position: absolute;
  right: -0.07em;
  bottom: -0.12em;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(20rem, 48vw, 58rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.028);
  pointer-events: none;
  user-select: none;
  animation: up 1.4s 0.05s both;
}
[data-theme="light"] .hero-bg-letter {
  -webkit-text-stroke: 1px rgba(0,0,0,0.022);
}

.hero-inner {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 8rem;
  margin-bottom: 2.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: up 0.7s 0.1s both;
}
.hero-name {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(4.5rem, 13vw, 14rem);
  line-height: 0.91;
  letter-spacing: -0.04em;
  margin-bottom: 2.5rem;
  animation: up 0.7s 0.2s both;
}
.hero-name .solid { display: block; }
.hero-name .outline {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(240,237,231,0.18);
}
[data-theme="light"] .hero-name .outline {
  -webkit-text-stroke: 1.5px rgba(13,13,13,0.15);
}

/* Bauhaus primary-color bars — draw in after name appears */
.hero-bars {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3rem;
}
.hero-bars span {
  display: block;
  height: 3px;
  transform-origin: left;
  transform: scaleX(0);
  animation: drawBar 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.bar-r { width: 52px; background: var(--red);    animation-delay: 0.48s; }
.bar-y { width: 20px; background: var(--yellow);  animation-delay: 0.58s; }
.bar-b { width: 32px; background: var(--blue);    animation-delay: 0.68s; }

.hero-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  animation: up 0.7s 0.35s both;
}
.hero-role {
  font-size: 1rem;
  font-weight: 300;
  color: var(--muted2);
}
.hero-cta { display: flex; gap: 1rem; align-items: center; }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  font-family: var(--f-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.8rem 1.75rem;
  display: inline-block;
  cursor: pointer;
  transition: opacity 0.2s, color 0.2s;
}
.btn-fill { background: var(--red); color: #fff; border: 1px solid var(--red); }
.btn-fill:hover { opacity: 0.82; }
.btn-text { background: none; border: none; color: var(--muted2); padding-left: 0; padding-right: 0; }
.btn-text:hover { color: var(--fg); }
.btn-lg { font-size: 0.9rem; padding: 1rem 2.25rem; }

/* ── SECTIONS ────────────────────────────────────────── */
.section {
  padding: 9rem var(--px);
  border-top: 1px solid var(--border);
}
.section-head {
  max-width: var(--max);
  margin: 0 auto 5rem;
}
.s-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
/* Section title reveal — slides up when section enters view */
.s-title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 5vw, 5.5rem);
  letter-spacing: -0.04em;
  line-height: 0.92;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.section-head.visible .s-title {
  opacity: 1;
  transform: none;
}

/* ── TIMELINE ────────────────────────────────────────── */
.tl {
  max-width: var(--max);
  margin: 0 auto;
}
.tl-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0 4rem;
  padding: 3.5rem 0;
  border-top: 1px solid var(--border);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.tl-row.visible { opacity: 1; transform: none; }
.tl-yr {
  text-align: right;
  padding-top: 0.25rem;
}
.tl-yr strong {
  display: block;
  font-family: var(--f-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
.tl-yr span {
  font-size: 0.7rem;
  color: var(--muted);
  display: block;
  margin-top: 0.25rem;
}
.tl-co {
  font-size: 0.75rem;
  color: var(--muted2);
  margin-bottom: 0.5rem;
}
.tl-role {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.tl-desc {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--muted2);
  line-height: 1.85;
  max-width: 58ch;
}

/* ── SKILLS ──────────────────────────────────────────── */
.skills {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.sk-group {
  padding: 2.5rem 3rem 2.5rem 0;
  border-top: 1px solid var(--border);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.sk-group.visible { opacity: 1; transform: none; }
.sk-cat {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  margin-bottom: 0.9rem;
}
.sk-list {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--muted2);
  line-height: 1.9;
}

/* ── PROJECTS ────────────────────────────────────────── */
.projects {
  max-width: var(--max);
  margin: 0 auto;
}
.proj {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  align-items: start;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.proj.visible { opacity: 1; transform: none; }
.proj-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.65rem;
  position: relative;
  display: inline-block;
  transition: color 0.25s;
}
/* Underline draws left-to-right on hover */
.proj-title::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0; right: 0;
  height: 1px;
  background: var(--red);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.proj:hover .proj-title { color: var(--red); }
.proj:hover .proj-title::after { transform: scaleX(1); }
.proj-desc {
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--muted2);
  line-height: 1.85;
  margin-bottom: 0.85rem;
  max-width: 58ch;
}
.proj-tech {
  font-size: 0.75rem;
  color: var(--muted);
}
.proj-aside {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
  min-width: 110px;
}
.proj-yr {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}
.proj-links { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-end; }
.proj-links a { font-size: 0.8rem; color: var(--muted2); transition: color 0.2s; }
.proj-links a:hover { color: var(--fg); }

/* ── EDUCATION ───────────────────────────────────────── */
.edu {
  max-width: var(--max);
  margin: 0 auto;
}
.edu-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0 4rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.edu-row.visible { opacity: 1; transform: none; }
.edu-yr {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: right;
  padding-top: 0.2rem;
  line-height: 1.6;
}
.edu-deg {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}
.edu-field { font-size: 0.875rem; font-weight: 300; color: var(--muted2); margin-bottom: 0.3rem; }
.edu-school { font-size: 0.72rem; color: var(--muted); }

/* ── CTA ─────────────────────────────────────────────── */
.cta {
  padding: 11rem var(--px);
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: 'HELLO';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(5rem, 22vw, 24rem);
  letter-spacing: -0.06em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px var(--border-2);
  pointer-events: none;
  user-select: none;
}
.cta-inner {
  max-width: var(--max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4rem;
  flex-wrap: wrap;
}
.cta-title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(3rem, 7vw, 8rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
}
.cta-title em { color: var(--red); font-style: normal; }

/* ── FOOTER ──────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem var(--px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.foot-copy { font-size: 0.78rem; color: var(--muted); }
.foot-links { display: flex; gap: 2rem; }
.foot-links a { font-size: 0.78rem; color: var(--muted); transition: color 0.2s; }
.foot-links a:hover { color: var(--fg); }

/* ── ANIMATIONS ──────────────────────────────────────── */
@keyframes up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
@keyframes drawBar {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes drawLine {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 900px) {
  #nav { padding: 1.25rem 1.5rem; }
  .nav-links { display: none; }

  .section { padding: 5rem 1.5rem; }
  .section-head { margin-bottom: 3.5rem; }

  .tl-row { grid-template-columns: 60px 1fr; gap: 0 1.75rem; padding: 2.5rem 0; }
  .tl-yr strong { font-size: 1.2rem; }

  .skills { grid-template-columns: 1fr 1fr; }
  .sk-group { padding-right: 1.5rem; }

  .proj { grid-template-columns: 1fr; gap: 1rem; }
  .proj-aside { flex-direction: row; align-items: center; justify-content: space-between; min-width: auto; text-align: left; }

  .edu-row { grid-template-columns: 70px 1fr; gap: 0 1.75rem; }

  .cta { padding: 7rem 1.5rem; }
  .cta-inner { flex-direction: column; align-items: flex-start; gap: 3rem; }

  footer { flex-direction: column; gap: 1rem; padding: 1.5rem; text-align: center; }
}

@media (max-width: 560px) {
  .skills { grid-template-columns: 1fr; }
  .hero-name { font-size: clamp(3.5rem, 14vw, 5rem); }
  #hero { padding-bottom: 3.5rem; }
}
