/* ---------------------------------------------------------------
   Craft floor.

   Everything below is byte-identical in every page that gets it
   right, so it ships here rather than being re-typed from the
   rules each time. Replace the :root values with the page's own
   palette; do not delete the rules that consume them.
   --------------------------------------------------------------- */

:root {
  /* Algorave floor palette: phosphor green, amber, gold on projector black */
  --ink: #00ff00; /* Phosphor green - primary text */
  --ink-muted: #00aa00; /* Dimmer green for secondary text */
  --bg: #000000; /* Projector black */
  --surface: #0a0a0a; /* Slightly lifted black for panels */
  --rule: #1a1a1a; /* Dark rule for subtle divisions */
  --accent: #ff8844; /* Warm coral - headings, functions */
  --accent-ink: #000000; /* Black text on coral */
  --cyan: #ffcc33; /* Golden yellow - values, strings */
  --amber: #ffaa00; /* Amber - upcoming changes, highlights */

  /* Under 80 rendered characters. ch is the width of a 0 and most
     letters are narrower, so 75ch measures nearer 95. */
  --measure: 60ch;

  scrollbar-color: var(--rule) transparent;
  caret-color: var(--ink);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark mode palette: desaturated and lifted for softer contrast */
    --ink: #00dd00; /* Slightly desaturated phosphor green */
    --ink-muted: #009900; /* Dimmer desaturated green */
    --bg: #0a0a0a; /* Lifted black */
    --surface: #151515; /* Lifted surface */
    --rule: #252525; /* Lifted rule for better visibility */
    --accent: #ff9966; /* Lightened coral for better contrast */
    --accent-ink: #000000; /* Black text on coral */
    --cyan: #ffdd66; /* Lightened golden yellow for better contrast */
    --amber: #ffbb33; /* Lightened amber for better contrast */
  }
}

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

/* Prevent any overflowing element from widening the document past the
   viewport. Without this a single oversized heading or image at a
   narrow viewport stretches the scroll width, which makes every
   paragraph on the page measure as flush to the viewport edge. */
html {
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: 'Courier New', Courier, 'Lucida Console', Monaco, monospace;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  letter-spacing: 0.01em;
}

p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

/* The surfaces you did not draw, which otherwise ship with browser
   defaults belonging to no design system. */
::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

/* Put on any cell holding a figure, so columns of numbers line up. */
.num {
  font-variant-numeric: tabular-nums;
}

/* 44px is the smallest reliably tappable target. Anything the reader
   presses needs it; a link inside a paragraph does not, which is why
   this is not on `a`. */
button,
[role="button"],
summary,
input[type="checkbox"],
input[type="radio"] {
  min-height: 44px;
}

button {
  min-width: 44px;
}

/* A document is one column, so the only thing that reliably breaks it
   is content that cannot shrink: a wide table, a long URL, a code
   block. These make the narrow viewport survivable without needing a
   layout per breakpoint. */
img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

pre {
  overflow-x: auto;
}

table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

@media (max-width: 480px) {
  body {
    /* Thumbs cover the edges; text should not start underneath them. */
    padding-inline: 1rem;
  }
}

/* Motion only for readers who have not asked the OS to stop it. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .terminal {
    border: none;
  }

  .contact-links {
    flex-direction: column;
    gap: 0.25rem;
  }

  .sidebar-right {
    break-before: page;
  }
}

/* ---------------------------------------------------------------
   Algorave terminal styling
   --------------------------------------------------------------- */

.terminal {
  min-height: 100vh;
  padding: 2rem;
  border: 1px solid var(--rule);
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}

.name {
  margin: 0;
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.separator {
  color: var(--accent);
  font-size: 2rem;
  font-weight: 300;
}

.title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.contact-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.contact-link:hover {
  color: var(--cyan);
}

.contact-link .icon {
  font-size: 1rem;
}

.contact-link .flag {
  color: var(--accent);
}

.contact-link .value {
  color: var(--cyan);
}

/* Content grid */
.content-grid {
  display: grid;
  grid-template-columns: 320px 1fr 280px;
  gap: 2rem;
  align-items: start;
}

/* Section titles */
.section-title {
  margin: 0 0 1rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-title-small {
  margin: 0 0 0.75rem 0;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Code blocks */
.code-block {
  margin: 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.code-block code {
  font-family: inherit;
}

.code-block .key {
  color: var(--cyan);
}

.code-block .string {
  color: var(--amber);
}

.code-block .number {
  color: var(--accent);
}

.code-block .comment {
  color: var(--ink-muted);
  font-style: italic;
}

/* Sidebar sections */
.sidebar-left,
.sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.skills-section,
.education-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Main content */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Job entries */
.job {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--rule);
  border-left: 1px solid var(--accent);
  background: var(--surface);
}

.job-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.company {
  color: var(--accent);
  font-size: 1.125rem;
  font-weight: 700;
}

.syntax {
  color: var(--ink);
}

.date-comment {
  color: var(--ink-muted);
  font-size: 0.875rem;
  margin-left: auto;
}

.role-line {
  padding-left: 1rem;
  margin: 0.25rem 0;
}

.keyword {
  color: var(--cyan);
  font-weight: 600;
}

.string {
  color: var(--amber);
}

.achievements {
  list-style: none;
  padding-left: 2rem;
  margin: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.achievements li {
  position: relative;
  color: var(--ink);
  line-height: 1.6;
}

.output-marker {
  position: absolute;
  left: -1.5rem;
  color: var(--cyan);
  font-weight: 700;
}

.closing-brace {
  padding-left: 1rem;
  color: var(--ink);
}

/* Profile section */
.profile-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
}

.terminal-prompt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.prompt-symbol {
  color: var(--accent);
  font-weight: 700;
}

.cursor {
  color: var(--ink);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.profile-data {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-data dt {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  margin: 0;
}

.profile-data dd {
  color: var(--ink);
  margin: 0 0 0.25rem 1rem;
  font-size: 0.8125rem;
}

/* Philosophy section */
.philosophy-section {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 1px solid var(--cyan);
}

/* Focus section */
.focus-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.focus-box {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
}

.focus-title {
  margin: 0 0 0.75rem 0;
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.9375rem;
}

.focus-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.focus-list li {
  color: var(--ink);
  font-size: 0.8125rem;
  padding-left: 1rem;
  position: relative;
}

.focus-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--cyan);
}

.cta-button {
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: 2px solid var(--ink);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.cta-button:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-1px);
}

.cta-button:active {
  transform: translateY(0);
}

.cta-indicator {
  color: var(--ink);
  font-size: 0.5rem;
  transition: color 0.2s ease;
}

.cta-button:hover .cta-indicator {
  color: var(--bg);
}

/* Responsive */
@media (max-width: 1200px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-left,
  .sidebar-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .terminal {
    padding: 1.5rem 1rem;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .name,
  .title {
    font-size: 1.5rem;
  }

  .contact-links {
    margin-left: 0;
    width: 100%;
  }

  .content-grid {
    gap: 1.5rem;
  }

  .sidebar-left,
  .sidebar-right {
    grid-template-columns: 1fr;
  }

  .code-block {
    font-size: 0.75rem;
  }

  .company {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  body {
    padding-inline: 0;
  }

  .terminal {
    padding: 1rem;
    border: none;
  }

  .name,
  .title {
    font-size: 1.25rem;
  }

  .contact-link {
    font-size: 0.75rem;
  }

  .achievements {
    padding-left: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }

  .cta-button {
    transition: none;
  }
}
@media (max-width: 480px) {
  /* --impeccable-mobile-pad */
  body { padding-inline: max(1rem, 16px); }
  .container, [class*="container"], section, header, footer, nav, main, article {
    padding-inline: max(1rem, 16px);
  }
}
/* --impeccable-measure */
p, li, dt, dd, blockquote, figcaption, td, th { max-width: min(75ch, 100%); }
