:root {
  /* Colors */
  --color-background: #000000;
  --color-phone-background: #000000;
  --color-phone-text: #ffffff;
  --color-text-phone: #ffffff;
  --color-text-bg: #ffffff;
  --color-text-bg-gradient: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  --color-button-border: #ffffff;
  --color-button-text: #ffffff;
  --color-logo: #ffffff;

  /* Shadows */
  --shadow-elevated: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);

  /* Spacing */
  --spacing-xs: 10px;
  --spacing-sm: 15px;
  --spacing-md: 20px;
  --spacing-lg: 30px;
  --spacing-xl: 40px;

  /* Logo */
  --logo-width: 150px;
  --logo-width-mobile: 120px;
  --logo-width-mobile-sm: 100px;
  --logo-position-top: 30px;
  --logo-position-left: 30px;
  --logo-position-mobile: 20px;
  --logo-position-mobile-sm: 15px;

  /* Phone frame */
  --phone-width: 300px;
  --phone-height: 600px;
  --phone-border-radius: 40px;
  --phone-border-width: 10px;
  --phone-min-height: 450px;

  /* Button */
  --button-border-width: 5px;
  --button-font-size: 24px;
  --button-padding-y: 12px;
  --button-padding-x: 24px;
  --button-border-radius: 50px;

  /* Typography */
  --font-size-headline: clamp(32px, 5.5vw, 54px);
  --font-size-headline-mobile: clamp(24px, 8vw, 60px);
  --font-size-time: 14px;
  --font-size-text-bg: clamp(84px, 4vw, 200px);
  --font-size-text-bg-mobile: clamp(48px, 12vw, 84px);
  --font-size-footer: 12px;
  --font-size-footer-mobile: 11px;

  /* Line heights */
  --line-height-headline: 1.1;
  --line-height-text-bg: 1;

  /* Transitions */
  --transition-fast: 0.2s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;

  /* Z-index */
  --z-index-base: 10;
  --z-index-phone: 20;
  --z-index-footer: 100;

  /* Text content */
  --text-content-gap: 40px;
  --text-content-gap-mobile: 30px;
}

/* Black theme */
body.theme-black {
  --color-background: #000000;
  --color-phone-background: #000000;
  --color-phone-text: #ffffff;
  --color-text-phone: #ffffff;
  --color-text-bg: #ffffff;
  --color-text-bg-gradient: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  --color-button-border: #ffffff;
  --color-button-text: #ffffff;
  --color-logo: #ffffff;
  --shadow-elevated: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* White theme */
body.theme-white {
  --color-background: #ffffff;
  --color-phone-background: #ffffff;
  --color-phone-text: #000000;
  --color-text-phone: #000000;
  --color-text-bg: #000000;
  --color-text-bg-gradient: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.1) 100%
  );
  --color-button-border: #000000;
  --color-button-text: #000000;
  --color-logo: #000000;
  --shadow-elevated: 0 4px 6px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Pastel Peach theme */
body.theme-peach {
  --color-background: #ffe5d9;
  --color-phone-background: #ffdac1;
  --color-phone-text: #8b4513;
  --color-text-phone: #8b4513;
  --color-text-bg: #8b4513;
  --color-text-bg-gradient: linear-gradient(
    90deg,
    rgba(139, 69, 19, 0.15) 0%,
    rgba(139, 69, 19, 0.25) 50%,
    rgba(139, 69, 19, 0.15) 100%
  );
  --color-button-border: #8b4513;
  --color-button-text: #8b4513;
  --color-logo: #8b4513;
  --shadow-elevated: 0 4px 6px rgba(139, 69, 19, 0.1),
    0 1px 3px rgba(139, 69, 19, 0.06);
}

/* Pastel Mint theme */
body.theme-mint {
  --color-background: #e0f7e9;
  --color-phone-background: #c4f1d5;
  --color-phone-text: #2d5f3f;
  --color-text-phone: #2d5f3f;
  --color-text-bg: #2d5f3f;
  --color-text-bg-gradient: linear-gradient(
    90deg,
    rgba(45, 95, 63, 0.15) 0%,
    rgba(45, 95, 63, 0.25) 50%,
    rgba(45, 95, 63, 0.15) 100%
  );
  --color-button-border: #2d5f3f;
  --color-button-text: #2d5f3f;
  --color-logo: #2d5f3f;
  --shadow-elevated: 0 4px 6px rgba(45, 95, 63, 0.1),
    0 1px 3px rgba(45, 95, 63, 0.06);
}

/* Pastel Lavender theme */
body.theme-lavender {
  --color-background: #e6e6fa;
  --color-phone-background: #d8bfd8;
  --color-phone-text: #4b0082;
  --color-text-phone: #4b0082;
  --color-text-bg: #4b0082;
  --color-text-bg-gradient: linear-gradient(
    90deg,
    rgba(75, 0, 130, 0.15) 0%,
    rgba(75, 0, 130, 0.25) 50%,
    rgba(75, 0, 130, 0.15) 100%
  );
  --color-button-border: #4b0082;
  --color-button-text: #4b0082;
  --color-logo: #4b0082;
  --shadow-elevated: 0 4px 6px rgba(75, 0, 130, 0.1),
    0 1px 3px rgba(75, 0, 130, 0.06);
}

/* Pastel Blue theme */
body.theme-blue {
  --color-background: #e0f4ff;
  --color-phone-background: #c0e7ff;
  --color-phone-text: #1e4d6b;
  --color-text-phone: #1e4d6b;
  --color-text-bg: #1e4d6b;
  --color-text-bg-gradient: linear-gradient(
    90deg,
    rgba(30, 77, 107, 0.15) 0%,
    rgba(30, 77, 107, 0.25) 50%,
    rgba(30, 77, 107, 0.15) 100%
  );
  --color-button-border: #1e4d6b;
  --color-button-text: #1e4d6b;
  --color-logo: #1e4d6b;
  --shadow-elevated: 0 4px 6px rgba(30, 77, 107, 0.1),
    0 1px 3px rgba(30, 77, 107, 0.06);
}

/* Pastel Pink theme */
body.theme-pink {
  --color-background: #ffe6f0;
  --color-phone-background: #ffd1e3;
  --color-phone-text: #8b2e5a;
  --color-text-phone: #8b2e5a;
  --color-text-bg: #8b2e5a;
  --color-text-bg-gradient: linear-gradient(
    90deg,
    rgba(139, 46, 90, 0.15) 0%,
    rgba(139, 46, 90, 0.25) 50%,
    rgba(139, 46, 90, 0.15) 100%
  );
  --color-button-border: #8b2e5a;
  --color-button-text: #8b2e5a;
  --color-logo: #8b2e5a;
  --shadow-elevated: 0 4px 6px rgba(139, 46, 90, 0.1),
    0 1px 3px rgba(139, 46, 90, 0.06);
}

/* Pastel Yellow theme */
body.theme-yellow {
  --color-background: #fff9e6;
  --color-phone-background: #fff0c1;
  --color-phone-text: #8b7500;
  --color-text-phone: #8b7500;
  --color-text-bg: #8b7500;
  --color-text-bg-gradient: linear-gradient(
    90deg,
    rgba(139, 117, 0, 0.15) 0%,
    rgba(139, 117, 0, 0.25) 50%,
    rgba(139, 117, 0, 0.15) 100%
  );
  --color-button-border: #8b7500;
  --color-button-text: #8b7500;
  --color-logo: #8b7500;
  --shadow-elevated: 0 4px 6px rgba(139, 117, 0, 0.1),
    0 1px 3px rgba(139, 117, 0, 0.06);
}

/* Christmas Green theme */
body.theme-green {
  --color-background: #00331f;
  --color-phone-background: #008535;
  --color-phone-text: #ffffff;
  --color-text-phone: #ffffff;
  --color-text-bg: #ffffff;
  --color-text-bg-gradient: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0.15) 100%
  );
  --color-button-border: #ffffff;
  --color-button-text: #ffffff;
  --color-logo: #ffffff;
  --shadow-elevated: 0 4px 6px rgba(0, 133, 53, 0.3),
    0 1px 3px rgba(0, 133, 53, 0.2);
}

/* Apple Image theme */
body.theme-apple {
  --color-background: #f5f5f5;
  --color-phone-background: #ffffff;
  --color-phone-text: #000000;
  --color-text-phone: #000000;
  --color-text-bg: #000000;
  --color-text-bg-gradient: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.1) 100%
  );
  --color-button-border: #000000;
  --color-button-text: #000000;
  --color-logo: #000000;
  --shadow-elevated: 0 4px 6px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
  background-image: url("/v3/images/sora_bg_1.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Video theme */
body.theme-video {
  --color-background: #000000;
  --color-phone-background: transparent;
  --color-phone-text: #ffffff;
  --color-text-phone: #ffffff;
  --color-text-bg: #ffffff;
  --color-text-bg-gradient: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  --color-button-border: #ffffff;
  --color-button-text: #ffffff;
  --color-logo: #ffffff;
  --shadow-elevated: 0 8px 16px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.text-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  gap: var(--text-content-gap);
  text-wrap: balance;
}

/* button with think white border and transparent inner and big font */
.button {
  background-color: transparent;
  border: var(--button-border-width) solid var(--color-button-border);
  color: var(--color-button-text);
  font-size: var(--button-font-size);
  font-weight: 600;
  padding: var(--button-padding-y) var(--button-padding-x);
  border-radius: var(--button-border-radius);
  cursor: pointer;
  transition: background-color var(--transition-normal),
    color var(--transition-normal), border-color var(--transition-slow);
}

.headline {
  width: 100%;
  height: auto;
  container-type: inline-size;
}

.headline h1 {
  color: var(--color-phone-text);
  font-weight: 900;
  line-height: 1.1;
  padding: 0;
  margin: 0;
  /* Use container query units for responsive sizing within phone frame */
  font-size: clamp(32px, 16cqi, 64px);
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: manual;
}

.container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 0px 0px;
  grid-auto-flow: row;
  grid-template-areas:
    ". . central-area central-area . ."
    ". . central-area central-area . ."
    ". . central-area central-area . .";
}

.central-area {
  display: grid;
  grid-area: central-area;
  background-color: transparent;
  align-items: center;
  justify-items: center;
}

html,
body,
.container {
  height: 100vh;
  margin: 0;
  background-color: var(--color-background);
  overflow: hidden;
}

body.theme-apple .container {
  background-image: url("/v3/images/sora_bg_1.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Video background for phone */
.phone-video-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-in-out;
}

body.theme-video .phone-video-background {
  opacity: 1;
}

body.theme-video .screen {
  background-color: transparent;
}

body.theme-video .phone-frame {
  background-color: #000000;
  border-color: #000000;
}

html,
body {
  position: fixed;
  width: 100%;
}

body {
  font-family: --apple-system, Helvetica, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

.glass {
  position: relative;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(2px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 2rem;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.2),
    inset 0 4px 20px rgba(255, 255, 255, 0.3);
}

.glass::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2rem;
  backdrop-filter: blur(1px);
  box-shadow: inset -10px -8px 0px -11px rgba(255, 255, 255, 1),
    inset 0px -9px 0px -8px rgba(255, 255, 255, 1);
  opacity: 0.6;
  z-index: -1;
  filter: blur(1px) drop-shadow(10px 4px 6px black) brightness(115%);
}

/* For presentation only, no need to copy the code below */

/* .container * {
  border: 1px solid red;
      position: relative;
    } */

/* .container *:after {
      content: attr(class);
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: grid;
      align-items: center;
      justify-content: center;
    } */

.phone {
  position: relative;
}

.phone-cell a {
  text-decoration: none !important;
}

.phone-frame {
  width: 300px;
  /* Reduced base size */
  height: 600px;
  /* Half of original height */
  background-color: var(--color-phone-background);
  border-radius: 40px 40px 40px 40px;
  /* Round only top corners */
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
  /* Default: 3px transparent border for consistent sizing across all themes */
  border: 3px solid transparent;
  border-bottom: 3px solid transparent;
  box-sizing: border-box;
  /* Include border in width/height calculations */
  z-index: 20;
  /* Ensure phone frame is above grid lines */
  transform-origin: bottom center;
  /* Scale from bottom */
  transition: background-color 0.5s ease-in-out, border-color 0.5s ease-in-out,
    transform 0.3s ease-in-out;
}

.phone-cell {
  /* grid-column: 1 / 5; */
  /* grid-row: 4 / 8; */
  padding: 0 0 0 0;
  /* Add top padding, remove bottom to stick to edge */
  min-height: 450px;
  /* Increased significantly for better proportions */
  /* height: 50vh; */
  /* Take up half the viewport height */
  max-height: 600px;
  /* Set reasonable max */
  border-bottom: none;
  order: 3;
  flex-grow: 0;
  flex-shrink: 0;
  /* Don't shrink */
  display: flex;
  align-items: flex-end;
  /* Keep bottom alignment */
  justify-content: center;
  z-index: 20;
  /* Ensure phone is above grid lines */
  position: relative;
}

.screen {
  width: 100%;
  height: 100%;
  background-color: var(--color-phone-background);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 20;
  /* Ensure screen content is above grid lines */
  transition: background-color 0.5s ease-in-out;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  height: 40px;
}

.time {
  font-size: 14px;
  color: var(--color-text-phone);
  transition: color 0.5s ease-in-out;
}

.icons {
  display: flex;
  gap: 5px;
  color: var(--color-text-phone);
  transition: color 0.5s ease-in-out;
}

.lock-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px;
  overflow-y: auto;
  max-height: 100%;
  position: relative;
  z-index: 10;
}

.date {
  margin-top: 10px;
  font-size: 18px;
  color: var(--color-text-phone);
  transition: color 0.5s ease-in-out;
}

.clock {
  font-size: 80px;
  font-weight: 300;
  margin-top: -10px;
  color: var(--color-text-phone);
  transition: color 0.5s ease-in-out;
}

.text-bg {
  position: absolute;
  top: 0;
  left: 0;
  font-size: var(--font-size-text-bg);
  font-weight: 900;
  color: var(--color-text-bg);
  text-align: justify;
  text-wrap: balance;
  line-height: var(--line-height-text-bg);
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  background-image: var(--color-text-bg-gradient);
  pointer-events: none;
  overflow: hidden;
  width: 100%;
  height: 100%;
  transition: background-image var(--transition-slow);
}

/* Brand name in top left */
.brand-name {
  position: fixed;
  top: var(--logo-position-top);
  left: var(--logo-position-left);
  z-index: var(--z-index-footer);
  width: var(--logo-width);
  height: auto;
}

.brand-name svg {
  width: 100%;
  height: auto;
  display: block;
}

.brand-name svg text {
  fill: var(--color-logo);
  transition: fill var(--transition-slow);
}

/* Logo icon in bottom right of phone screen */
.logo-icon {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 50;
}

/* Logo style toggle system - controlled by body class */

/* Rounded icon with background (default) */
.logo-icon-wrapper {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-background);
  border-radius: 22%;
  transition: background var(--transition-slow),
    transform var(--transition-fast);
  flex-shrink: 0;
}

.logo-icon-wrapper:hover {
  transform: scale(1.05);
}

.logo-image {
  width: 40px;
  height: 40px;
  display: block;
}

/* Flat/cropped icon without background */
.logo-flat {
  width: auto;
  height: 24px;
  display: block;
  flex-shrink: 0;
  transition: filter var(--transition-slow);
}

/* Show/hide based on body class OR logo-icon class */
body.logo-style-rounded .logo-rounded,
.logo-icon.logo-style-rounded .logo-rounded {
  display: flex;
}

body.logo-style-rounded .logo-flat,
.logo-icon.logo-style-rounded .logo-flat {
  display: none;
}

body.logo-style-flat .logo-rounded,
.logo-icon.logo-style-flat .logo-rounded {
  display: none;
}

body.logo-style-flat .logo-flat,
.logo-icon.logo-style-flat .logo-flat {
  display: block;
}

/* Adjust logo color based on theme */
body.theme-black .logo-image,
body.theme-green .logo-image,
body.theme-video .logo-image {
  filter: brightness(0) invert(1);
}

body.theme-white .logo-image,
body.theme-yellow .logo-image,
body.theme-mint .logo-image,
body.theme-peach .logo-image,
body.theme-lavender .logo-image,
body.theme-blue .logo-image,
body.theme-pink .logo-image {
  filter: brightness(0) invert(0);
}

/* Flat logo color adjustments */
body.theme-black .logo-flat,
body.theme-green .logo-flat,
body.theme-video .logo-flat {
  filter: brightness(0) invert(1);
}

body.theme-white .logo-flat,
body.theme-yellow .logo-flat,
body.theme-mint .logo-flat,
body.theme-peach .logo-flat,
body.theme-lavender .logo-flat,
body.theme-blue .logo-flat,
body.theme-pink .logo-flat {
  filter: brightness(0) invert(0);
}

.footer-links {
  position: fixed;
  bottom: var(--spacing-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--spacing-md);
  z-index: var(--z-index-footer);
  opacity: 1;
  transition: opacity var(--transition-normal);
  pointer-events: auto;
}

.footer-links a {
  color: var(--color-button-text);
  text-decoration: none;
  font-size: var(--font-size-footer);
  font-weight: 500;
  transition: opacity var(--transition-fast), color var(--transition-slow);
  white-space: nowrap;
}

.footer-links a:hover {
  opacity: 0.7;
}

.phone-cell {
  position: relative;
}

.time .colon {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
  html,
  body {
    position: fixed;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    /* Use dynamic viewport height for mobile browsers */
  }

  .brand-name {
    top: var(--logo-position-mobile);
    left: var(--logo-position-mobile);
    width: var(--logo-width-mobile);
  }

  .logo-icon {
    bottom: 25px;
    right: 25px;
  }

  .logo-icon-wrapper {
    width: 44px;
    height: 44px;
  }

  .logo-image {
    width: 32px;
    height: 32px;
  }

  .logo-flat {
    height: 20px;
  }

  .container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
  }

  .central-area {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
  }

  .phone-cell {
    min-height: auto;
    max-height: none;
    width: 100%;
    height: 100%;
    max-width: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .phone-frame {
    width: calc(100vw - 80px);
    height: calc(100vh - 120px);
    height: calc(100dvh - 120px);
    max-width: calc(100vw - 80px);
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    min-height: auto;
  }

  .text-bg {
    font-size: var(--font-size-text-bg-mobile);
    padding: var(--spacing-md);
  }

  /* text-fit handles sizing automatically - no manual overrides needed */

  .button {
    font-size: clamp(18px, 5vw, 24px);
    padding: var(--spacing-xs) var(--spacing-md);
  }

  .text-content {
    gap: var(--text-content-gap-mobile);
  }

  .footer-links {
    opacity: 1;
    pointer-events: auto;
    bottom: var(--spacing-xs);
    gap: var(--spacing-sm);
  }

  .footer-links a {
    font-size: var(--font-size-footer-mobile);
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .brand-name {
    top: var(--logo-position-mobile);
    left: var(--logo-position-mobile);
    width: var(--logo-width-mobile-sm);
  }

  .logo-icon {
    bottom: 20px;
    right: 20px;
  }

  .logo-icon-wrapper {
    width: 38px;
    height: 38px;
  }

  .logo-image {
    width: 28px;
    height: 28px;
  }

  .logo-flat {
    height: 18px;
  }

  .text-bg {
    font-size: clamp(36px, 10vw, 64px);
    padding: var(--spacing-md);
  }

  /* text-fit handles sizing automatically - no manual overrides needed */
}

/* Very small screens (320px - iPhone SE, etc) */
@media (max-width: 380px) {
  /* text-fit handles sizing automatically - no manual overrides needed */
}

/* Animated border properties */
@property --glow-deg {
  syntax: "<angle>";
  inherits: true;
  initial-value: -90deg;
}

@property --clr-1 {
  syntax: "<color>";
  inherits: true;
  initial-value: #ff0080;
}

@property --clr-2 {
  syntax: "<color>";
  inherits: true;
  initial-value: #ff8c00;
}

@property --clr-3 {
  syntax: "<color>";
  inherits: true;
  initial-value: #40e0d0;
}

@property --clr-4 {
  syntax: "<color>";
  inherits: true;
  initial-value: #4169e1;
}

@property --clr-5 {
  syntax: "<color>";
  inherits: true;
  initial-value: #9370db;
}

/* Animated border for phone */
.phone.animated-border .phone-frame {
  --gradient-glow: var(--clr-1), var(--clr-2), var(--clr-3), var(--clr-4),
    var(--clr-5), var(--clr-1);
  --border-width: 3px;
  --glow-size: 1.5rem;
  --glow-intensity: 0.3;

  /* Override transparent border with animated gradient border */
  border: var(--border-width) solid transparent;
  border-bottom: var(--border-width) solid transparent;
  background: linear-gradient(var(--color-phone-background) 0 0) padding-box,
    conic-gradient(from var(--glow-deg), var(--gradient-glow)) border-box;

  position: relative;
  isolation: isolate;

  animation: glow 10s infinite linear;
}

/* Adjust screen size to compensate for thinner border */
.phone.animated-border .screen {
  /* Add padding to compensate: (10px - 3px) = 7px per side */
  /* padding: 0px; */
  box-sizing: border-box;
}

@keyframes glow {
  100% {
    --glow-deg: 270deg;
  }
}

.phone.animated-border .phone-frame::before,
.phone.animated-border .phone-frame::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
}

.phone.animated-border .phone-frame::before {
  z-index: -1;
  background: var(--color-phone-background);
  inset: 0.5rem;
  /* scale: 1.1; */
  filter: blur(var(--glow-size));
}

.phone.animated-border .phone-frame::after {
  z-index: -2;
  inset: -1rem;
  background: conic-gradient(from var(--glow-deg), var(--gradient-glow));
  filter: blur(var(--glow-size));
  opacity: var(--glow-intensity);
}

/* View Transition API Styles */

/* Root fade transition */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.5s;
}

::view-transition-old(root) {
  animation-name: fade-out;
}

::view-transition-new(root) {
  animation-name: fade-in;
}

/* Headline slide transition */
.headline {
  view-transition-name: headline-transition;
}

::view-transition-old(headline-transition) {
  animation: slide-out-up 0.5s ease-in-out;
}

::view-transition-new(headline-transition) {
  animation: slide-in-up 0.5s ease-in-out;
}

/* Phone frame smooth transition */
.phone {
  view-transition-name: phone-transition;
}

::view-transition-old(phone-transition),
::view-transition-new(phone-transition) {
  animation-duration: 0.5s;
}

/* Keyframe animations */
@keyframes fade-out {
  to {
    opacity: 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes slide-out-up {
  to {
    transform: translateY(-20px);
    opacity: 0;
  }
}

@keyframes slide-in-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root),
  ::view-transition-old(headline-transition),
  ::view-transition-new(headline-transition),
  ::view-transition-old(phone-transition),
  ::view-transition-new(phone-transition) {
    animation: none !important;
  }
}
