:root {
  color-scheme: light;
  --iphone16-screen-width: 440px;
  --iphone16-screen-height: 956px;
  --phone-bezel: 12px;
  --phone-shell-width: calc(var(--iphone16-screen-width) + var(--phone-bezel) * 2);
  --phone-shell-height: calc(var(--iphone16-screen-height) + var(--phone-bezel) * 2);
  --simulator-scale: 1;
  --bg-top: #f4efe4;
  --bg-bottom: #dbe6f7;
  --panel-bg: rgba(255, 255, 255, 0.72);
  --panel-border: rgba(32, 40, 67, 0.12);
  --text-main: #10203f;
  --text-subtle: #51617d;
  --accent: #0f6fff;
  --accent-dark: #0c4bcc;
  --phone-frame: #0d1324;
  --phone-edge: #20283b;
  --screen-bg: #ffffff;
  --shadow-soft: 0 28px 80px rgba(17, 25, 52, 0.18);
  --shadow-phone: 0 30px 75px rgba(8, 13, 28, 0.28);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --font-display: "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-display);
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), transparent 34%),
    radial-gradient(circle at bottom right, rgba(150, 183, 255, 0.38), transparent 28%),
    linear-gradient(145deg, var(--bg-top), var(--bg-bottom));
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(340px, 1fr);
  gap: 32px;
  padding: 32px 24px;
  align-items: start;
}

.control-panel {
  width: min(100%, 380px);
  justify-self: end;
  padding: 24px 22px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.panel-copy {
  display: grid;
  gap: 8px;
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.control-panel h1 {
  margin: 0;
  font-size: clamp(1.7rem, 2.3vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-subtle);
}

.url-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 18px;
}

.url-bar input {
  width: 100%;
  height: 50px;
  border: 1px solid rgba(15, 111, 255, 0.18);
  border-radius: 16px;
  padding: 0 16px;
  font-size: 0.95rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.url-bar input:focus {
  outline: none;
  border-color: rgba(15, 111, 255, 0.58);
  box-shadow: 0 0 0 4px rgba(15, 111, 255, 0.12);
  transform: translateY(-1px);
}

.url-bar button {
  height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(15, 111, 255, 0.26);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.url-bar button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(15, 111, 255, 0.34);
}

.status-text {
  margin: 12px 0 0;
  min-height: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(32, 40, 67, 0.08);
  font-size: 0.87rem;
  color: var(--text-subtle);
  line-height: 1.5;
}

.simulator-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  min-height: calc(var(--phone-shell-height) * var(--simulator-scale));
}

.phone-shell {
  position: relative;
  width: calc(var(--phone-shell-width) * var(--simulator-scale));
  height: calc(var(--phone-shell-height) * var(--simulator-scale));
  flex: 0 0 auto;
}

.phone-frame {
  position: relative;
  width: var(--phone-shell-width);
  height: var(--phone-shell-height);
  padding: var(--phone-bezel);
  border-radius: 58px;
  background:
    linear-gradient(150deg, #343f58 0%, var(--phone-frame) 45%, #060913 100%);
  box-shadow: var(--shadow-phone);
  transform: scale(var(--simulator-scale));
  transform-origin: top left;
}

.phone-frame::before,
.phone-frame::after {
  content: "";
  position: absolute;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.05));
}

.phone-frame::before {
  height: 104px;
  left: -2px;
  top: 180px;
}

.phone-frame::after {
  height: 56px;
  right: -2px;
  top: 220px;
}

.phone-screen {
  position: relative;
  width: var(--iphone16-screen-width);
  height: var(--iphone16-screen-height);
  overflow: hidden;
  border-radius: 48px;
  background: var(--screen-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.dynamic-island {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 36px;
  border-radius: 999px;
  background: rgba(6, 8, 13, 0.96);
  z-index: 2;
}

#preview-frame {
  display: block;
  width: var(--iphone16-screen-width);
  height: var(--iphone16-screen-height);
  border: 0;
  background: #fff;
}

.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;
}

@media (max-width: 980px) {
  .page-shell {
    grid-template-columns: 1fr;
    padding: 24px 18px 32px;
    gap: 20px;
  }

  .control-panel {
    width: 100%;
    max-width: none;
    justify-self: stretch;
    padding: 20px 18px;
  }

  .simulator-stage {
    min-height: unset;
  }
}

@media (max-width: 560px) {
  .url-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {

  .simulator-stage {
    overflow-x: auto;
    justify-content: center;
    padding-bottom: 8px;
  }
}
