/* Theme colours, carried over from the original Astro/shadcn theme */
:root {
  --background: 0 0% 100%;
  --foreground: 20 14.3% 4.1%;
  --card: 0 0% 100%;
  --primary: 165.5 69% 38%;
  --primary-foreground: 60 9.1% 97.8%;
  --muted: 60 4.8% 95.9%;
  --muted-foreground: 25 5.3% 44.7%;
  --accent: 60 4.8% 95.9%;
  --border: 20 5.9% 90%;
  --radius: 1rem;
  --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.dark {
  --background: 20 14.3% 4.1%;
  --foreground: 60 9.1% 97.8%;
  --card: 20 14.3% 4.1%;
  --primary: 165.8 69% 53%;
  --primary-foreground: 60 9.1% 97.8%;
  --muted: 12 6.5% 15.1%;
  --muted-foreground: 24 5.4% 63.9%;
  --accent: 12 6.5% 15.1%;
  --border: 12 6.5% 15.1%;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, blockquote { margin: 0; }
a { color: inherit; }
hr { border: 0; border-top: 1px solid hsl(var(--border)); margin: 0.25rem 0; width: 100%; }

.icon {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { font-weight: 700; text-decoration: none; }
.nav { display: flex; align-items: center; gap: 0.5rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.btn:focus-visible { outline: 2px solid hsl(var(--primary)); outline-offset: 2px; }
.btn-ghost:hover { background: hsl(var(--accent)); }
.btn-outline { border-color: hsl(var(--border)); background: hsl(var(--background)); }
.btn-outline:hover { background: hsl(var(--accent)); }
.btn-icon { width: 2.5rem; padding: 0; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { background: hsl(var(--primary) / 0.9); }
.btn-icon-lg { width: 3.5rem; height: 2.5rem; padding: 0; }

.icon-sun { display: none; }
.dark .icon-sun { display: block; }
.dark .icon-moon { display: none; }

/* Bento grid */
.grid {
  display: grid;
  gap: 0.5rem;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.5rem;
  grid-template-columns: 1fr;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: appear 0.5s ease-in-out;
}
.card h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 0.5rem; }

@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* Intro */
.card-intro { display: flex; gap: 1rem; }
.intro-text { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; flex: 1; position: relative; z-index: 1; }
.hello { font-size: 1.25rem; font-weight: 300; }
.hello b { font-weight: 700; }
.intros { list-style: none; padding: 1rem 0 0; }
.avatar {
  position: absolute;
  right: -90px;
  bottom: -20px;
  max-height: 256px;
  width: auto;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

/* About */
/* About + Education share one column */
.side { display: flex; flex-direction: column; gap: inherit; }
.card-about { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.card-about h2 { margin-bottom: 0; }
.muted-sm { font-size: 0.875rem; font-weight: 300; }
.lead { font-weight: 500; }
.bullets { padding-left: 1.25rem; }

/* Experience */
.roles { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.5rem; }
.role h3 { font-size: 1rem; font-weight: 500; }
.company { font-size: 0.875rem; color: hsl(var(--primary)); }
.dates { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }

/* Clocks */
.clock { display: flex; align-items: center; gap: 0.75rem; padding: 0.25rem; }
.clock-time { font-size: 1.5rem; margin: 0.5rem 0; font-variant-numeric: tabular-nums; }
.clock-zone { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.pulse { position: relative; display: inline-flex; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: #22c55e; }
.pulse::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #4ade80;
  opacity: 0.75;
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }

/* Quote */
.card-quote { display: flex; align-items: center; }
.card-quote blockquote { border-left: 2px solid hsl(var(--border)); padding-left: 1.5rem; font-style: italic; }

/* Education */
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.5rem; }
.badge {
  display: inline-flex;
  padding: 0.125rem 0.625rem;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Contact */
.card-contact { display: flex; flex-direction: column; }
.contact-text { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 0.875rem; }
.contact-text a { text-decoration: underline; }
.contact-text a:hover { font-weight: 700; }

/* Footer */
.site-footer {
  width: 100%;
  max-width: 64rem;
  margin-top: 1rem;
  padding: 1.5rem 1rem;
  border-top: 1px solid hsl(var(--border));
  text-align: center;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* Tablet: two columns */
@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; padding: 1.5rem; }
  .card-intro { grid-column: span 2; }
  .avatar { position: relative; right: auto; bottom: auto; opacity: 1; max-height: 256px; align-self: center; }
  .side { grid-row: span 3; }
  .card-quote, .card-contact { grid-column: span 2; }
}

/* Desktop: twelve-column bento */
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(12, 1fr); gap: 1rem; }
  .card-intro { grid-column: span 9; }
  .side { grid-column: span 3; grid-row: span 3; }
  .card-experience { grid-column: span 3; grid-row: span 2; }
  .card-time { grid-column: span 3; }
  .card-quote { grid-column: span 6; }
  .card-contact { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .pulse::before { animation: none; }
}
