/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-color: hsl(220, 13%, 91%);
}

/* ===== CSS Custom Properties (theme from style/main.css) ===== */
:root {
  --background:          hsl(0, 0%, 100%);
  --foreground:          hsl(224, 71.4%, 4.1%);
  --card:                hsl(0, 0%, 100%);
  --card-foreground:     hsl(224, 71.4%, 4.1%);
  --primary:             hsl(220.9, 39.3%, 11%);
  --primary-foreground:  hsl(210, 20%, 98%);
  --secondary:           hsl(220, 14.3%, 95.9%);
  --secondary-foreground:hsl(220.9, 39.3%, 11%);
  --muted:               hsl(220, 14.3%, 95.9%);
  --muted-foreground:    hsl(220, 8.9%, 46.1%);
  --accent:              hsl(220, 14.3%, 95.9%);
  --accent-foreground:   hsl(220.9, 39.3%, 11%);
  --border:              hsl(220, 13%, 91%);
  --input:               hsl(220, 13%, 91%);
  --ring:                hsl(224, 71.4%, 4.1%);
  --radius:              0.5rem;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

/* ===== Base ===== */
body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

/* ===== Page layout ===== */
.page-container {
  position: relative;
  margin: auto;
  overflow: auto;
  padding: 1rem;
  scroll-margin-top: 3rem;
  scroll-margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .page-container { padding: 4rem; }
}

@media print {
  .page-container { padding: 3rem; }
}

.resume {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 42rem; /* max-w-2xl = 672px */
  display: flex;
  flex-direction: column;
  gap: 2rem; /* space-y-8 */
  background-color: white;
}

@media print {
  .resume { gap: 1.5rem; }
}

/* ===== Header ===== */
.resume-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem; /* space-y-1.5 */
}

.name {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 2rem;
}

.about {
  max-width: 28rem;
  text-wrap: pretty;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.location {
  max-width: 28rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.location a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  line-height: 1;
  text-decoration: none;
  vertical-align: baseline;
}

.location a:hover { text-decoration: underline; }

.location svg {
  width: 0.75rem;   /* size-3 */
  height: 0.75rem;
  flex-shrink: 0;
  align-self: center;
}

/* ===== Social link buttons (screen) ===== */
.social-links-screen {
  display: flex;
  gap: 0.25rem;     /* gap-x-1 */
  padding-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;      /* size-8 */
  height: 2rem;
  border-radius: calc(var(--radius) - 2px); /* rounded-md */
  border: 1px solid var(--input);
  background-color: var(--background);
  color: var(--foreground);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.btn-icon:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.btn-icon svg {
  width: 1rem;    /* size-4 */
  height: 1rem;
  flex-shrink: 0;
}

/* Social links (print only) */
.social-links-print {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.social-links-print a { text-decoration: none; }

.underline-text { text-decoration: underline; }

@media print {
  .social-links-screen { display: none !important; }
  .social-links-print  { display: flex; }
}

/* ===== Avatar ===== */
.avatar {
  position: relative;
  display: flex;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0.75rem; /* rounded-xl */
  height: 7rem;           /* size-28 */
  width: 7rem;
}

.avatar img {
  aspect-ratio: 1 / 1;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

/* ===== Section ===== */
.section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem; /* gap-y-3 */
  min-height: 0;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.75rem;
}

.summary-text {
  text-wrap: pretty;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* ===== Card ===== */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--card);
  color: var(--card-foreground);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;  /* space-y-1.5 */
  padding: 1.5rem; /* p-6 */
}

.card-content {
  padding: 0 1.5rem 1.5rem; /* p-6 pt-0 */
}

/* ===== Work experience card ===== */
.work-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem; /* gap-x-2 */
  font-size: 1rem;
}

.work-company {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem; /* gap-x-1 */
  font-weight: 600;
  line-height: 1;
}

.work-company-link {
  text-decoration: none;
}

.work-company-link:hover { text-decoration: underline; }

.work-company img {
  height: 16px;
  width: auto;
}

.work-badges {
  display: inline-flex;
  gap: 0.25rem; /* gap-x-1 */
}

.work-period {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  white-space: nowrap;
  flex-shrink: 0;
}

.work-title {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1;
}

.work-desc {
  margin-top: 0.5rem; /* mt-2 */
  font-size: 0.75rem; /* text-xs */
}

/* ===== Education card ===== */
.edu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 1rem;
}

.edu-school {
  font-weight: 600;
  line-height: 1;
}

.edu-period {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  white-space: nowrap;
  flex-shrink: 0;
}

.edu-degree {
  margin-top: 0.5rem;
}

/* ===== Skills ===== */
.skills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem; /* gap-1 */
}

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: calc(var(--radius) - 2px); /* rounded-md */
  border: 1px solid transparent;
  padding: 0.125rem 0.5rem; /* py-0.5 px-2 */
  font-size: 0.75rem;       /* text-xs */
  font-weight: 600;
  font-family: var(--font-mono);
  transition: background-color 0.15s;
  white-space: nowrap;
  vertical-align: middle;
}

/* Default badge: primary/80 bg */
.badge-default {
  background-color: hsla(220.9, 39.3%, 11%, 0.8);
  color: var(--primary-foreground);
  border-color: transparent;
}

.badge-default:hover {
  background-color: hsla(220.9, 39.3%, 11%, 0.6);
}

/* Secondary badge: light gray bg */
.badge-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border-color: transparent;
}

.badge-secondary:hover {
  background-color: hsla(220, 14.3%, 95.9%, 0.6);
}

/* ===== Projects grid ===== */
.projects-grid {
  margin-left: -0.75rem;   /* -mx-3 */
  margin-right: -0.75rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;            /* gap-3 */
}

@media (min-width: 768px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .projects-grid { grid-template-columns: repeat(3, 1fr); }
}

@media print {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
}

/* ===== Project card ===== */
.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--muted);
  background-color: var(--card);
  color: var(--card-foreground);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  padding: 0.75rem; /* p-3 */
}

/* CardHeader inside ProjectCard: flex flex-col space-y-1.5 p-6 */
.project-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.5rem;
}

/* space-y-1 inner div */
.project-space {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* CardTitle: text-2xl font-semibold leading-none tracking-tight; override text-base */
.project-title {
  font-size: 1rem;           /* text-base override */
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em; /* tracking-tight */
}

.project-title a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem; /* gap-1 */
  text-decoration: none;
}

.project-title a:hover { text-decoration: underline; }

.dot-green {
  display: inline-block;
  width: 0.25rem;   /* size-1 */
  height: 0.25rem;
  border-radius: 9999px;
  background-color: #22c55e; /* green-500 */
  flex-shrink: 0;
}

/* hidden font-mono text-xs underline; visible on print */
.project-url {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-decoration: underline;
}

@media print {
  .project-url { display: block; }
}

/* CardDescription: text-sm text-muted-foreground; override font-mono text-xs */
.project-desc {
  font-family: var(--font-mono);
  font-size: 0.75rem; /* text-xs override */
  color: var(--muted-foreground);
}

/* CardContent: p-6 pt-0 mt-auto flex */
.project-tags {
  padding: 0 1.5rem 1.5rem;
  margin-top: auto;
  display: flex;
}

.tags-wrap {
  margin-top: 0.5rem; /* mt-2 */
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem; /* gap-1 */
}

/* Project tag badges: px-1 py-0 text-[10px] + badge-secondary */
.badge-project {
  padding: 0 0.25rem; /* px-1 py-0 */
  font-size: 0.625rem; /* text-[10px] */
}

/* ===== Print page break ===== */
.print-force-new-page {
  page-break-before: always;
  scroll-margin-bottom: 4rem; /* scroll-mb-16 */
}

/* ===== Command menu: bottom hint (xl+) ===== */
.cmd-hint {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: none;
  border-top: 1px solid var(--muted);
  background-color: white;
  padding: 0.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

@media (min-width: 1280px) {
  .cmd-hint { display: block; }
}

@media print {
  .cmd-hint { display: none !important; }
}

kbd.cmd-key {
  display: inline-flex;
  height: 1.25rem;
  pointer-events: none;
  user-select: none;
  align-items: center;
  gap: 0.25rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
  background-color: var(--muted);
  padding: 0 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--muted-foreground);
  opacity: 1;
  vertical-align: middle;
}

/* ===== Command menu: FAB (< xl) ===== */
.cmd-fab {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  border-radius: 9999px;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--input);
  background-color: var(--background);
  color: var(--foreground);
  cursor: pointer;
  transition: background-color 0.15s;
}

.cmd-fab:hover { background-color: var(--accent); }

.cmd-fab svg {
  width: 1.5rem;
  height: 1.5rem;
}

@media (min-width: 1280px) {
  .cmd-fab { display: none; }
}

@media print {
  .cmd-fab { display: none !important; }
}

/* ===== Command menu: dialog ===== */
.cmd-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
}

.cmd-dialog {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 51;
  width: calc(100% - 2rem);
  max-width: 32rem;
  transform: translate(-50%, -50%);
  flex-direction: column;
  gap: 1rem;
  border: 1px solid var(--border);
  background-color: var(--background);
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  border-radius: var(--radius);
}

.cmd-dialog.open {
  display: flex;
}

.cmd-input {
  width: 100%;
  height: 2.75rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background-color: transparent;
  padding: 0.75rem 0;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  outline: none;
  color: var(--foreground);
}

.cmd-input::placeholder { color: var(--muted-foreground); }

.cmd-list {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

.cmd-group {
  overflow: hidden;
  padding: 0.25rem;
  color: var(--foreground);
}

.cmd-group-label {
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.cmd-item {
  position: relative;
  display: flex;
  cursor: pointer;
  user-select: none;
  align-items: center;
  border-radius: calc(var(--radius) - 4px);
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  outline: none;
}

.cmd-item:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}
