:root {
  color-scheme: light;
  --motion-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-state: cubic-bezier(0.22, 0.61, 0.36, 1);
  --bg-page: #f6f8fc;
  --bg-surface: #ffffff;
  --bg-muted: #eef3f9;
  --text-primary: #10213d;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --primary: #1455d9;
  --primary-hover: #0f43ae;
  --accent: #087f61;
  --accent-soft: #ddf8ef;
  --chart-line: #1455d9;
  --shadow-color: rgba(15, 23, 42, 0.1);
  --danger: #b42332;
  --danger-soft: #fff1f2;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #090e1a;
  --bg-surface: #111a2c;
  --bg-muted: #17243a;
  --text-primary: #f3f7ff;
  --text-secondary: #a9b7cd;
  --border-color: #26354e;
  --primary: #8b5cf6;
  --primary-hover: #a78bfa;
  --accent: #22d3ee;
  --accent-soft: #123846;
  --chart-line: #22d3ee;
  --shadow-color: rgba(0, 0, 0, 0.35);
  --danger: #fda4af;
  --danger-soft: #3c202c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font:
    400 15px / 1.5 Inter,
    Arial,
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
p {
  margin-top: 0;
}

[hidden] {
  display: none !important;
}

html,
body,
.topbar,
.card,
.field select,
.amount-input-wrap,
.icon-button,
.language-toggle,
.primary-button,
.swap-button,
.danger-button,
.result-panel {
  transition:
    background-color 0.25s var(--motion-state),
    color 0.25s var(--motion-state),
    border-color 0.25s var(--motion-state),
    box-shadow 0.25s var(--motion-state);
}

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

.skip-link {
  position: fixed;
  z-index: 30;
  top: -50px;
  left: 12px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
}

.skip-link:focus {
  top: 10px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
  box-shadow: 0 5px 22px var(--shadow-color);
}

.topbar-inner {
  width: min(1240px, calc(100% - 48px));
  min-height: 76px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 38px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
  font-size: 1.03rem;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav a {
  padding: 9px 13px;
  border-radius: 9px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 650;
}

.nav a:hover,
.nav a.active {
  background: var(--bg-muted);
  color: var(--primary);
}

.external-link-icon {
  display: inline-block;
  margin-left: 2px;
  font-size: 0.78em;
  font-weight: 800;
  opacity: 0.78;
  transition:
    transform 0.18s var(--motion-state),
    opacity 0.18s var(--motion-state);
}

@media (hover: hover) and (pointer: fine) {
  .nav a[target="_blank"]:hover .external-link-icon {
    transform: translate(2px, -2px);
    opacity: 1;
  }
}

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

.icon-button {
  height: 39px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text-primary);
}

.language-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 39px;
  padding: 3px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-muted);
}

.language-option {
  display: grid;
  place-items: center;
  width: 30px;
  height: 31px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  line-height: 1;
  transition:
    background-color 0.18s var(--motion-state),
    color 0.18s var(--motion-state),
    box-shadow 0.18s var(--motion-state);
}

.language-option:hover {
  color: var(--text-primary);
}

.language-option[aria-pressed="true"] {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 4px var(--shadow-color);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  font-size: 1.3rem;
}

.icon-button:hover,
.language-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.sun-icon,
html[data-theme="dark"] .moon-icon {
  display: none;
}

html[data-theme="dark"] .sun-icon {
  display: block;
}

.menu-toggle {
  display: none;
}

.page {
  width: min(1180px, calc(100% - 48px));
  margin: 52px auto 70px;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  margin-bottom: 32px;
}

.eyebrow,
.section-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 14px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

h1 {
  margin-bottom: 11px;
  font-size: clamp(2.2rem, 4vw, 3.35rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.055em;
}

.page-subtitle {
  max-width: 700px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 22px;
  align-items: start;
}

.insights-column {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.card {
  min-width: 0;
  border: 1px solid var(--border-color);
  border-radius: 22px;
  background: var(--bg-surface);
  box-shadow: 0 12px 32px -16px var(--shadow-color);
}

.card:hover {
  box-shadow: 0 18px 38px -14px var(--shadow-color);
}

.converter-card {
  padding: 32px;
}

.card-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.card-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--bg-muted);
  color: var(--primary);
  font-size: 1.6rem;
}

.card-heading h2,
.rate-card h2,
.chart-card h2,
.recent-card h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.card-heading p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.converter-form {
  display: grid;
  gap: 21px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field label {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.field select,
.amount-input-wrap {
  width: 100%;
  height: 61px;
  border: 1px solid var(--border-color);
  border-radius: 13px;
  background: var(--bg-muted);
  color: var(--text-primary);
}

.field select {
  padding: 0 18px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  font-size: 0.89rem;
  font-weight: 750;
}

.amount-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}

.amount-input-wrap span {
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 800;
}

.amount-input-wrap input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.6rem;
  font-weight: 800;
}

.field select:focus-visible,
.amount-input-wrap:focus-within {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent);
}

.field-error {
  color: var(--danger);
  font-size: 0.78rem;
}

.currency-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
}

.swap-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 9px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--primary);
  font-size: 1.4rem;
  line-height: 1;
}

.swap-button:hover {
  background: var(--bg-muted);
  border-color: var(--primary);
}

.swap-button.spinning {
  transform: rotate(180deg);
  transition: transform 0.3s var(--motion-state);
}

.primary-button,
.primary-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  height: 54px;
  margin-top: 2px;
  box-shadow: 0 12px 24px -12px var(--primary);
}

.primary-button:hover,
.primary-link:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.primary-button:active,
.primary-link:active {
  transform: translateY(0);
}

.primary-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.primary-button:disabled:before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.primary-button span:last-child {
  font-size: 1.3rem;
}

.form-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: -5px 0 0;
  color: var(--text-secondary);
  font-size: 0.73rem;
}

.form-note .status-dot {
  width: 6px;
  height: 6px;
  box-shadow: none;
}

.alert {
  padding: 13px 16px;
  border-radius: 11px;
  font-size: 0.84rem;
}

.alert.error {
  margin-top: 22px;
  background: var(--danger-soft);
  color: var(--danger);
}

.alert.success {
  margin-bottom: 20px;
  background: var(--accent-soft);
  color: var(--accent);
}

.result-panel {
  margin-top: 27px;
  padding: 23px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-muted);
}

.result-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-label {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.copy-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--primary);
  font-size: 1rem;
}

.copy-button:hover {
  border-color: var(--primary);
}

.result-pair {
  margin: 8px 0 1px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.result-value {
  display: block;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

.result-original {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.result-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 17px;
  border-top: 1px solid var(--border-color);
}

.result-meta > span {
  display: grid;
  gap: 3px;
  color: var(--text-secondary);
  font-size: 0.73rem;
}

.result-meta strong {
  color: var(--text-primary);
  font-size: 0.81rem;
  overflow-wrap: anywhere;
}

.rate-card,
.chart-card,
.recent-card {
  padding: 25px 27px;
}

.rate-heading,
.chart-heading,
.recent-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.section-kicker {
  margin: 0 0 7px;
}

.chart-pair {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-weight: 700;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.live-badge .status-dot {
  width: 5px;
  height: 5px;
  box-shadow: none;
}

.pair-label {
  margin: 26px 0 1px;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 800;
}

.rate-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rate-equals {
  color: var(--text-secondary);
  font-size: 1.25rem;
  font-weight: 500;
}

.rate-line strong {
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1.2;
  letter-spacing: -0.05em;
}

.rate-change {
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 800;
}

.rate-change:empty {
  display: none;
}

.rate-reverse {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
}

.rate-reverse strong {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.rate-change.negative {
  background: var(--danger-soft);
  color: var(--danger);
}

.rate-caption {
  min-height: 1.4em;
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.range-selector {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: var(--bg-muted);
  white-space: nowrap;
}

.range-selector button {
  min-width: 34px;
  padding: 5px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 800;
}

.range-selector button:hover,
.range-selector button.selected {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: 0 2px 6px var(--shadow-color);
}

.chart-wrap {
  position: relative;
  height: 205px;
  margin-top: 18px;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-y-axis {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 1;
  width: 62px;
  color: var(--text-secondary);
  font-size: 0.67rem;
  pointer-events: none;
}

.chart-y-axis span {
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  white-space: nowrap;
}

.chart-y-axis span:nth-child(1) {
  top: 15.22%;
}

.chart-y-axis span:nth-child(2) {
  top: 45.65%;
}

.chart-y-axis span:nth-child(3) {
  top: 76.09%;
}

.chart-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 135px;
  padding: 9px 11px;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: var(--bg-surface);
  box-shadow: 0 8px 20px var(--shadow-color);
  font-size: 0.72rem;
  pointer-events: none;
}

.chart-tooltip strong {
  display: block;
  font-size: 0.82rem;
}

.chart-message,
.chart-skeleton {
  position: absolute;
  inset: 0;
  border-radius: 10px;
}

.chart-message {
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg-muted);
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.84rem;
}

.chart-skeleton {
  background: linear-gradient(
    100deg,
    var(--bg-muted) 25%,
    var(--bg-surface) 45%,
    var(--bg-muted) 65%
  );
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite;
}

.chart-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.chart-data {
  margin-top: 17px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.chart-data summary {
  width: max-content;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.chart-data summary:hover {
  text-decoration: underline;
}

.chart-data-scroll {
  max-height: 240px;
  margin-top: 11px;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: 9px;
}

.chart-data table {
  width: 100%;
  border-collapse: collapse;
}

.chart-data th,
.chart-data td {
  padding: 8px 11px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.73rem;
  text-align: left;
}

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

.chart-data th {
  position: sticky;
  top: 0;
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.chart-data td:last-child {
  font-weight: 700;
}

.text-link {
  padding-top: 17px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.text-link:hover {
  text-decoration: underline;
}

.recent-list {
  margin-top: 17px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
}

.recent-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-muted);
  color: var(--primary);
  font-weight: 800;
}

.recent-description {
  display: grid;
  min-width: 0;
}

.recent-description strong,
.recent-value {
  font-size: 0.8rem;
}

.recent-description span {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.recent-value {
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.recent-empty {
  text-align: center;
  padding: 17px 0 2px;
  color: var(--text-secondary);
  font-size: 0.83rem;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 15px;
  background: var(--bg-muted);
  color: var(--primary);
  font-size: 1.6rem;
}

.disclaimer {
  margin: 24px 0 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 17px;
  border-radius: 11px;
  background: var(--text-primary);
  color: var(--bg-surface);
  box-shadow: 0 12px 30px var(--shadow-color);
  font-size: 0.84rem;
}

.history-page {
  margin-top: 58px;
}

.history-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 29px;
}

.history-header h1 {
  margin-bottom: 9px;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 17px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--danger);
  font-size: 0.81rem;
  font-weight: 800;
  white-space: nowrap;
}

.danger-button:hover:not(:disabled) {
  background: var(--danger-soft);
}

.danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.danger-button[aria-busy="true"] {
  cursor: wait;
}

.danger-button[aria-busy="true"]:before {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.history-card {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

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

th {
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  font-size: 0.82rem;
}

.history-rate small {
  display: block;
  color: var(--text-secondary);
  font-size: 0.69rem;
}

.pair-pill {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.history-result {
  font-weight: 800;
}

.empty-state {
  text-align: center;
  padding: 66px 24px;
}

.empty-state h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.89rem;
}

.primary-link {
  margin-top: 9px;
  padding: 11px 16px;
  font-size: 0.84rem;
}

.about-page {
  max-width: 1040px;
}

.about-intro {
  margin-bottom: 30px;
}

.about-intro .page-subtitle {
  max-width: 590px;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 22px;
  align-items: stretch;
}

.about-tilt-card {
  --tilt-rotation-x: 0deg;
  --tilt-rotation-y: 0deg;
  --tilt-scale: 1;
  --tilt-spot-x: 50%;
  --tilt-spot-y: 50%;
  --tilt-spotlight-color: rgba(20, 85, 217, 0.14);

  position: relative;
  transform: perspective(var(--tilt-perspective, 1200px)) rotateX(var(--tilt-rotation-x))
    rotateY(var(--tilt-rotation-y)) scale(var(--tilt-scale));
  transform-style: preserve-3d;
  transition:
    transform 420ms var(--motion-enter),
    box-shadow 240ms var(--motion-state);
}

.about-tilt-card::before {
  position: absolute;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--tilt-spot-x) var(--tilt-spot-y),
    var(--tilt-spotlight-color),
    transparent 52%
  );
  content: "";
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--motion-state);
}

.about-tilt-card > * {
  position: relative;
  z-index: 1;
}

.about-tilt-card[data-tilt-active="true"] {
  z-index: 2;
  box-shadow: 0 22px 48px -18px var(--shadow-color);
  transition-duration: 100ms, 220ms;
  will-change: transform;
}

.about-tilt-card[data-tilt-active="true"]::before {
  opacity: 1;
}

html[data-theme="dark"] .about-tilt-card {
  --tilt-spotlight-color: rgba(34, 211, 238, 0.17);
}

.about-profile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 390px;
  padding: 38px;
  background: radial-gradient(circle at 100% 0%, var(--bg-muted), var(--bg-surface) 58%);
}

.about-avatar-button {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 18px;
  margin-bottom: 27px;
  background: transparent;
  cursor: zoom-in;
  box-shadow: 0 12px 24px -17px var(--shadow-color);
  transition:
    transform 0.2s var(--motion-state),
    box-shadow 0.2s var(--motion-state);
}

.about-avatar-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -16px var(--shadow-color);
}

.about-avatar {
  width: 120px;
  height: 154px;
  display: block;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  object-fit: cover;
  object-position: center 22%;
}

.photo-zoom-icon {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(16, 33, 61, 0.82);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  pointer-events: none;
}

.creator-links {
  display: grid;
  width: 100%;
  gap: 8px;
  margin-top: 18px;
}

.portfolio-status {
  color: var(--text-secondary);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.portfolio-cta {
  display: flex;
  width: 100%;
  min-height: 54px;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 17px;
  border: 1px solid var(--primary);
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 0.91rem;
  font-weight: 800;
  box-shadow: 0 12px 24px -16px var(--primary);
  transition:
    background-color 0.18s var(--motion-state),
    transform 0.18s var(--motion-state),
    box-shadow 0.18s var(--motion-state);
}

.portfolio-cta:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 15px 25px -16px var(--primary);
}

.portfolio-cta span:last-child {
  font-size: 1.2rem;
}

html[data-theme="dark"] .portfolio-cta {
  color: #090e1a;
}

.photo-dialog {
  position: relative;
  width: max-content;
  max-width: 92vw;
  max-height: 92vh;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.18s var(--motion-enter),
    transform 0.18s var(--motion-enter),
    display 0.18s allow-discrete,
    overlay 0.18s allow-discrete;
}

.photo-dialog[open] {
  opacity: 1;
  transform: translateY(0);
}

@starting-style {
  .photo-dialog[open] {
    opacity: 0;
    transform: translateY(8px);
  }
}

.photo-dialog::backdrop {
  background: rgba(5, 10, 22, 0.82);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.18s var(--motion-state);
}

.photo-dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  .photo-dialog[open]::backdrop {
    opacity: 0;
  }
}

.photo-dialog-image {
  display: block;
  width: auto;
  max-width: 92vw;
  height: auto;
  max-height: 88vh;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.photo-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(16, 33, 61, 0.82);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
}

.photo-dialog-close:hover {
  background: var(--primary);
}

.about-profile h2 {
  margin: 0 0 13px;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  letter-spacing: -0.05em;
}

.about-profile p:not(.section-kicker),
.about-side p:not(.section-kicker) {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}

.about-tags span {
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
}

.about-side {
  display: grid;
  gap: 22px;
}

.about-side .card {
  padding: 29px 31px;
}

.about-side h2 {
  margin: 0 0 11px;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}

.about-side .text-link {
  display: inline-block;
  padding-top: 0;
}

.about-contact p:last-child {
  margin-bottom: 0;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-muted);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
}

.contact-links a:hover {
  border-color: var(--primary);
  background: var(--bg-surface);
}

@keyframes shimmer {
  to {
    background-position-x: -220%;
  }
}

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

@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .insights-column {
    grid-template-columns: 1fr 1fr;
  }
  .recent-card {
    grid-column: 1 / -1;
  }
}

@media (min-width: 721px) and (max-width: 900px) {
  .topbar-inner {
    gap: 12px;
  }
  .brand {
    font-size: 0.9rem;
  }
  .nav {
    gap: 0;
  }
  .nav a {
    padding: 8px 9px;
  }
}

@media (max-width: 800px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-profile {
    min-height: 0;
  }
  .about-side {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    width: calc(100% - 32px);
    min-height: 70px;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
  }
  .brand {
    max-width: calc(100% - 150px);
    gap: 8px;
    font-size: 0.9rem;
  }
  .brand > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
  }
  .header-controls {
    position: absolute;
    top: 17px;
    right: 0;
    gap: 6px;
    margin-left: 0;
  }
  .icon-button {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }
  .language-toggle {
    width: 60px;
    height: 36px;
    padding: 2px;
    flex: 0 0 60px;
  }
  .language-option {
    width: 26px;
    height: 30px;
  }
  .menu-toggle {
    display: grid;
  }
  .nav {
    display: none;
    width: 100%;
    margin: 0;
    padding: 10px 0 15px;
    border-top: 1px solid var(--border-color);
  }
  .nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  .page {
    width: calc(100% - 32px);
    margin-top: 35px;
  }
  .page-heading {
    margin-bottom: 25px;
  }
  .insights-column {
    grid-template-columns: 1fr;
  }
  .recent-card {
    grid-column: auto;
  }
  .converter-card,
  .rate-card,
  .chart-card,
  .recent-card {
    padding: 23px;
  }
  .history-header {
    align-items: start;
    flex-direction: column;
    gap: 16px;
  }
  .history-page {
    margin-top: 35px;
  }
  .table-wrap {
    overflow: visible;
  }
  .history-card table,
  .history-card tbody,
  .history-card tr,
  .history-card td {
    display: block;
    width: 100%;
  }
  .history-card thead {
    display: none;
  }
  .history-card tr {
    padding: 12px 19px;
    border-bottom: 1px solid var(--border-color);
  }
  .history-card tr:last-child {
    border: 0;
  }
  .history-card td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border: 0;
    text-align: right;
  }
  .history-card td:before {
    content: attr(data-label);
    color: var(--text-secondary);
    font-size: 0.74rem;
    text-align: left;
  }
  .history-card td.history-rate {
    display: block;
  }
  .history-card td.history-rate:before {
    display: block;
    text-align: left;
  }
  .history-rate small {
    margin-left: auto;
  }
}

@media (max-width: 600px) {
  .about-side {
    grid-template-columns: 1fr;
  }
  .about-profile {
    padding: 28px;
  }
  .about-side .card {
    padding: 25px;
  }
  .about-avatar-button {
    margin-bottom: 25px;
  }
}

@media (max-width: 420px) {
  .currency-fields {
    grid-template-columns: 1fr;
  }
  .swap-button {
    margin: 0 auto -8px;
    transform: rotate(90deg);
  }
  .swap-button.spinning {
    transform: rotate(270deg);
  }
  .result-meta {
    grid-template-columns: 1fr;
  }
  .chart-heading {
    flex-direction: column;
  }
  .range-selector {
    align-self: flex-start;
  }
  .recent-heading {
    flex-wrap: wrap;
  }
  .text-link {
    padding-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .about-tilt-card {
    transform: none;
    transition: none;
  }
  .about-tilt-card::before {
    display: none;
  }
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: page-exit 140ms var(--motion-state) both;
}

::view-transition-new(root) {
  animation: page-enter 240ms var(--motion-enter) both;
}

@keyframes page-exit {
  to {
    opacity: 0;
    transform: translateY(-4px);
    filter: blur(2px);
  }
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root) {
    animation: none !important;
  }
  ::view-transition-new(root) {
    animation: none !important;
  }
}
