/* Part 2. Scoped presentation styles; original title, menus and world are untouched. */
.sg-profile-invitation {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 1.1rem);
  display: flex;
  justify-content: center;
  padding-bottom: 1rem;
  visibility: hidden;
  pointer-events: none;
}
body.is-complete .sg-profile-invitation { visibility: visible; }
.sg-profile-invitation[hidden] { display: none; }
.sg-profile-trigger {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  gap: .35rem;
  justify-items: center;
  min-height: 64px;
  width: min(272px, 100%);
  padding: .8rem 1.35rem;
  border: 1px solid #d9bd8394;
  border-radius: 4px;
  background: linear-gradient(115deg, #162e31e8, #0b1b27ec);
  color: #f0d9ad;
  box-shadow: inset 0 1px 0 #fff2cd12, 0 5px 20px #020c1226;
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease;
}
.sg-profile-trigger > span:first-child { font-size: .73rem; font-weight: 600; letter-spacing: .16em; line-height: 1.4; }
.sg-profile-trigger > small { color: #e2e7dd; font-size: .72rem; font-weight: 400; letter-spacing: .01em; line-height: 1.4; }
.sg-profile-trigger::before { content: ""; position: absolute; inset: -40%; z-index: -1; background: linear-gradient(105deg, transparent 40%, #f8e5bf16 50%, transparent 60%); transform: translateX(-110%); pointer-events: none; }
.sg-profile-trigger:hover, .sg-profile-trigger:focus-visible { border-color: #f0d9ad; box-shadow: inset 0 1px 0 #fff2cd22, 0 4px 20px #edd5a814; }
.sg-profile-trigger:hover::before, .sg-profile-trigger:focus-visible::before { animation: sg-profile-reflection 650ms ease-out 1; }
.sg-profile-trigger:focus-visible { outline: 2px solid #ffe5b5; outline-offset: 4px; }
@keyframes sg-profile-reflection { to { transform: translateX(110%); } }

.sg-profile-dialog {
  --sg-p-gold: #e5c895;
  --sg-p-ivory: #f7f1e5;
  --sg-p-muted: #c0cdc9;
  --sg-p-line: #d5c19b38;
  position: fixed;
  width: min(1120px, calc(100vw - 48px));
  height: min(880px, calc(100svh - 48px));
  max-width: none;
  max-height: calc(100svh - 48px);
  margin: auto;
  padding: 0;
  border: 1px solid #cbb37f77;
  border-radius: 18px;
  background: radial-gradient(ellipse at 0% 0%, #25474770, transparent 65%), linear-gradient(145deg, #0d2229f7, #08141ff7);
  color: var(--sg-p-ivory);
  box-shadow: 0 32px 100px #01060b99, inset 0 1px 0 #fff0cb13;
  overflow: hidden;
  overscroll-behavior: contain;
  text-align: left;
}
.sg-profile-dialog:not([open]) { display: none; }
.sg-profile-dialog[open] { display: flex; flex-direction: column; animation: sg-profile-enter 240ms ease-out both; }
.sg-profile-dialog::backdrop { background: #020b13a3; backdrop-filter: blur(3px); }
@supports (height: 100dvh) { .sg-profile-dialog { height: min(880px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px); } }
@keyframes sg-profile-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
body[data-sg-profile-open] { overflow: hidden; }
.sg-profile-toolbar { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; padding: .8rem 2.6rem; border-bottom: 1px solid var(--sg-p-line); background: #0a1d24d9; }
.sg-profile-signature > span { display: block; color: #f1e5cc; font-size: .8rem; font-weight: 600; letter-spacing: .19em; line-height: 1.5; }
.sg-profile-signature small { display: block; margin-top: .12rem; color: #b4c7c2; font-size: .54rem; letter-spacing: .13em; line-height: 1.5; }
.sg-profile-tools { display: flex; align-items: center; gap: 1.15rem; }
.sg-profile-languages { display: flex; align-items: center; }
.sg-profile-languages > span { color: #7e9696; font-size: .7rem; }
.sg-profile-languages button { min-width: 40px; min-height: 44px; padding: .5rem; border: 0; background: none; color: #bfd0ce; font-size: .7rem; font-weight: 500; letter-spacing: .1em; cursor: pointer; }
.sg-profile-languages button[aria-pressed="true"] { color: #f5d7a0; text-decoration: underline; text-underline-offset: 6px; }
.sg-profile-close { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid #d5c19b55; border-radius: 50%; background: #eee1c805; color: #f7eddb; font-size: 1.6rem; line-height: 1; cursor: pointer; transition: border-color 200ms, background 200ms; }
.sg-profile-close:hover { background: #dac09516; border-color: #e5c895; }
.sg-profile-dialog :is(button,a,[tabindex]):focus-visible { outline: 2px solid #ffe3ad; outline-offset: 4px; }
.sg-profile-dialog #sg-profile-title:focus { outline-offset: 8px; }
.sg-profile-scroll { position: relative; min-height: 0; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scroll-padding-block: 1.5rem; scrollbar-width: thin; scrollbar-color: #9c8e70 #0a2027; }
.sg-profile-content { padding: clamp(28px, 4.5vw, 64px) clamp(24px, 5vw, 72px) 24px; }
.sg-profile-dialog p { margin: 0; font-size: .94rem; line-height: 1.75; color: var(--sg-p-muted); }
.sg-profile-dialog .sg-profile-eyebrow { color: var(--sg-p-gold); font-size: .61rem; font-weight: 500; letter-spacing: .18em; line-height: 1.7; }
.sg-profile-hero h2 { max-width: 790px; margin: 1.3rem 0 1.75rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.2rem, 5.3vw, 4.5rem); font-weight: 400; line-height: 1.06; letter-spacing: -.035em; text-wrap: balance; }
.sg-profile-hero h2 em { color: var(--sg-p-gold); font-style: italic; font-weight: 400; }
.sg-profile-introduction { display: grid; grid-template-columns: 1fr 1fr; gap: 2.6rem; max-width: 900px; }
.sg-profile-introduction .sg-profile-lead { color: #e7e8dc; font-size: 1.03rem; }
.sg-profile-quote { margin: 2.2rem 0 0; border-left: 1px solid #e5c89596; padding: .2rem 0 .2rem 1.2rem; max-width: 660px; }
.sg-profile-quote p { color: #d8c8a8; font-family: Georgia, "Times New Roman", serif; font-size: 1.13rem; font-style: italic; line-height: 1.55; }
.sg-profile-section { margin-top: clamp(40px, 5vw, 64px); padding-top: clamp(32px, 3.8vw, 48px); border-top: 1px solid var(--sg-p-line); }
.sg-profile-section-heading { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.8rem; }
.sg-profile-section-number { color: #d0b57d; font-size: .7rem; letter-spacing: .12em; }
.sg-profile-section h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.65rem, 2.6vw, 2.25rem); line-height: 1.18; font-weight: 400; letter-spacing: -.025em; }
.sg-profile-areas { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.6rem; }
.sg-profile-area { min-width: 0; padding: 1.5rem 0 1.7rem; border-top: 1px solid #d5c19b27; }
.sg-profile-area-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; color: #baa67f; font-family: Georgia, "Times New Roman", serif; font-size: .85rem; }
.sg-profile-area-top img { display: block; width: 24px; height: 24px; }
.sg-profile-area h4, .sg-profile-process h4 { margin: 0 0 .8rem; font-size: .78rem; font-weight: 500; letter-spacing: .1em; line-height: 1.6; color: #f1dfbe; }
.sg-profile-area p { font-size: .86rem; }
.sg-profile-area .sg-profile-area-intro { margin-bottom: .65rem; color: #e2e6dc; }
.sg-profile-section .sg-profile-editorial-title { max-width: 680px; margin: .8rem 0 2rem; font-size: clamp(1.8rem, 3vw, 2.6rem); }
.sg-profile-brands { display: block; }
.sg-profile-brands a { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(0, 1.5fr) 24px; gap: 1.5rem; align-items: center; padding: 1.5rem .35rem; border-top: 1px solid #d5c19b30; color: inherit; text-decoration: none; transition: background 200ms; }
.sg-profile-brands a:last-child { border-bottom: 1px solid #d5c19b30; }
.sg-profile-brands a:hover { background: #d5c19b08; }
.sg-profile-brand-name { color: #f0e3c7; font-size: 1.07rem; font-weight: 500; letter-spacing: .07em; line-height: 1.45; }
.sg-profile-brand-name > span { display: block; font-size: .65rem; letter-spacing: .22em; }
.sg-profile-brand-tech { font-weight: 700; letter-spacing: .13em; }
.sg-profile-brand-lab { font-weight: 400; letter-spacing: .16em; }
.sg-profile-brand-description { color: #c2cfca; font-size: .86rem; line-height: 1.7; }
.sg-profile-brand-arrow { justify-self: end; color: #e5c895; font-size: 1.25rem; transition: transform 200ms ease; }
.sg-profile-brands a:is(:hover,:focus-visible) .sg-profile-brand-arrow { transform: translate(2px,-2px); }
.sg-profile-process { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.8rem; margin: 0; padding: 0; list-style: none; }
.sg-profile-process li { min-width: 0; padding-top: 1.15rem; border-top: 1px solid #d5c19b44; }
.sg-profile-step-number { display: block; margin-bottom: 1.5rem; color: #c3ab7d; font-family: Georgia, "Times New Roman", serif; font-size: 1.65rem; line-height: 1; }
.sg-profile-process p { font-size: .86rem; }
.sg-profile-finale { margin-top: clamp(44px, 6vw, 76px); padding: clamp(32px, 4vw, 52px) 0 2.5rem; border-top: 1px solid #d5c19b66; text-align: center; }
.sg-profile-finale h3 { max-width: 620px; margin: .9rem auto 1.3rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 3.5vw, 3.2rem); font-weight: 400; line-height: 1.12; letter-spacing: -.03em; }
.sg-profile-finale > p:not(.sg-profile-eyebrow) { max-width: 560px; margin: 0 auto; }
.sg-profile-contact { display: inline-flex; align-items: center; justify-content: center; gap: 1.5rem; max-width: 100%; min-height: 56px; margin: 1.8rem 0 .9rem; padding: 1rem 1.6rem; border: 1px solid #f1d7a6; border-radius: 3px; background: linear-gradient(110deg,#dbc291,#f1dfbb); color: #13282b; font-size: .74rem; font-weight: 700; line-height: 1.5; letter-spacing: .1em; text-decoration: none; transition: box-shadow 200ms; }
.sg-profile-contact:hover { box-shadow: 0 4px 24px #d9bc7c26; }
.sg-profile-contact > span:last-child { font-size: 1.15rem; }
.sg-profile-finale .sg-profile-contact-note { color: #b6c9c2; font-size: .75rem; }
.sg-profile-footer { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--sg-p-line); padding-top: 1.2rem; color: #afbfbb; font-size: .58rem; letter-spacing: .13em; line-height: 1.7; }

@media (max-width: 700px) {
  .sg-profile-dialog { width: calc(100vw - 24px); height: calc(100svh - 24px); max-height: calc(100svh - 24px); border-radius: 12px; }
  @supports (height: 100dvh) { .sg-profile-dialog { height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); } }
  .sg-profile-toolbar { min-height: 68px; padding: .55rem 1.2rem; }
  .sg-profile-tools { gap: .6rem; }
  .sg-profile-introduction { grid-template-columns: 1fr; gap: 1rem; }
  .sg-profile-areas { gap: 0 1.5rem; }
  .sg-profile-brands a { grid-template-columns: minmax(0,1fr) 24px; gap: .65rem 1rem; }
  .sg-profile-brand-description { grid-column: 1; }
  .sg-profile-brand-arrow { grid-column: 2; grid-row: 1 / 3; }
  .sg-profile-footer { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .sg-profile-invitation { top: calc(100% + .9rem); }
  .sg-profile-trigger { width: min(246px,100%); min-height: 60px; padding: .7rem 1rem; }
  .sg-profile-trigger > span:first-child { font-size: .7rem; letter-spacing: .13em; }
  .sg-profile-dialog { width: calc(100vw - 16px); height: calc(100svh - 16px); max-height: calc(100svh - 16px); }
  @supports (height: 100dvh) { .sg-profile-dialog { height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); } }
  .sg-profile-toolbar { padding: .5rem .8rem; gap: .3rem; min-height: 64px; }
  .sg-profile-signature > span { font-size: .64rem; letter-spacing: .12em; }
  .sg-profile-signature small { font-size: .44rem; letter-spacing: .04em; }
  .sg-profile-tools { gap: .25rem; }
  .sg-profile-languages button { min-width: 34px; font-size: .65rem; padding-inline: .35rem; }
  .sg-profile-close { width: 40px; height: 44px; flex-basis: 40px; }
  .sg-profile-content { padding: 30px 22px 22px; }
  .sg-profile-hero h2 { font-size: clamp(2rem, 8.2vw, 2.5rem); margin-block: 1.2rem 1.5rem; }
  .sg-profile-dialog .sg-profile-eyebrow { font-size: .56rem; letter-spacing: .12em; }
  .sg-profile-introduction .sg-profile-lead { font-size: .95rem; }
  .sg-profile-dialog p { font-size: .88rem; }
  .sg-profile-quote p { font-size: 1.02rem; }
  .sg-profile-areas, .sg-profile-process { grid-template-columns: 1fr; gap: 0; }
  .sg-profile-area { padding-block: 1.4rem; }
  .sg-profile-process li { padding: 1.35rem 0; }
  .sg-profile-step-number { margin-bottom: 1rem; }
  .sg-profile-contact { gap: .7rem; width: 100%; padding-inline: .8rem; font-size: .67rem; letter-spacing: .07em; }
}
/* Preserve the original coordinates; scroll the existing identity only when
 * the new invitation cannot fit beneath it in a short viewport. */
@media (max-width: 600px) and (max-height: 700px) and (orientation: portrait), (max-height: 500px) and (orientation: landscape) {
  body.world-visible[data-sg-profile-ready] .identity { overflow-y: auto; overflow-x: hidden; pointer-events: auto; overscroll-behavior: contain; scrollbar-width: none; scroll-padding-block: .5rem; }
  body.world-visible[data-sg-profile-ready] .identity::-webkit-scrollbar { width: 0; }
}
/* This smallest landscape layout already has a thin scrollbar in Stage 4. */
@media (max-width: 600px) and (max-height: 400px) and (orientation: landscape) {
  body.world-visible[data-sg-profile-ready] .identity { scrollbar-width: thin; }
  body.world-visible[data-sg-profile-ready] .identity::-webkit-scrollbar { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .sg-profile-dialog[open], .sg-profile-trigger::before { animation: none !important; }
  .sg-profile-trigger, .sg-profile-close, .sg-profile-brands a, .sg-profile-brand-arrow, .sg-profile-contact { transition: none !important; }
  .sg-profile-brand-arrow { transform: none !important; }
}
body.world-reduced .sg-profile-dialog[open], body.world-reduced .sg-profile-trigger::before,
body.reduced-experience .sg-profile-dialog[open], body.reduced-experience .sg-profile-trigger::before { animation: none !important; }
body.world-reduced :is(.sg-profile-trigger,.sg-profile-close,.sg-profile-brands a,.sg-profile-brand-arrow,.sg-profile-contact),
body.reduced-experience :is(.sg-profile-trigger,.sg-profile-close,.sg-profile-brands a,.sg-profile-brand-arrow,.sg-profile-contact) { transition: none !important; transform: none !important; }
@media (forced-colors: active) {
  .sg-profile-trigger, .sg-profile-dialog, .sg-profile-toolbar, .sg-profile-contact { background: Canvas; color: CanvasText; border-color: ButtonText; box-shadow: none; }
  .sg-profile-dialog :is(p,h2,h3,h4,em,a,button,span,small), .sg-profile-trigger small { color: CanvasText; }
  .sg-profile-dialog :is(a,button):focus-visible, .sg-profile-trigger:focus-visible { outline-color: Highlight; }
}
