/* =========================================
   HERITAGE RESTORER
   Main stylesheet
========================================= */

/* =========================================
   1. VARIABLES & RESET
========================================= */

:root {
  --ink: #29291f;
  --muted: #777365;

  --sand: #f4eee3;
  --paper: #fbf8f1;
  --paper-deep: #eee5d5;

  --line: #ded4c2;

  --terracotta: #a95f43;
  --terracotta-dark: #87472f;

  --gold: #b99556;
  --olive: #74785b;

  --shadow: 0 22px 70px rgba(67, 51, 30, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--sand);

  font:
    400 16px/1.7 "DM Sans",
    system-ui,
    sans-serif;

  background-image: radial-gradient(
    rgba(112, 88, 54, 0.055) 0.7px,
    transparent 0.7px
  );

  background-size: 7px 7px;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

button,
a,
input,
.drop {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
.drop:focus-visible {
  outline: 3px solid rgba(169, 95, 67, 0.55);
  outline-offset: 4px;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
}

button:disabled {
  opacity: 0.55;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
}

/* =========================================
   2. NAVIGATION
========================================= */

.topbar {
  height: 88px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid rgba(90, 76, 52, 0.16);

  position: relative;
  z-index: 2;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;

  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border: 1px solid var(--gold);
  border-radius: 50%;

  color: var(--terracotta);

  font-size: 24px;
  line-height: 1;
}

.brand-copy {
  display: grid;
  gap: 5px;

  line-height: 1.15;
}

.brand-copy strong {
  font:
    18px "Marcellus",
    Georgia,
    serif;

  letter-spacing: 0.12em;
}

.brand-copy small {
  color: var(--muted);

  font-size: 10px;
  letter-spacing: 0.17em;
}

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

.nav-link {
  color: #5f5b50;

  font-size: 14px;
  text-decoration: none;

  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--terracotta);
}

.language-toggle {
  padding: 9px 16px;

  border: 1px solid var(--line);
  border-radius: 99px;

  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);

  cursor: pointer;

  font-size: 14px;

  transition: 0.2s ease;
}

.language-toggle:hover {
  background: white;
  border-color: var(--gold);
  transform: translateY(-1px);
}

/* =========================================
   3. HERO SECTION
========================================= */

.hero {
  min-height: 530px;

  margin: 28px 0 0;
  padding: 70px clamp(28px, 7vw, 92px);

  position: relative;
  overflow: hidden;

  display: flex;
  align-items: center;

  background:
    linear-gradient(
      90deg,
      rgba(250, 246, 237, 0.96) 0%,
      rgba(250, 246, 237, 0.88) 40%,
      rgba(250, 246, 237, 0.18) 100%
    ),
    url("assets/heritage-ruins.png") center 48% / cover no-repeat;

  border: 1px solid rgba(129, 101, 62, 0.16);

  box-shadow: 0 18px 55px rgba(74, 54, 30, 0.08);

  animation: heroReveal 0.9s both;
}

.hero::after {
  content: "";

  position: absolute;
  inset: 16px;

  border: 1px solid rgba(255, 255, 255, 0.58);

  pointer-events: none;
}

.hero-copy {
  max-width: 610px;

  position: relative;
  z-index: 1;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;

  color: #8c7654;

  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.eyebrow > span:first-child {
  width: 26px;
  height: 1px;

  display: inline-block;

  background: var(--terracotta);
}

.eyebrow.dark {
  color: #8c7654;
}

.hero h1 {
  margin: 24px 0 18px;

  font:
    400 clamp(44px, 6.5vw, 78px)/1.08 "Marcellus",
    Georgia,
    serif;

  letter-spacing: -0.035em;
}

.hero h1 em {
  color: var(--terracotta);
  font-style: normal;
}

.hero-copy > p {
  max-width: 475px;
  margin: 0 0 28px;

  color: #6d685d;

  font-size: 17px;
  line-height: 1.8;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 34px;

  padding: 13px 18px;

  background: var(--terracotta);
  color: white;

  font-size: 12px;
  letter-spacing: 0.04em;

  text-decoration: none;

  transition:
    background 0.2s,
    transform 0.2s;
}

.primary-link:hover {
  background: var(--terracotta-dark);
  transform: translateY(-2px);
}

.hero-caption {
  position: absolute;

  left: clamp(28px, 7vw, 92px);
  bottom: 28px;

  z-index: 1;

  display: flex;
  align-items: center;
  gap: 10px;

  color: #726c5f;

  font-size: 11px;
  letter-spacing: 0.17em;
}

.caption-line {
  width: 28px;
  height: 1px;

  background: var(--gold);
}

.hero-index {
  position: absolute;

  right: 34px;
  bottom: 28px;

  z-index: 1;

  color: #74664f;

  font:
    13px "Marcellus",
    serif;
}

.hero-index span {
  padding: 0 5px;
  color: var(--gold);
}

/* =========================================
   4. STUDIO SECTION
========================================= */

.studio-section {
  padding: 86px 0 30px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;

  margin-bottom: 28px;
}

.section-heading h2,
.approach-heading h2 {
  margin: 10px 0 7px;

  font:
    400 clamp(30px, 4vw, 43px)/1.2 "Marcellus",
    Georgia,
    serif;
}

.section-heading p {
  margin: 0;

  color: var(--muted);

  font-size: 15px;
}

.section-number {
  padding-bottom: 5px;

  color: var(--terracotta);

  font:
    14px "Marcellus",
    serif;
}

.section-number span {
  color: var(--gold);
}

/* =========================================
   5. WORKSPACE CARD & TABS
========================================= */

.workspace-card {
  background: var(--paper);

  border: 1px solid #e2d8c8;

  box-shadow: var(--shadow);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;

  border-bottom: 1px solid var(--line);
}

.tab {
  min-width: 0;

  display: flex;
  align-items: center;
  gap: 15px;

  padding: 21px 25px;
  margin-bottom: -1px;

  border: 0;
  border-bottom: 3px solid transparent;

  background: transparent;
  color: #898273;

  text-align: left;

  cursor: pointer;

  transition:
    background 0.25s,
    color 0.25s,
    border-color 0.25s;
}

.tab + .tab {
  border-left: 1px solid var(--line);
}

.tab[aria-selected="true"] {
  background: #f5efe4;

  color: var(--ink);

  border-bottom-color: var(--terracotta);
}

.tab-icon {
  width: 39px;
  height: 39px;

  flex: 0 0 39px;

  display: grid;
  place-items: center;

  border: 1px solid #d9cbb5;
  border-radius: 50%;

  color: var(--terracotta);
}

.tab-icon svg {
  width: 22px;
  height: 22px;

  display: block;
}

.tab-text {
  display: grid;
  gap: 3px;
}

.tab-text strong {
  font:
    400 18px "Marcellus",
    Georgia,
    serif;
}

.tab-text small {
  color: #8b8578;

  font-size: 13px;
  line-height: 1.5;
}

/* =========================================
   6. WORKSPACE PANEL
========================================= */

.panel {
  padding: 32px clamp(18px, 4vw, 48px) 40px;
}

.panel-intro,
.editor-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;

  margin-bottom: 19px;
}

.step-label {
  color: var(--terracotta);

  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.panel h3,
.editor-heading h3 {
  margin: 4px 0 0;

  font:
    400 23px "Marcellus",
    Georgia,
    serif;
}

.note {
  max-width: 390px;
  margin: 0;

  color: #827b6d;

  font-size: 14px;
  text-align: end;
}

/* =========================================
   7. IMAGE UPLOAD AREA
========================================= */

.drop {
  min-height: 210px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;

  border: 1px dashed #c9b99e;

  background: linear-gradient(
    135deg,
    rgba(239, 229, 211, 0.36),
    rgba(255, 255, 255, 0.7)
  );

  color: #756e60;

  cursor: pointer;

  transition:
    border 0.25s,
    background 0.25s,
    transform 0.25s;
}

.drop:hover,
.drop.over {
  border-color: var(--terracotta);

  background: #f4eade;

  transform: translateY(-2px);
}

.drop:focus-visible {
  border-color: var(--terracotta);

  outline: 3px solid rgba(169, 95, 67, 0.55);
  outline-offset: 4px;
}

.upload-symbol {
  width: 37px;
  height: 37px;

  display: grid;
  place-items: center;

  margin-bottom: 5px;

  border-radius: 50%;

  background: #eee3d1;
  color: var(--terracotta);

  font-size: 22px;
}

.drop strong {
  color: var(--ink);

  font:
    400 19px "Marcellus",
    Georgia,
    serif;
}

.drop > span:not(.upload-symbol) {
  font-size: 14px;
}

.drop small {
  margin-top: 8px;

  color: #9a9283;

  font-size: 12px;
  letter-spacing: 0.06em;
}

/* =========================================
   8. EDITOR & RESTORATION TOOLS
========================================= */

.editor-heading {
  margin: 30px 0 17px;
}

.editor-hint {
  color: #898273;

  font-size: 14px;
}

.tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;

  margin: 0 0 16px;
  padding: 13px 15px;

  background: #f3ede3;
}

.brush-label {
  color: #615d52;

  font-size: 14px;
}

.tools input[type="range"] {
  width: 130px;

  accent-color: var(--terracotta);
}

.tool-tip {
  color: #898273;

  font-size: 14px;
}

/* =========================================
   9. BUTTONS
========================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;

  border: 0;

  cursor: pointer;
  text-decoration: none;

  transition:
    transform 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.55;

  cursor: not-allowed;

  transform: none;
}

.btn.subtle {
  padding: 8px 12px;

  border: 1px solid #d5c7b1;

  background: transparent;
  color: #655e50;

  font-size: 14px;
}

.btn.subtle:hover {
  background: white;
}

.btn.primary {
  padding: 13px 19px;

  background: var(--terracotta);
  color: white;

  font-size: 14px;
  letter-spacing: 0.04em;
}

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

  box-shadow: 0 7px 18px rgba(135, 71, 47, 0.16);
}

/* =========================================
   10. IMAGE CANVAS
========================================= */

.stage-wrap {
  overflow: auto;

  padding: 14px;

  background: #e8dfd1;

  text-align: center;
}

.stage {
  position: relative;

  display: inline-block;

  max-width: 100%;

  line-height: 0;
  touch-action: none;
}

.stage canvas {
  display: block;

  max-width: 100%;
  height: auto;
}

#paint {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  cursor: crosshair;
}

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

  margin-top: 18px;
}

.run-caption {
  color: #898273;

  font-size: 14px;
}

/* =========================================
   11. PROCESSING STATUS
========================================= */

.status {
  display: none;
  align-items: center;
  gap: 15px;

  margin: 20px 0;
  padding: 16px;

  background: #f1eadf;

  border-left: 3px solid var(--gold);
}

.status.on {
  display: flex;

  animation: fadeUp 0.3s both;
}

.status strong {
  font:
    400 17px "Marcellus",
    Georgia,
    serif;
}

.status p {
  margin: 2px 0 0;

  color: #817969;

  font-size: 14px;
}

.spin {
  width: 24px;
  height: 24px;

  flex: 0 0 24px;

  border: 2px solid #d8cbb6;
  border-top-color: var(--terracotta);

  border-radius: 50%;

  animation: spin 1s linear infinite;
}

/* =========================================
   12. ERROR MESSAGE
========================================= */

.error {
  display: none;

  margin: 16px 0;
  padding: 12px 15px;

  background: #f8e8e1;
  color: #8d3d2d;

  border-left: 3px solid #b45b43;

  font-size: 14px;
}

.error.on {
  display: block;

  animation: fadeUp 0.25s both;
}

/* =========================================
   13. RESULT & IMAGE COMPARISON
========================================= */

.result-section {
  padding-top: 8px;

  animation: fadeUp 0.45s both;
}

.cmp {
  position: relative;

  max-width: 100%;

  margin-top: 15px;

  overflow: hidden;

  background: #e6ddcf;

  line-height: 0;
  user-select: none;

  direction: ltr;
  isolation: isolate;
}

.cmp > img {
  display: block;

  width: 100%;
  height: auto;
}

.cmp .top {
  position: absolute;
  inset: 0;

  direction: ltr;

  clip-path: inset(0 50% 0 0);
}

.cmp .top img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: contain;
  object-position: left top;
}

.cmp .bar {
  position: absolute;

  top: 0;
  bottom: 0;
  left: 50%;

  width: 2px;

  background: #fff;

  box-shadow: 0 0 0 1px rgba(73, 54, 34, 0.2);

  pointer-events: none;
}

.cmp input {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  margin: 0;

  opacity: 0;

  cursor: ew-resize;

  direction: ltr;
  writing-mode: horizontal-tb;

  touch-action: pan-y;
}

.cmp input:focus-visible {
  outline: 3px solid rgba(185, 149, 86, 0.9);
  outline-offset: -4px;

  opacity: 0.04;
}

/* Comparison labels */

.tag {
  position: absolute;

  top: 13px;

  padding: 5px 10px;

  background: rgba(42, 39, 30, 0.78);
  color: white;

  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.06em;
}

.tag.l {
  left: 13px;
}

.tag.r {
  right: 13px;

  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Result warning */

.warn {
  margin-top: 15px;
  padding: 13px 15px;

  background: #f3eddf;

  border-left: 3px solid var(--gold);

  color: #756d5d;

  font-size: 14px;
}

/* Download row */

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

  margin-top: 16px;
}

.download-row p {
  margin: 0;

  color: #8a8376;

  font-size: 14px;
}

/* =========================================
   14. APPROACH SECTION
========================================= */

.approach-section {
  padding: 88px 0 75px;
}

.approach-heading {
  margin-bottom: 25px;
}

.approach-heading h2 {
  margin-bottom: 0;
}

.approach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);

  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.approach-item {
  min-height: 175px;

  position: relative;

  display: flex;
  gap: 18px;

  padding: 25px 22px 27px 0;
}

.approach-item + .approach-item {
  padding-left: 22px;

  border-left: 1px solid var(--line);
}

.approach-no {
  color: var(--terracotta);

  font:
    13px "Marcellus",
    Georgia,
    serif;
}

.approach-item h3 {
  margin: 0 0 8px;

  font:
    400 18px "Marcellus",
    Georgia,
    serif;
}

.approach-item p {
  max-width: 270px;
  margin: 0;

  color: #827b6d;

  font-size: 14px;
  line-height: 1.8;
}

.approach-icon {
  position: absolute;

  right: 18px;
  bottom: 18px;

  color: #c4ad86;

  font-size: 18px;
}

/* =========================================
   15. FOOTER
========================================= */

.footer {
  min-height: 110px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1.2fr);

  align-items: end;
  gap: 36px;

  padding: 30px 0;

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

.footer-branding {
  min-width: 0;

  align-self: end;

  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 15px;
}

.footer-brand .brand-mark {
  width: 34px;
  height: 34px;

  font-size: 19px;
}

.footer-brand .brand-copy strong {
  font-size: 14px;
}

.footer-brand .brand-copy small {
  font-size: 10px;
}

.footer-description {
  max-width: 390px;
  margin: 0;

  color: #777164;

  font-size: 12px;
  line-height: 1.8;
}

.footer-team {
  min-width: 0;

  padding: 2px 0 0 24px;

  border-left: 1px solid var(--line);

  direction: ltr;
  text-align: left;
}

.footer-made {
  margin: 0 0 3px;

  color: var(--terracotta);

  font-size: 12px;
  letter-spacing: 0.04em;
}

.footer-team h2 {
  margin: 0 0 14px;

  color: var(--ink);

  font:
    400 20px/1.3 "Marcellus",
    Georgia,
    serif;
}

.team-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 16px;

  margin: 0;
  padding: 0;

  list-style: none;
}

.team-list li {
  min-width: 0;

  position: relative;

  padding-left: 13px;

  color: #716b5d;

  font-size: 13px;
  line-height: 1.55;

  overflow-wrap: anywhere;
}

.team-list li::before {
  content: "";

  position: absolute;

  top: 0.65em;
  left: 0;

  width: 5px;
  height: 5px;

  border-radius: 50%;

  background: var(--gold);
}

/* =========================================
   16. ARABIC / RTL SUPPORT
========================================= */

.rtl {
  font-family: "Noto Sans Arabic", "DM Sans", sans-serif;
}

.rtl .brand-copy strong,
.rtl h1,
.rtl h2,
.rtl h3,
.rtl .tab-text strong,
.rtl .drop strong,
.rtl .status strong {
  font-family: "Noto Sans Arabic", sans-serif;

  letter-spacing: 0;
}

.rtl .eyebrow {
  letter-spacing: 0;
  flex-direction: row;
}

.rtl .hero {
  background-image:
    linear-gradient(
      270deg,
      rgba(250, 246, 237, 0.96) 0%,
      rgba(250, 246, 237, 0.88) 40%,
      rgba(250, 246, 237, 0.18) 100%
    ),
    url("assets/heritage-ruins.png");
}

.rtl .hero-caption {
  left: auto;
  right: clamp(28px, 7vw, 92px);
}

.rtl .hero-index {
  right: auto;
  left: 34px;
}

.rtl .hero-copy,
.rtl .panel,
.rtl .section-heading,
.rtl .approach-section {
  text-align: right;
}

.rtl .note {
  text-align: start;
}

.rtl .tab {
  text-align: right;
}

.rtl .tab + .tab {
  border-left: 0;
  border-right: 1px solid var(--line);
}

.rtl .status,
.rtl .warn,
.rtl .error {
  border-left: 0;
  border-right: 3px solid var(--gold);
}

.rtl .error {
  border-right-color: #b45b43;
}

.rtl .approach-item {
  padding: 25px 0 27px 22px;
}

.rtl .approach-item + .approach-item {
  border-left: 0;
  border-right: 1px solid var(--line);

  padding-right: 22px;
  padding-left: 0;
}

.rtl .approach-icon {
  right: auto;
  left: 18px;
}

.rtl .run-row,
.rtl .download-row {
  flex-direction: row-reverse;
}

.rtl .btn {
  flex-direction: row-reverse;
}

/* Footer remains deliberately LTR for team names */

.rtl .footer-description {
  text-align: right;
}

.rtl .footer-team {
  direction: ltr;
  text-align: left;

  border-left: 0;
  border-right: 1px solid var(--line);

  padding: 2px 24px 0 0;
}

.rtl .footer-team .footer-made,
.rtl .footer-team h2 {
  direction: rtl;
  text-align: right;
}

/* =========================================
   17. BRUSH RANGE SLIDER
========================================= */

#brush {
  width: 160px;
  max-width: 100%;
  height: 7px;

  margin: 0 3px;

  appearance: none;
  -webkit-appearance: none;

  border: 0;
  border-radius: 999px;

  background: #dfd3c1;

  cursor: pointer;

  direction: ltr;
  vertical-align: middle;
}

#brush::-webkit-slider-runnable-track {
  height: 7px;

  border-radius: 999px;

  background: #dfd3c1;
}

#brush::-moz-range-track {
  height: 7px;

  border-radius: 999px;

  background: #dfd3c1;
}

#brush::-webkit-slider-thumb {
  width: 19px;
  height: 19px;

  margin-top: -6px;

  appearance: none;
  -webkit-appearance: none;

  border: 3px solid var(--paper);
  border-radius: 50%;

  background: var(--terracotta);

  box-shadow: 0 1px 5px rgba(64, 45, 27, 0.28);

  transition:
    transform 0.18s ease,
    background 0.18s ease;
}

#brush::-moz-range-thumb {
  width: 14px;
  height: 14px;

  border: 3px solid var(--paper);
  border-radius: 50%;

  background: var(--terracotta);

  box-shadow: 0 1px 5px rgba(64, 45, 27, 0.28);

  transition:
    transform 0.18s ease,
    background 0.18s ease;
}

#brush:hover::-webkit-slider-thumb {
  transform: scale(1.12);
  background: var(--terracotta-dark);
}

#brush:hover::-moz-range-thumb {
  transform: scale(1.12);
  background: var(--terracotta-dark);
}

#brush:focus-visible {
  outline: 3px solid rgba(169, 95, 67, 0.4);
  outline-offset: 5px;
}

/* =========================================
   18. ANIMATIONS
========================================= */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(9px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================
   19. TABLET RESPONSIVENESS
========================================= */

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 32px), 640px);
  }

  /* Navigation */

  .topbar {
    height: 74px;
  }

  .nav-actions {
    gap: 14px;
  }

  .nav-link {
    display: none;
  }

  /* Hero */

  .hero {
    min-height: 540px;

    padding: 55px 28px 90px;

    background-image:
      linear-gradient(
        180deg,
        rgba(250, 246, 237, 0.98) 0%,
        rgba(250, 246, 237, 0.91) 48%,
        rgba(250, 246, 237, 0.34) 100%
      ),
      url("assets/heritage-ruins.png");

    background-size: cover, cover;

    background-position: center, center;

    background-repeat: no-repeat, no-repeat;

    background-color: #e9dfcf;
  }

  .rtl .hero {
    background-image:
      linear-gradient(
        180deg,
        rgba(250, 246, 237, 0.98) 0%,
        rgba(250, 246, 237, 0.91) 48%,
        rgba(250, 246, 237, 0.34) 100%
      ),
      url("assets/heritage-ruins.png");

    background-size: cover, cover;

    background-position: center, center;

    background-repeat: no-repeat, no-repeat;
  }

  .hero h1 {
    font-size: clamp(42px, 10vw, 62px);
  }

  .hero-copy > p {
    max-width: 390px;
  }

  .hero-caption {
    left: 28px;
    right: 75px;
    bottom: 25px;

    font-size: 11px;
  }

  .hero-index {
    right: 25px;
    bottom: 24px;
  }

  .rtl .hero-caption {
    right: 28px;
    left: 75px;
  }

  .rtl .hero-index {
    left: 25px;
  }

  /* Studio */

  .studio-section {
    padding-top: 65px;
  }

  .panel {
    padding: 25px 18px 30px;
  }

  /* Tabs */

  .tabs .tab {
    gap: 10px;
    padding: 16px 14px;
  }

  .tab-icon {
    width: 32px;
    height: 32px;

    flex-basis: 32px;
  }

  .tab-text strong {
    font-size: 16px;
  }

  .tab-text small {
    font-size: 12px;
  }

  /* Approach */

  .approach-section {
    padding: 65px 0 55px;
  }

  .approach-grid {
    grid-template-columns: 1fr;
  }

  .approach-item,
  .rtl .approach-item {
    min-height: 0;

    padding: 21px 30px 21px 0;
  }

  .approach-item + .approach-item,
  .rtl .approach-item + .approach-item {
    padding: 21px 30px 21px 0;

    border-left: 0;
    border-right: 0;

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

  .approach-item p {
    max-width: 520px;
  }

  .approach-icon {
    bottom: 20px;
  }

  /* Footer */

  .footer {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);

    align-items: end;
    gap: 22px;
  }

  .footer-branding {
    grid-column: 1;
    grid-row: 1;
  }

  .footer-team {
    grid-column: 2;
    grid-row: 1;
  }
}

/* =========================================
   20. MOBILE RESPONSIVENESS
========================================= */

@media (max-width: 480px) {
  .page-shell {
    width: calc(100% - 24px);
  }

  /* Navigation */

  .brand-mark {
    width: 36px;
    height: 36px;

    font-size: 21px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .brand-copy small {
    font-size: 10px;
  }

  .language-toggle {
    padding: 8px 11px;
  }

  /* Hero */

  .hero {
    min-height: 530px;

    margin-top: 12px;

    padding: 44px 20px 105px;

    background-position:
      center,
      center bottom;
  }

  .hero::after {
    inset: 9px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero-copy > p {
    font-size: 15px;
  }

  .hero-caption {
    left: 20px;
    bottom: 20px;

    max-width: 220px;

    font-size: 11px;
    line-height: 1.5;
  }

  .hero-index {
    right: 18px;
    bottom: 20px;
  }

  .rtl .hero-caption {
    right: 20px;
    left: 65px;
  }

  .rtl .hero-index {
    left: 18px;
  }

  /* Section headings */

  .section-heading {
    align-items: start;
  }

  .section-heading h2,
  .approach-heading h2 {
    font-size: 31px;
  }

  .section-heading p {
    max-width: 290px;

    font-size: 11px;
  }

  .section-number {
    display: none;
  }

  /* Tabs */

  .tabs .tab {
    gap: 8px;
    padding: 13px 10px;
  }

  .tab-icon {
    width: 32px;
    height: 32px;

    flex-basis: 32px;
  }

  .tab-icon svg {
    width: 19px;
    height: 19px;
  }

  .tab-text small {
    max-width: 120px;
    font-size: 12px;
  }

  /* Workspace */

  .panel-intro,
  .editor-heading {
    align-items: start;
    flex-direction: column;
    gap: 7px;
  }

  .note {
    text-align: start;
  }

  .drop {
    min-height: 185px;
  }

  /* Tools */

  .tools {
    align-items: center;
    gap: 9px;
  }

  .tool-tip {
    flex-basis: 100%;
  }

  #brush {
    flex: 1 1 125px;
    width: auto;
  }

  /* Buttons and download */

  .run-row,
  .download-row,
  .rtl .run-row,
  .rtl .download-row {
    align-items: stretch;
    flex-direction: column;
  }

  .run-row .btn,
  .download-row .btn {
    width: 100%;
  }

  /* Comparison */

  .cmp .tag {
    top: 7px;

    font-size: 8px;
  }

  .cmp .tag.l {
    left: 7px;
  }

  .cmp .tag.r {
    right: 7px;
  }

  /* Footer */

  .footer {
    grid-template-columns: 1fr;

    align-items: start;
    gap: 18px;
  }

  .footer-branding,
  .footer-team {
    grid-column: 1;
    grid-row: auto;
  }

  .footer-team,
  .rtl .footer-team {
    padding: 18px 0 0;

    border-left: 0;
    border-right: 0;

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

  .team-list {
    gap: 8px 12px;
  }

  .team-list li {
    font-size: 12px;
  }
}

/* =========================================
   21. SMALL MOBILE DEVICES
========================================= */

@media (max-width: 360px) {
  .page-shell {
    width: calc(100% - 20px);
  }

  .hero {
    padding-left: 17px;
    padding-right: 17px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .tabs .tab {
    padding-left: 8px;
    padding-right: 8px;
  }

  .footer-team h2 {
    font-size: 18px;
  }

  .team-list {
    column-gap: 8px;
  }

  .team-list li {
    font-size: 12px;
  }
}

/* =========================================
   22. REDUCED MOTION ACCESSIBILITY
========================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;

    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;
  }
}
