/* ==========================================================================
   ResidencyKRD — website design system

   Light only, pure white. Structure is carried by a hairline grid and
   typography rather than shadows and gradients: this is a compliance-facing
   product for academic hospitals, and it should read as an institution's
   system of record, not as a SaaS template.

   The only borrowed cues from the mobile app are the brand blue and the pill
   buttons; everything else here is tuned for reading at desk width.
   ========================================================================== */

:root {
  /* Brand */
  --brand: #056dff;
  --brand-dark: #0453c7;
  --brand-wash: #f2f7ff;

  /* Ink */
  --ink: #0a1020;
  --body: #3d4757;
  --muted: #6b7688;
  --faint: #98a1b1;

  /* Surface */
  --white: #ffffff;
  --paper: #fafbfd;
  --line: #e7eaf0;
  --line-strong: #d4dae5;

  /* Status */
  --ok: #0b7f72;
  --ok-wash: #e8f6f4;
  --warn: #a35a00;
  --warn-wash: #fdf2e3;

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --kurdish: 'Noto Kufi Arabic', 'Segoe UI', Tahoma, sans-serif;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;

  --container: 1180px;
  --gutter: 24px;

  color-scheme: light;
  font-family: var(--sans);
  color: var(--body);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv05' 1, 'ss01' 1;
}

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

body {
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
}

/* The footer pushes itself down with margin-top:auto, so the page itself is the
   flex column. Static pages have no wrapper element to carry this. */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Anchor links used to be handled by JS scrollIntoView; with real anchors the
   browser does it, and the padding keeps a target clear of the sticky header. */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

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

a {
  color: inherit;
}

::selection {
  background: var(--brand);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

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

h1,
h2,
h3,
h4,
h5 {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

/* Editorial accent — used on a phrase inside a heading, never a whole line. */
.accent {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.display {
  font-size: clamp(38px, 5.4vw, 62px);
}

.section-title {
  font-size: clamp(28px, 3.4vw, 40px);
}

/* Small caps label above a section title. Tracked wide so it reads as a tag. */
.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

.lede {
  font-size: 17px;
  color: var(--muted);
  max-width: 58ch;
}

/* Digits align in columns — worth the extra declaration on anything numeric. */
.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: 96px 0;
}

.section--tight {
  padding: 64px 0;
}

/* Hairlines carry the structure. A rule above a section beats a shadow around it. */
.section--ruled {
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 720px;
  margin-bottom: 56px;
}

.section-head .eyebrow {
  margin-bottom: 14px;
}

.section-head .lede {
  margin-top: 16px;
}

/* --------------------------------------------------------------------------
   Brand mark
   -------------------------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: none;
}

.brand-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  white-space: nowrap;
}

.brand-name b {
  font-weight: 600;
  color: var(--brand);
}

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

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
}

.nav-link {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* --------------------------------------------------------------------------
   Header actions — the language toggle
   -------------------------------------------------------------------------- */

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding-inline: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--white);
  color: var(--body);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.lang-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.lang-btn svg {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   Buttons — pills, borrowed from the mobile app
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease,
    transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn:active {
  transform: scale(0.985);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-secondary {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  border-color: var(--ink);
}

.btn-sm {
  padding: 10px 18px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

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

.hero {
  padding: 88px 0 72px;
  position: relative;
  overflow: hidden;
}

/* A faint blueprint grid — visible enough to feel engineered, quiet enough to ignore. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(120% 90% at 78% 22%, #000 0%, transparent 68%);
  mask-image: radial-gradient(120% 90% at 78% 22%, #000 0%, transparent 68%);
  opacity: 0.7;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 64px;
  align-items: center;
}

.hero-flag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-block: 6px;
  padding-inline: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  color: var(--body);
  margin-bottom: 26px;
}

/* Scoped to the tag rather than any span: the flag also carries a plain span
   for the region name, which must not pick up the pill. */
.hero-flag .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand-wash);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero p.lede {
  margin-top: 22px;
  font-size: 18px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.hero-foot {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 13px;
  color: var(--faint);
}

.hero-foot strong {
  color: var(--body);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Product surface — a real UI panel, no browser chrome or traffic lights
   -------------------------------------------------------------------------- */

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -34px rgba(11, 30, 61, 0.24);
  overflow: hidden;
}

.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.panel-bar-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.panel-body {
  padding: 20px;
}

.panel-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chip-ok {
  background: var(--ok-wash);
  color: var(--ok);
}

.chip-wait {
  background: var(--warn-wash);
  color: var(--warn);
}

.chip-idle {
  background: #f1f3f7;
  color: var(--muted);
}

.field {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
}

.field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.field-value {
  margin-top: 5px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
}

.field-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.meter {
  height: 5px;
  border-radius: 999px;
  background: #eef1f6;
  overflow: hidden;
  margin-top: 10px;
}

.meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
}

.panel-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

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

/* --------------------------------------------------------------------------
   Directorate strip
   -------------------------------------------------------------------------- */

.strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 32px;
  /* Shares the element with .container, so the gutter has to be repeated here. */
  padding: 20px var(--gutter);
}

.strip-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-inline-end: 4px;
}

.strip-item {
  font-size: 15px;
  font-weight: 500;
  color: var(--body);
}

/* --------------------------------------------------------------------------
   Figures
   -------------------------------------------------------------------------- */

.figures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.figure {
  padding-block: 6px;
  padding-inline: 28px;
  border-inline-start: 1px solid var(--line);
}

.figure:first-child {
  padding-inline-start: 0;
  border-inline-start: 0;
}

.figure-value {
  font-size: clamp(30px, 3.6vw, 42px);
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--ink);
  line-height: 1;
}

.figure-label {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Feature index — a numbered list, not a grid of identical cards
   -------------------------------------------------------------------------- */

.index {
  border-top: 1px solid var(--line);
}

.index-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 320px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.index-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.04em;
  padding-top: 4px;
}

.index-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.index-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--brand-wash);
  color: var(--brand);
}

.index-icon svg {
  width: 18px;
  height: 18px;
}

.index-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.index-body {
  color: var(--muted);
  padding-top: 5px;
}

/* --------------------------------------------------------------------------
   Showcase
   -------------------------------------------------------------------------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 12px 4px;
  margin-inline-end: 26px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  color: var(--ink);
  border-bottom-color: var(--brand);
}

.app {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 430px;
}

.app-side {
  border-inline-end: 1px solid var(--line);
  background: var(--paper);
  padding: 18px 14px;
}

.app-side-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 8px 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.app-side-brand img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.app-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-menu li {
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.app-menu li.active {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
}

.app-main {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.app-title {
  font-size: 17px;
  font-weight: 600;
}

.app-sub {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--muted);
}

.app-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.timeline-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.timeline-rail {
  width: 3px;
  border-radius: 999px;
  background: var(--line-strong);
  flex: none;
}

.timeline-item.current .timeline-rail {
  background: var(--brand);
}

.timeline-body {
  flex: 1;
  min-width: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th {
  text-align: start;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
}

.table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table td:first-child {
  color: var(--ink);
  font-weight: 500;
}

/* Month grid — the signature admin view, so it gets its own layout. */
.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cal-head {
  padding: 8px 10px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.cal-day {
  min-height: 62px;
  padding: 7px 8px;
  border-inline-end: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* Logical, so the seventh cell loses the border on whichever side ends the row. */
.cal-day:nth-child(7n) {
  border-inline-end: 0;
}

.cal-day:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.cal-date {
  font-size: 11px;
  color: var(--faint);
}

.cal-spot {
  margin-top: 5px;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--brand-wash);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.cal-spot.alt {
  background: #f1f3f7;
  color: var(--muted);
}

.cal-spot.swapped {
  background: var(--warn-wash);
  color: var(--warn);
}

/* Two surfaces — website for admins, app for residents */
.surfaces {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.surface {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.surface-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.surface-head svg {
  width: 20px;
  height: 20px;
  color: var(--brand);
}

.surface-who {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.surface-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.surface-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.surface-list li {
  display: flex;
  gap: 11px;
  font-size: 15px;
  color: var(--body);
}

.surface-list svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 4px;
  color: var(--brand);
}

/* --------------------------------------------------------------------------
   Quote
   -------------------------------------------------------------------------- */

.quote-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 56px;
  align-items: end;
}

.quote {
  font-size: clamp(22px, 2.7vw, 31px);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 400;
  text-wrap: pretty;
}

.quote em {
  font-family: var(--serif);
  font-style: italic;
}

.quote-by {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.monogram {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--brand-wash);
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.quote-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.quote-role {
  font-size: 13px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Forms — used by the deletion request pages
   -------------------------------------------------------------------------- */

.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: 0 24px 60px -38px rgba(11, 30, 61, 0.28);
}

.form-title {
  font-size: 19px;
  font-weight: 600;
}

.form-note {
  margin: 6px 0 22px;
  font-size: 14px;
  color: var(--muted);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--white);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control::placeholder {
  color: var(--faint);
}

.form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(5, 109, 255, 0.14);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7688' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-inline-end: 40px;
}

/* background-position has no logical form, so the chevron is moved by hand. */
html[dir="rtl"] select.form-control {
  background-position: left 14px center;
}

.form-done {
  text-align: center;
  padding: 26px 4px;
}

.form-done svg {
  width: 42px;
  height: 42px;
  color: var(--ok);
  margin: 0 auto 16px;
}

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

.footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 64px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 44px;
}

.footer-about {
  margin-top: 16px;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 34ch;
}

.footer h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.footer-link {
  font-size: 14.5px;
  color: var(--body);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--brand);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   Legal pages
   -------------------------------------------------------------------------- */

.legal-head {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--line);
}

.legal-title {
  font-size: clamp(32px, 4vw, 46px);
}

.legal-meta {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--faint);
}

.legal-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 64px;
  /* Shares the element with .container, so the gutter has to be repeated here. */
  padding: 52px var(--gutter) 96px;
}

.legal-toc {
  position: sticky;
  top: 96px;
  align-self: start;
}

.legal-toc h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}

.legal-toc ul {
  list-style: none;
  border-inline-start: 1px solid var(--line);
}

.legal-toc a {
  display: block;
  padding-block: 8px;
  padding-inline: 16px 0;
  margin-inline-start: -1px;
  border-inline-start: 2px solid transparent;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.legal-toc a:hover {
  color: var(--ink);
}

.legal-toc li.active a {
  color: var(--ink);
  border-inline-start-color: var(--brand);
  font-weight: 500;
}

.legal-content {
  max-width: 68ch;
}

.legal-content section {
  padding-bottom: 36px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--line);
}

.legal-content section:last-child {
  border-bottom: 0;
}

.legal-content h2 {
  font-size: 22px;
  margin-bottom: 14px;
  scroll-margin-top: 100px;
}

.legal-content p {
  margin-bottom: 14px;
}

.legal-content ul {
  margin: 0 0 14px;
  padding-inline-start: 20px;
}

.legal-content li {
  margin-bottom: 8px;
}

.legal-note {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand-wash);
  font-size: 14.5px;
  color: var(--body);
  margin-bottom: 40px;
}

/* --------------------------------------------------------------------------
   Deep link fallback (/app/*)
   -------------------------------------------------------------------------- */

.applink {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 72px 20px;
  text-align: center;
}

.applink-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -38px rgba(11, 30, 61, 0.28);
}

.applink-card .brand {
  justify-content: center;
  margin-bottom: 26px;
}

.applink-card .eyebrow {
  margin-bottom: 10px;
}

.applink-title {
  font-size: 27px;
}

.applink-lede {
  margin-top: 12px;
  color: var(--muted);
}

.applink-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

.applink-note {
  margin-top: 26px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: var(--muted);
}

.applink-hint {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--faint);
}

.applink-back {
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
}

.applink-back:hover {
  color: var(--brand);
}

/* --------------------------------------------------------------------------
   Kurdish (Sorani), right to left

   The layout itself needs no mirroring — it is built from logical properties,
   so dir="rtl" flips it. What does need undoing is the Latin typographic
   detailing: Arabic script has no case, so uppercasing does nothing, and the
   tight tracking that suits Inter pulls joined letterforms apart.
   -------------------------------------------------------------------------- */

html[dir="rtl"] body {
  font-family: var(--kurdish);
  line-height: 1.9;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] .display,
html[dir="rtl"] .section-title,
html[dir="rtl"] .legal-title,
html[dir="rtl"] .applink-title,
html[dir="rtl"] .brand-name,
html[dir="rtl"] .figure-value {
  letter-spacing: 0;
  line-height: 1.45;
}

/* Every small-caps label in the system. Uppercase is a no-op on Arabic script
   and the tracking breaks the joins, so both come off. */
html[dir="rtl"] .eyebrow,
html[dir="rtl"] .strip-label,
html[dir="rtl"] .field-label,
html[dir="rtl"] .surface-who,
html[dir="rtl"] .footer h4,
html[dir="rtl"] .legal-toc h4,
html[dir="rtl"] .table th,
html[dir="rtl"] .cal-head,
html[dir="rtl"] .deletion-reference,
html[dir="rtl"] .hero-flag .tag {
  text-transform: none;
  letter-spacing: 0;
}

/* The editorial italic is a Latin serif; Arabic has no italic, and Newsreader
   has no Arabic coverage, so the accent reverts to the body face. */
html[dir="rtl"] .accent,
html[dir="rtl"] .quote em {
  font-family: inherit;
  font-style: normal;
  font-weight: 600;
  color: var(--brand);
}

/* The brand name is a Latin wordmark and stays as one, reading left to right
   inside the right-to-left header. */
html[dir="rtl"] .brand-name {
  direction: ltr;
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.rise {
  animation: rise 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1040px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .quote-grid,
  .surfaces {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .legal-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .legal-toc {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  .app {
    /* minmax(0, …) rather than 1fr: an auto-minimum track would grow to fit the
       month grid instead of letting it scroll. */
    grid-template-columns: minmax(0, 1fr);
  }

  .app-side {
    border-inline-end: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-menu {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .section {
    padding: 68px 0;
  }

  .nav-list {
    display: none;
  }

  .header .btn {
    padding: 10px 16px;
    font-size: 13.5px;
  }

  /* The blueprint grid sits behind the hero copy at this width instead of beside it. */
  .hero::before {
    display: none;
  }

  .hero {
    padding: 56px 0 60px;
  }

  .hero-flag {
    font-size: 12.5px;
  }

  .figures {
    grid-template-columns: 1fr 1fr;
    gap: 26px 0;
  }

  .figure {
    padding-block: 0;
    padding-inline: 20px;
  }

  .figure:nth-child(odd) {
    padding-inline-start: 0;
    border-inline-start: 0;
  }

  .index-item {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 26px 0;
  }

  .index-num {
    padding-top: 0;
  }

  .app-cards,
  .panel-split {
    grid-template-columns: 1fr;
  }

  /* A seven-column month does not survive a phone; it scrolls sideways instead. */
  .cal {
    min-width: 520px;
  }

  /* min-width:0 lets this flex child shrink below the grid's min-content width —
     without it the panel just clips the last days of the week. */
  .cal-scroll {
    overflow-x: auto;
    min-width: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .form-card {
    padding: 24px 20px;
  }
}

/* --------------------------------------------------------------------------
   Deletion request pages (/delete-account, /delete-data)
   -------------------------------------------------------------------------- */

.deletion-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 64px;
  align-items: start;
  /* Shares the element with .container, so the gutter has to be repeated here. */
  padding: 52px var(--gutter) 96px;
}

.deletion-form {
  position: sticky;
  top: 96px;
}

.deletion-switch {
  margin-top: 8px;
  font-size: 14.5px;
}

.deletion-switch a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.deletion-switch a:hover {
  border-bottom-color: currentColor;
}

.deletion-reference {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.deletion-reference strong {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--body);
  word-break: break-all;
}

textarea.form-control {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}

.form-error {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #f3c9c9;
  border-inline-start: 3px solid #d92d39;
  border-radius: var(--radius-sm);
  background: #fdf1f1;
  font-size: 14px;
  color: #8f1f27;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 1040px) {
  .deletion-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .deletion-form {
    position: static;
  }
}
