/* ==========================================================================
   Neo-brutalist design system
   Shares its tokens and component names with CucinaBova's frontend/css/app.css
   so the two codebases read the same way.
   ========================================================================== */

:root {
  /* NeoColor */
  --ink: #0d0d0d;
  --paper: #f7ffee;
  --card: #ffffff;

  /* The two purples from the original sambova.space dropdown: the light fill
     it used on hover, and the deeper one for focus rings. */
  --purple: #d7d2ff;
  --purple-deep: #786bde;

  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;

  --border: 3px;
  --border-thin: 2px;

  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* Minimum comfortable touch target. */
  --tap: 44px;

  /* Light-only, like CucinaBova; ink-on-paper is the whole idea. */
  color-scheme: light;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  /* Stops iOS from silently inflating text in landscape. */
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font-family: inherit;
  /* < 16px makes iOS Safari zoom the viewport on focus. */
  font-size: 16px;
  color: var(--ink);
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

:focus-visible {
  outline: var(--border) solid var(--purple-deep);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Horizontally scrolling rail — used for the nav so it never needs a
   JavaScript menu on a narrow screen. */
.rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 16px;
  margin: 0 -16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail > * {
  flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

.title-xl {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: clamp(1.5rem, 7vw, 2.125rem);
  line-height: 1.1;
  margin: 0;
}

.title-lg {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: clamp(1.25rem, 5.5vw, 1.625rem);
  line-height: 1.15;
  margin: 0;
}

.title-md {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 1.0625rem;
  margin: 0;
}

.label {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.body {
  font-size: 0.9375rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--ink) 85%, transparent);
  margin: 0;
}

.muted {
  color: color-mix(in srgb, var(--ink) 55%, transparent);
  font-size: 0.9375rem;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: var(--border) solid var(--ink);
  background: var(--card);
  margin-bottom: 8px;
}

.site-header .app {
  padding-top: 16px;
  padding-bottom: 12px;
  gap: 12px;
}

.brand {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Card — NeoBrutalistCardModifier
   -------------------------------------------------------------------------- */

.neo-card {
  background: var(--card);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 16px;
}

/* --------------------------------------------------------------------------
   Button — NeoBrutalistButtonStyle (flat: no offset shadow, square corners)
   -------------------------------------------------------------------------- */

.neo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 12px 16px;
  background: var(--purple);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 0.9375rem;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius-lg);
  transition: box-shadow 90ms ease-out;
}

/* Hover thickens the border; pressing snaps it back. A spread shadow is used
   instead of border-width so the button doesn't grow and nudge the layout.
   Hover is gated so touch devices don't get a sticky "hovered" state. */
@media (hover: hover) {
  .neo-btn:hover:not(:disabled),
  a.chip:hover,
  button.chip:hover {
    box-shadow: 0 0 0 2px var(--ink);
  }
}

.neo-btn:active:not(:disabled),
a.chip:active,
button.chip:active {
  box-shadow: none;
}

.neo-btn--sm {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.75rem;
  border-width: var(--border-thin);
  border-radius: var(--radius-md);
}

.neo-btn--white { background: var(--card); }

/* --------------------------------------------------------------------------
   Chip / tag — CategoryBadgeView, StatChip
   -------------------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  min-height: 36px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius-md);
  transition: box-shadow 90ms ease-out;
  white-space: nowrap;
}

.chip--selected,
.chip[aria-current] {
  background: var(--purple);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.6875rem;
  text-transform: uppercase;
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--purple);
  white-space: nowrap;
}

/* Section header pill, e.g. "01. PROJECTS". */
.section-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 9px;
  background: var(--purple);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  border: var(--border-thin) solid var(--ink);
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.hero-photo {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius-lg);
}

@media (max-width: 30rem) {
  .hero {
    flex-direction: column;
  }
}

/* --------------------------------------------------------------------------
   Project + tool lists
   -------------------------------------------------------------------------- */

.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 12px;
}

/* A lone card shouldn't sit in half a row looking like something fell off. */
.card-list > :only-child {
  grid-column: 1 / -1;
}

.project {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* An inline text link, which does need an underline to read as one. */
.link {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: var(--border) solid var(--ink);
  background: var(--card);
  margin-top: 8px;
  padding: 16px 0;
}

.site-footer .app {
  padding-bottom: 0;
  gap: 8px;
}
