/* Viewport hint: ensure mobile browsers size correctly */
@viewport {
  width: device-width;
  zoom: 1.0;
}
:root {
  --bg-light: #ffffff;
  --fg-dark: #111213;
  --fg-muted: var(--fg-dark);
  --accent: #334abf; /* restrained blue accent */
}

/* Prevent iOS Safari from "font boosting" some blocks differently */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 800px;
  margin: 0 auto;
  padding: 30px 20px;
  line-height: 1.55;
  background-color: var(--bg-light);
  color: var(--fg-dark);
  font-size: 0.95rem;
  -webkit-font-smoothing: antialiased;
}

/* Ensure media never overflows containers */
img, svg, video, canvas, iframe {
  max-width: 100%;
  height: auto;
  box-sizing: border-box;
}

/* Project-specific images (e.g. UDASSA) */
.project-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Home quote */
p.quote {
  font-family: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  margin-top: 32px; /* space before the quote */
  padding-top: 12px; /* ensure visible spacing above (non-collapsing) */
}

p.quote .attribution {
  display: block;
  margin-top: 18px; /* space between quote and author */
  text-align: right;
}

h1, h2 {
  font-family: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-weight: 500;
  color: var(--fg-dark);
  margin-top: 2em;
  margin-bottom: 0.8em;
  text-wrap: balance;
}

h1 {
  font-size: 1.75rem;
  padding-bottom: 0.4em;
}

h2 {
  font-size: 1.2rem;
  color: var(--fg-muted);
}

a {
  color: #0645ad; /* classic link blue */
  text-decoration: underline;
}

a:visited {
  color: #0645ad; /* match normal link blue */
}

a:hover,
a:focus {
  text-decoration: underline;
}

/* Navigation */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-light);
  margin: calc(-30px - env(safe-area-inset-top)) auto 30px;
  padding: calc(10px + env(safe-area-inset-top)) 0 10px;
}

.site-nav a {
  font-family: ui-monospace, monospace;
  color: var(--fg-dark);
  text-decoration: none;
  margin-right: 16px;
  padding: 4px 0;
}

.site-nav a:hover {
  color: var(--fg-dark);
  text-decoration: none;
}

.site-nav a:focus {
  color: var(--fg-dark);
  text-decoration: none;
}

.site-nav a:visited {
  color: var(--fg-dark);
  text-decoration: none;
}

.site-nav a.active {
  color: var(--fg-dark);
  font-weight: bold;
}

/* Accessible focus rings */
a:focus-visible,
.site-nav a:focus-visible,
.project-title:focus-visible {
  outline: 2px solid var(--fg-dark);
  outline-offset: 2px;
  text-decoration: none;
}

/* Project & FAQ blocks */
.project {
  margin-top: 1.5em;
  padding-top: 0.5em;
  border: none; /* no lines */
}

.project-title {
  font-family: ui-monospace, monospace;
  font-size: 1rem;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: flex-start;
  margin: 1em 0;
  border: none; /* no lines */
  padding: 6px 0; /* increase tap target size */
}

/* arrow on the LEFT */
.project-title::before {
  content: "▸";
  margin-right: 8px;
  transition: transform 0.2s ease;
}

.project-title.expanded::before {
  transform: rotate(90deg);
}

.project-content {
  padding: 0.5em 0 0 1.5em; /* small indent for answers */
  display: none;
}

/* Prevent horizontal overflow in project content */
.project-content {
  overflow-x: hidden;
}

.project-content.expanded {
  display: block;
}

.abstract,
.keywords,
.people {
  margin-bottom: 12px;
}

.keywords {
  color: var(--fg-muted);
}

.people {
  font-weight: bold;
}

/* Quote block */
blockquote.quote {
  margin: 30px 0;
  padding: 14px 18px;
  background: var(--bg-light);
  font-size: 1rem;
  color: var(--fg-dark);
  border-left: 3px solid var(--fg-dark);
}

blockquote.quote cite {
  display: block;
  margin-top: 8px;
  color: var(--fg-muted);
  font-style: normal;
  text-align: right;
}

/* Figure */
.figure {
  margin: 24px 0;
  text-align: center;
}

.figure img {
  max-width: 100%;
  height: auto;
}

.figure .caption {
  margin-top: 8px;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* FAQ Section */
.cta {
  font-family: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

.faq-question {
  font-family: ui-monospace, monospace;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  margin: 1.5em 0;
}

.faq-question::before {
  content: "▸";
  margin-right: 8px;
  transition: transform 0.2s ease;
}

.faq-question.expanded::before {
  transform: rotate(90deg);
}

.faq-question:hover {
  background: transparent;
}

.faq-answer {
  display: none;
  margin-top: 0.5em;
  color: var(--fg-dark);
}

.faq-answer.expanded {
  display: block;
}

/* Kill all <hr> lines globally */
hr {
  display: none !important;
  border: none !important;
}

/* Mobile-only comfortable reading sizes */
@media (max-width: 640px) {
  body { font-size: 1.05rem; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.25rem; }
  .project-title { font-size: 1.05rem; }
  .figure .caption { font-size: 1rem; }
}

/* Larger tap targets on touch devices */
@media (pointer: coarse) {
  .site-nav a { padding: 8px 0; }
  .project-title { padding: 10px 0; }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .project-title::before { transition: none; }
}

/* Global footer */
footer.site-footer {
  margin-top: 48px;
  padding-top: 16px;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* Use default link styling in footer */
footer.site-footer a {
  font-family: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}