/* ==========================================================================
   Dr. Subhan Yasin — link page
   Tokens, fonts and shapes are taken from docsubhan.com (see README).
   ========================================================================== */

/* ---- Fonts (variable, latin subset, same files as the main site) -------- */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
/* Metric-matched fallbacks (same values docsubhan.com ships) so the swap doesn't shift layout */
@font-face {
  font-family: "Cormorant Garamond Fallback";
  src: local("Times New Roman");
  ascent-override: 95.27%;
  descent-override: 29.59%;
  line-gap-override: 0%;
  size-adjust: 96.98%;
}
@font-face {
  font-family: "Plus Jakarta Sans Fallback";
  src: local("Arial");
  ascent-override: 98.88%;
  descent-override: 21.15%;
  line-gap-override: 0%;
  size-adjust: 104.98%;
}

/* ---- Tokens ------------------------------------------------------------- */
:root {
  color-scheme: light dark;

  /* docsubhan.com palette */
  --cream: #faf9f6;
  --ivory: #f3efe7;
  --sand: #e7dfd2;
  --ink: #1a1a1a;
  --ink-soft: #4a4642;
  --ink-muted: #75706a;
  --burgundy: #531020;
  --champagne: #b8986a;
  --champagne-deep: #85663a;
  --champagne-light: #dcc9a8;

  --font-serif: "Cormorant Garamond", "Cormorant Garamond Fallback", "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", "Plus Jakarta Sans Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* docsubhan.com's own easing (--ease-luxe): a strong ease-out */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* semantic, light */
  --bg: var(--cream);
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --fg-muted: var(--ink-muted);
  --line: rgb(26 26 26 / 0.22);
  --emphasis: var(--burgundy);
  --outline-offset-ring: rgb(184 152 106 / 0.55);
  --focus: var(--champagne-deep);
  --primary-bg: var(--burgundy);
  --primary-fg: var(--cream);
  --primary-over: var(--ink);
  --primary-shadow: 0 24px 40px -28px rgb(83 16 32 / 0.6);
  --secondary-over: var(--ivory);
  --selection: var(--champagne-light);
}

/* The main site is light-only. This is the same palette inverted the way its
   own footer does it (dark surface, cream text, champagne accents). */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--ink);
    --fg: var(--cream);
    --fg-soft: rgb(250 249 246 / 0.78);
    --fg-muted: rgb(250 249 246 / 0.62);
    --line: rgb(250 249 246 / 0.3);
    --emphasis: var(--champagne-light);
    --focus: var(--champagne-light);
    --primary-bg: var(--cream);
    --primary-fg: var(--ink);
    --primary-over: var(--champagne-light);
    --primary-shadow: none;
    --secondary-over: rgb(250 249 246 / 0.09);
    --selection: rgb(184 152 106 / 0.45);
  }
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;     /* fallback */
  min-height: 100svh;    /* stable under collapsing in-app browser toolbars */
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* edge-to-edge under the notch, content padded back out */
  /* gutters are px-capped so 200% system text doesn't eat the column */
  padding:
    max(min(1.5rem, 24px), env(safe-area-inset-top))
    max(min(1.25rem, 20px), env(safe-area-inset-right))
    max(min(1rem, 16px), env(safe-area-inset-bottom))
    max(min(1.25rem, 20px), env(safe-area-inset-left));
}

::selection { background: var(--selection); }

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

/* ---- Layout ------------------------------------------------------------- */
.page {
  flex: 1;
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ---- Portrait: the site's arch with the offset champagne outline -------- */
.portrait {
  position: relative;
  left: -0.3rem; /* optically re-centre the offset outline */
  width: 9.5rem;
  aspect-ratio: 4 / 5;
  margin: 0 0 1.75rem;
}
.portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translate(0.6rem, 0.6rem);
  border: 1px solid var(--outline-offset-ring);
  border-radius: 999px 999px 0 0;
}
.portrait__frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  background: var(--sand);
  box-shadow: 0 30px 60px -36px rgb(60 45 25 / 0.35);
}
.portrait__monogram {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 2.25rem;
  color: var(--ink);
}
.portrait img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* ---- Identity ----------------------------------------------------------- */
.name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.01em;   /* display size: tighten */
  text-wrap: balance;
}

.role {
  margin: 0.85rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.3em;     /* small caps: open up */
  text-transform: uppercase;
}
.role span { padding-left: 0.3em; } /* cancels trailing tracking so it centres optically */
.role span:first-child { color: var(--fg-soft); }
.role span:last-child { color: var(--fg-muted); }

.tagline {
  margin: 1.25rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
}
.tagline em {
  font-style: italic;
  color: var(--emphasis);
}

/* ---- Links -------------------------------------------------------------- */
.links {
  width: 100%;
  margin-top: 2.25rem;
}
.links ul {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.75rem min(3rem, 48px); /* room for the arrow, capped for large system text */
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  /* release: a touch slower than the press */
  transition: transform 160ms var(--ease);
}
.btn__label {
  padding-left: 0.24em;       /* cancels trailing tracking */
  overflow-wrap: anywhere;    /* only breaks if 200% text leaves no other choice */
}

/* Hover / press tint is an opacity fade on a pseudo-element (compositor only) */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--secondary-over);
  opacity: 0;
  transition: opacity 150ms ease;
}

.btn__arrow {
  position: absolute;
  top: 50%;
  right: min(1.25rem, 20px);
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
}

/* Main button: the one that carries the weight */
.btn--primary {
  min-height: 4.25rem;
  border-color: transparent;
  background: var(--primary-bg);
  color: var(--primary-fg);
  font-size: 0.8125rem;
  box-shadow: var(--primary-shadow);
}
.btn--primary::before { background: var(--primary-over); }

/* Press: instant, on every input type */
.btn:active {
  transform: scale(0.97);
  transition-duration: 100ms;
}
.btn:active::before {
  opacity: 1;
  transition-duration: 60ms;
}

/* Hover only where hover is real (never sticks on touch) */
@media (hover: hover) and (pointer: fine) {
  .btn:hover::before { opacity: 1; }
}

.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

/* ---- Footer ------------------------------------------------------------- */
.footer {
  margin-top: 2rem;
  padding-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ---- Entrance ------------------------------------------------------------
   Order: portrait (lead) → name + role → tagline → Website → Instagram →
   Facebook → footer. transform + opacity only. `backwards` (not `both`) so
   the finished animation doesn't pin a transform over the :active press.   */
@keyframes rise {
  from {
    opacity: 0;
    transform: translate3d(0, var(--rise, 10px), 0);
  }
}
.enter {
  animation: rise var(--dur, 560ms) var(--ease) var(--delay, 0ms) backwards;
}
.enter--portrait  { --delay: 0ms;   --dur: 500ms; --rise: 12px; }
.enter--identity  { --delay: 80ms;  --dur: 450ms; --rise: 10px; } /* name + role + tagline, one beat */
.enter--link-1    { --delay: 160ms; --dur: 450ms; --rise: 10px; }
.enter--link-2    { --delay: 210ms; --dur: 420ms; --rise: 8px; }
.enter--link-3    { --delay: 250ms; --dur: 420ms; --rise: 8px; }

/* ---- Sizes -------------------------------------------------------------- */
@media (max-height: 700px) {
  .portrait { width: 7.5rem; margin-bottom: 1.25rem; }
  .name { font-size: 2.25rem; }
  .tagline { margin-top: 0.9rem; font-size: 1.375rem; }
  .links { margin-top: 1.5rem; }
  .btn--primary { min-height: 3.75rem; }
}

/* very short phones (iPhone SE class, 568px tall) */
@media (max-height: 600px) {
  .portrait { width: 6.25rem; margin-bottom: 1rem; }
  .name { font-size: 2rem; }
  .role { margin-top: 0.6rem; gap: 0.3rem; }
  .tagline { margin-top: 0.7rem; font-size: 1.25rem; }
  .links { margin-top: 1.1rem; }
  .links ul { gap: 0.6rem; }
  .btn--primary { min-height: 3.5rem; }
  .btn { min-height: 3.25rem; }
  .footer { margin-top: 1rem; }
}

@media (min-width: 48rem) and (min-height: 700px) {
  .page { max-width: 24rem; }
  .portrait { width: 11rem; margin-bottom: 2.25rem; }
  .name { font-size: 3rem; }
  .tagline { font-size: 1.625rem; }
  .links { margin-top: 2.75rem; }
}

/* ---- Reduced motion: no movement, a short fade, nothing staggered -------- */
@media (prefers-reduced-motion: reduce) {
  @keyframes fade { from { opacity: 0; } }
  .enter {
    animation: fade 300ms ease-out 0ms backwards;
  }
  .btn { transition: none; }
  .btn:active { transform: none; }
}
