/* Martin's Apps
   Tokens, names and values come from the eMTe 2026 UI Design Library
   (dev-assets/Branding-Guidelines-MT.html). Only what this page uses is included. */

/* ── Fonts (Latin subsets of the library's fonts) ─────────────────────────── */

@font-face {
  font-family: 'Roboto Slab';
  src: url('../fonts/roboto-slab-latin.woff2') format('woff2');
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/ibm-plex-sans-latin.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ───────────────────────────────────────────────────────────────── */

:root {
  --font-family-display: 'Roboto Slab', Georgia, Cambria, 'Times New Roman', serif;
  --font-family-sans: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-family-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  --font-size-xs: 0.875rem;
  --font-size-sm: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 1.875rem;
  --font-size-3xl: 2.25rem;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semi-bold: 600;

  --line-height-xs: 1.1;
  --line-height-md: 1.4;
  --line-height-lg: 1.5;
  --line-height-xl: 1.6;
  --letter-spacing-snug: -0.015em;

  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  --size-2xl: 4rem;
  --size-3xl: 6rem;
  --size-4xl: 8rem;

  --radius-xs: 0.25rem;
  --radius-md: 0.5rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  --container-lg: 48rem;

  --duration-fast: 150ms;
  --easing-standard: cubic-bezier(0.4, 0, 0.2, 1);

  --color-surface: #F5F0E8;
  --color-surface-hover: #EDE7DB;
  --color-surface-footer: #111010;
  --color-text-primary: #111010;
  --color-text-secondary: #5C574F;
  --color-text-on-dark: #FDFAF5;
  --color-text-muted-dark: #B0AAA4;
  --color-border: #E2D9CE;
  --color-border-focus: #263D18;
  --color-brand: #4A6E2E;
  --color-brand-hover: #263D18;
  --color-accent-300: #A7C78F;
  --color-brand-on-dark: #6BA348;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */

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

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

/* Column layout keeps the footer at the bottom when the app list is short */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  font-family: var(--font-family-sans);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-xl);
  color: var(--color-text-primary);
  background-color: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1,
h2,
h3 {
  font-family: var(--font-family-display);
  overflow-wrap: break-word;
}

h1 {
  margin: 0 0 var(--space-lg);
  font-size: var(--font-size-3xl);
  line-height: var(--line-height-xs);
  font-weight: var(--font-weight-semi-bold);
  letter-spacing: var(--letter-spacing-snug);
}

h2 {
  margin: 0 0 var(--space-md);
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-md);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-snug);
}

h3 {
  margin: 0;
  font-size: var(--font-size-xl);
  line-height: var(--line-height-md);
  font-weight: var(--font-weight-medium);
}

p {
  margin: 0 0 var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

.mt-text--lg {
  font-size: var(--font-size-md);
  line-height: var(--line-height-lg);
}

a {
  color: var(--color-brand);
  font-weight: var(--font-weight-medium);
  text-decoration: underline dashed;
  text-decoration-color: var(--color-accent-300);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color var(--duration-fast) var(--easing-standard),
              background-color var(--duration-fast) var(--easing-standard),
              color var(--duration-fast) var(--easing-standard);
}

a:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

.mt-container {
  width: 100%;
  max-width: var(--container-lg);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

/* ── Introduction ─────────────────────────────────────────────────────────── */

.mt-intro {
  padding-block: var(--space-3xl) 0;
}

.mt-intro__portrait {
  width: var(--size-4xl);
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-full);
}

/* ── App list ─────────────────────────────────────────────────────────────── */

.mt-apps {
  flex: 1;
  padding-block: var(--space-3xl);
}

.mt-app-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--color-border);
}

.mt-app-list > li {
  padding-block: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
}

/* Icon on the left; text on the right. The last row absorbs any extra icon height. */
.mt-app {
  position: relative;
  display: grid;
  grid-template-columns: var(--size-3xl) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  column-gap: var(--space-lg);
  margin-inline: calc(var(--space-md) * -1);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  transition: background-color var(--duration-fast) var(--easing-standard);
}

.mt-app__icon {
  grid-row: 1 / -1;
  width: 100%;
  border-radius: var(--radius-2xl);
}

/* Pale stroke for icons with light backgrounds that blend into the page */
.mt-app__icon--outlined {
  box-shadow: 0 0 0 1px var(--color-border);
}

.mt-app__name,
.mt-app__tagline,
.mt-app__description {
  grid-column: 2;
}

.mt-app__tagline {
  margin-bottom: var(--space-2xs);
  font-weight: var(--font-weight-medium);
}

.mt-app__description {
  color: var(--color-text-secondary);
}

/* New-tab cue. Inline-block keeps the link's underline off the arrow. */
.mt-app__arrow {
  display: inline-block;
  margin-inline-start: var(--space-2xs);
  font-family: var(--font-family-sans);
  font-size: 0.75em;
}

/* Stretched link: the app name is the only link, and this layer extends it over the whole entry */
.mt-app__name a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
}

.mt-app__name a:focus-visible {
  outline: none;
}

/* Drawn inside the entry so the ring isn't clipped at the screen edge on phones */
.mt-app__name a:focus-visible::after {
  outline: 2px solid var(--color-border-focus);
  outline-offset: -2px;
}

@media (hover: hover) {
  .mt-app:hover {
    background-color: var(--color-surface-hover);
  }

  .mt-app:hover .mt-app__name a {
    color: var(--color-brand-hover);
    text-decoration-style: solid;
    text-decoration-color: var(--color-brand-hover);
  }
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.site-footer {
  padding-block: var(--space-xl);
  background-color: var(--color-surface-footer);
  color: var(--color-text-muted-dark);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
}

/* Underlined because these links sit inside a sentence, and colour alone wouldn't identify them */
.site-footer a {
  color: var(--color-text-muted-dark);
  font-weight: var(--font-weight-regular);
  text-decoration-style: solid;
  text-decoration-color: currentColor;
}

.site-footer a:hover {
  color: var(--color-text-on-dark);
}

/* The standard focus colour is only 1.59:1 on this background */
.site-footer a:focus-visible {
  color: var(--color-text-on-dark);
  outline-color: var(--color-brand-on-dark);
}

/* ── Smaller screens (em units also respond to browser text size) ─────────── */

@media (max-width: 48em) {
  h1 { font-size: var(--font-size-2xl); }
  h2 { font-size: var(--font-size-xl); }
  h3 { font-size: var(--font-size-lg); }

  .mt-container {
    padding-inline: var(--space-md);
  }

  .mt-intro {
    padding-top: var(--space-2xl);
  }

  .mt-apps {
    padding-block: var(--space-2xl);
  }

  .mt-app {
    grid-template-columns: var(--size-2xl) minmax(0, 1fr);
    column-gap: var(--space-md);
  }

  .mt-app__icon {
    border-radius: var(--radius-xl);
  }
}

/* Stack the icon above the text when there isn't room for both side by side */
@media (max-width: 22em) {
  .mt-app {
    display: block;
  }

  .mt-app__icon {
    width: var(--size-2xl);
    margin-bottom: var(--space-sm);
  }
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
