/* 1. Local fonts */
@font-face {
  font-family: "Fjalla One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/fjalla-one-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("./assets/fonts/open-sans-latin.woff2") format("woff2");
}

/* 2. Design tokens */
:root {
  --font-heading: "Fjalla One", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "Open Sans", "Segoe UI", Arial, sans-serif;

  --color-primary: #005654;
  --color-primary-dark: #004440;
  --color-accent: #f6c66b;
  --color-accent-strong: #ffb32b;
  --color-background: #f3f8f7;
  --color-background-wave: #dceeea;
  --color-background-wave-soft: #e7f2ef;
  --color-surface: #ffffff;
  --color-surface-tinted: #edf5f4;
  --color-text: #202020;
  --color-text-muted: #4b5563;
  --color-border: #dfdfdf;
  --color-focus: #a26700;

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

  --radius-sm: 5px;
  --radius-md: 6px;
  --radius-round: 999px;
  --shadow-card: 3px 4px 0 rgba(0, 86, 84, 0.12);
  --shadow-hover: 5px 7px 0 rgba(0, 86, 84, 0.17);
  --container-width: 36.25rem;
}

/* 3. Minimal reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body,
h1,
h2,
p {
  margin: 0;
}

button,
a {
  font: inherit;
}

img,
svg {
  display: block;
}

/* 4. Base */
body {
  position: relative;
  min-width: 20rem;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

body::before,
body::after {
  position: absolute;
  z-index: -2;
  top: 0;
  left: 50%;
  width: 100%;
  min-width: 75rem;
  height: 31rem;
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
}

body::before {
  background: linear-gradient(180deg, #d3e8e3 0%, var(--color-background-wave) 72%);
  clip-path: polygon(0 0, 100% 0, 100% 45%, 91% 52%, 78% 48%, 64% 55%, 49% 49%, 35% 54%, 21% 47%, 10% 53%, 0 44%);
}

body::after {
  z-index: -1;
  top: 8rem;
  height: 20rem;
  background: rgba(231, 242, 239, 0.78);
  clip-path: polygon(0 25%, 11% 34%, 24% 29%, 38% 38%, 51% 28%, 65% 36%, 79% 27%, 90% 35%, 100% 24%, 100% 100%, 0 100%);
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* 5. Layout */
.page-shell {
  position: relative;
  width: min(100%, var(--container-width));
  margin-inline: auto;
  padding:
    max(2rem, env(safe-area-inset-top))
    max(var(--space-md), env(safe-area-inset-right))
    max(var(--space-xl), env(safe-area-inset-bottom))
    max(var(--space-md), env(safe-area-inset-left));
}

.links-section {
  margin-top: 2.75rem;
}

.spotlight-section {
  margin-top: 2.75rem;
}

.spotlight-heading {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: 0.85rem;
}

.spotlight-heading__marker {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--color-accent-strong);
  box-shadow: 0 0 0 4px rgba(246, 198, 107, 0.28);
}

.spotlight-heading h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 5.5vw, 1.55rem);
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: 0.85rem;
}

.section-heading__number {
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  line-height: 1;
}

.section-heading h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 5.5vw, 1.55rem);
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
}

/* 6. Header */
.profile-header {
  position: relative;
  padding-top: 1.75rem;
  color: var(--color-text);
  text-align: center;
}

.profile-header__top {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  border-radius: 50%;
}

.brand__avatar {
  width: clamp(6.5rem, 24vw, 7.75rem);
  height: clamp(6.5rem, 24vw, 7.75rem);
  border: 5px solid var(--color-surface);
  border-radius: 50%;
  background: var(--color-accent-strong);
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--color-primary), 0 12px 30px -18px rgba(0, 56, 54, 0.75);
}

.share-button {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1.5px solid var(--color-primary);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: var(--color-primary);
  box-shadow: 2px 3px 0 rgba(0, 86, 84, 0.12);
  cursor: pointer;
}

.share-button svg {
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.profile-header__copy {
  padding: 1.1rem 0 0;
}

.eyebrow {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.profile-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.15rem, 10vw, 2.85rem);
  font-weight: 400;
  line-height: 1.05;
  text-transform: uppercase;
}

.profile-header__copy p {
  max-width: 27rem;
  margin: var(--space-xs) auto 0;
  color: var(--color-text-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

/* 7. Cards */
.link-list {
  display: grid;
  gap: var(--space-sm);
}

.link-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 6.25rem;
  grid-template-columns: 3rem minmax(0, 1fr) 1.25rem;
  align-items: center;
  gap: var(--space-md);
  overflow: hidden;
  border: 2px solid #173735;
  border-radius: 9px;
  background: var(--color-surface);
  color: var(--color-text);
  padding: 1.15rem 1rem;
  text-decoration: none;
  box-shadow: var(--shadow-card);
}

.link-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--color-accent);
  content: "";
}

.link-card--featured {
  border-color: #173735;
  background: linear-gradient(110deg, #fff8df, #fffdf6 48%, #fff);
}

.link-card--featured::before {
  width: 6px;
  background: var(--color-accent-strong);
}

.link-card--spotlight {
  min-height: 7rem;
  border-color: #173735;
  background: linear-gradient(120deg, var(--color-primary-dark), var(--color-primary));
  color: #fff;
  box-shadow: 5px 6px 0 rgba(246, 198, 107, 0.34);
}

.link-card--spotlight::before {
  width: 6px;
  background: var(--color-accent-strong);
}

.link-card--spotlight .link-card__icon {
  border-color: #d4a847;
  background: var(--color-accent);
  color: var(--color-primary-dark);
}

.link-card--spotlight .link-card__description {
  color: rgba(255, 255, 255, 0.82);
}

.link-card--spotlight .link-card__badge {
  background: var(--color-accent);
  color: var(--color-primary-dark);
}

.link-card--spotlight .link-card__arrow {
  color: var(--color-accent);
}

.link-card__icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid #c7dcda;
  border-radius: 7px;
  background: var(--color-surface-tinted);
  color: var(--color-primary);
}

.link-card--featured .link-card__icon {
  border-color: #d4a847;
  background: var(--color-accent);
}

.link-card__icon svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.link-card__image {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.link-card__content {
  min-width: 0;
}

.link-card__title-row {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem var(--space-xs);
}

.link-card__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
}

.link-card__description {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 0.3rem;
  color: var(--color-text-muted);
  font-size: 0.86rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.link-card__badge {
  flex: 0 0 auto;
  border-radius: var(--radius-round);
  background: var(--color-surface-tinted);
  color: var(--color-primary);
  padding: 0.22rem 0.48rem;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.link-card__arrow {
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 1.55rem;
  line-height: 1;
  text-align: right;
}

.link-list--compact .link-card {
  min-height: 5rem;
  grid-template-columns: 2.6rem minmax(0, 1fr) 1.25rem;
  padding-block: 0.9rem;
}

.link-list--compact .link-card__icon,
.link-list--compact .link-card__image {
  width: 2.6rem;
  height: 2.6rem;
}

.link-list--compact .link-card__title {
  font-size: 1.05rem;
}

.link-list--compact .link-card__description {
  -webkit-line-clamp: 2;
}

/* 8. Social links */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-sm);
}

.social-link {
  display: flex;
  min-width: 0;
  min-height: 3.25rem;
  align-items: center;
  gap: var(--space-xs);
  border: 1.5px solid #173735;
  border-radius: 8px;
  background: var(--color-surface);
  padding: 0.625rem;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 2px 3px 0 rgba(0, 86, 84, 0.1);
}

.social-link__icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-accent);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
}

.social-link__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-link__status {
  margin-left: auto;
  border-radius: var(--radius-round);
  background: var(--color-surface-tinted);
  color: var(--color-primary);
  padding: 0.18rem 0.35rem;
  font-family: var(--font-body);
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

/* 9. Footer */
.site-footer {
  margin-top: var(--space-2xl);
  border: 2px solid #173735;
  border-radius: 10px;
  background: var(--color-primary);
  padding: var(--space-lg);
  color: rgba(255, 255, 255, 0.8);
  box-shadow: 4px 5px 0 rgba(0, 86, 84, 0.16);
  text-align: center;
}

.site-footer__logo {
  width: min(12rem, 70%);
  height: auto;
  margin: 0 auto 0.4rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 var(--space-xs);
}

.site-footer__links span {
  color: rgba(255, 255, 255, 0.48);
}

.site-footer a {
  display: inline-block;
  min-height: 2.75rem;
  color: var(--color-accent);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  line-height: 2.75rem;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-transform: uppercase;
}

.site-footer p {
  font-size: 0.75rem;
  line-height: 1.5;
  text-transform: uppercase;
}

.share-status {
  position: fixed;
  z-index: 10;
  right: max(var(--space-md), env(safe-area-inset-right));
  bottom: max(var(--space-md), env(safe-area-inset-bottom));
  max-width: calc(100vw - 2rem);
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: #fff;
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.5rem);
}

.share-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 10. Interactive states */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .link-card,
  .social-link,
  .share-button {
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
  }

  .link-card:hover {
    border-color: #b9cfcd;
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
  }

  .social-link:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
  }

  .share-button:hover {
    background: var(--color-surface);
    transform: translateY(-1px);
  }
}

.link-card:active,
.social-link:active,
.share-button:active {
  transform: scale(0.985);
}

/* 11. Responsiveness */
@media (min-width: 48rem) {
  .page-shell {
    padding-block: var(--space-xl) var(--space-2xl);
  }

  .links-section {
    margin-top: 3rem;
  }
}

@media (max-width: 23rem) {
  .link-card {
    grid-template-columns: 2.6rem minmax(0, 1fr) 1rem;
    gap: var(--space-sm);
    padding-inline: 0.8rem;
  }

  .link-card__icon,
  .link-card__image {
    width: 2.6rem;
    height: 2.6rem;
  }

  .link-card__title {
    font-size: 1.06rem;
  }

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

/* 12. Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
